diff options
| author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2014-03-26 19:21:20 +0000 |
|---|---|---|
| committer | <> | 2014-05-08 15:03:54 +0000 |
| commit | fb123f93f9f5ce42c8e5785d2f8e0edaf951740e (patch) | |
| tree | c2103d76aec5f1f10892cd1d3a38e24f665ae5db /src/VBox/Frontends/VBoxManage/VBoxManageBandwidthControl.cpp | |
| parent | 58ed4748338f9466599adfc8a9171280ed99e23f (diff) | |
| download | VirtualBox-master.tar.gz | |
Imported from /home/lorry/working-area/delta_VirtualBox/VirtualBox-4.3.10.tar.bz2.HEADVirtualBox-4.3.10master
Diffstat (limited to 'src/VBox/Frontends/VBoxManage/VBoxManageBandwidthControl.cpp')
| -rw-r--r-- | src/VBox/Frontends/VBoxManage/VBoxManageBandwidthControl.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/src/VBox/Frontends/VBoxManage/VBoxManageBandwidthControl.cpp b/src/VBox/Frontends/VBoxManage/VBoxManageBandwidthControl.cpp index 6e708f9c..2765372b 100644 --- a/src/VBox/Frontends/VBoxManage/VBoxManageBandwidthControl.cpp +++ b/src/VBox/Frontends/VBoxManage/VBoxManageBandwidthControl.cpp @@ -4,7 +4,7 @@ */ /* - * Copyright (C) 2006-2010 Oracle Corporation + * Copyright (C) 2006-2012 Oracle Corporation * * This file is part of VirtualBox Open Source Edition (OSE), as * available from http://www.virtualbox.org. This file is free software; @@ -107,6 +107,12 @@ static RTEXITCODE handleBandwidthControlAdd(HandlerArg *a, ComPtr<IBandwidthCont Bstr name(a->argv[2]); + if (name.isEmpty()) + { + errorArgument("Bandwidth group name must not be empty!\n"); + return RTEXITCODE_FAILURE; + } + const char *pszType = NULL; int64_t cMaxBytesPerSec = INT64_MAX; @@ -166,7 +172,7 @@ static RTEXITCODE handleBandwidthControlAdd(HandlerArg *a, ComPtr<IBandwidthCont errorArgument("Invalid bandwidth group type\n"); return RTEXITCODE_FAILURE; } - + CHECK_ERROR2_RET(bwCtrl, CreateBandwidthGroup(name.raw(), enmType, (LONG64)cMaxBytesPerSec), RTEXITCODE_FAILURE); return RTEXITCODE_SUCCESS; @@ -226,7 +232,7 @@ static RTEXITCODE handleBandwidthControlSet(HandlerArg *a, ComPtr<IBandwidthCont } } - + if (cMaxBytesPerSec != INT64_MAX) { ComPtr<IBandwidthGroup> bwGroup; @@ -274,8 +280,11 @@ static RTEXITCODE handleBandwidthControlList(HandlerArg *pArgs, ComPtr<IBandwidt { switch (c) { - case 'M': enmDetails = VMINFO_MACHINEREADABLE; break; - default: return errorGetOpt(USAGE_BANDWIDTHCONTROL, c, &ValueUnion); + case 'M': + enmDetails = VMINFO_MACHINEREADABLE; + break; + default: + return errorGetOpt(USAGE_BANDWIDTHCONTROL, c, &ValueUnion); } } |
