Changeset 34587 in vbox for trunk/src/VBox/Frontends/VBoxManage
- Timestamp:
- Dec 1, 2010 8:30:02 PM (14 years ago)
- Location:
- trunk/src/VBox/Frontends/VBoxManage
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/Makefile.kmk
r33590 r34587 50 50 VBoxManageSnapshot.cpp \ 51 51 VBoxManageStorageController.cpp \ 52 VBoxManageUSB.cpp 52 VBoxManageUSB.cpp \ 53 VBoxManageBandwidthControl.cpp 53 54 endif # !VBOX_ONLY_DOCS 54 55 -
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r34244 r34587 432 432 { "dhcpserver", USAGE_DHCPSERVER, handleDHCPServer}, 433 433 { "extpack", USAGE_EXTPACK, handleExtPack}, 434 { "bandwidthctl", USAGE_BANDWIDTHCONTROL, handleBandwidthControl}, 434 435 { NULL, 0, NULL } 435 436 }; -
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h
r34244 r34587 98 98 #define USAGE_PASSWORDHASH RT_BIT_64(54) 99 99 #define USAGE_EXTPACK RT_BIT_64(55) 100 #define USAGE_BANDWIDTHCONTROL RT_BIT_64(56) 100 101 #define USAGE_ALL (~(uint64_t)0) 101 102 /** @} */ … … 241 242 int handleDHCPServer(HandlerArg *a); 242 243 244 /* VBoxManageBandwidthControl.cpp */ 245 int handleBandwidthControl(HandlerArg *a); 246 243 247 #endif /* !VBOX_ONLY_DOCS */ 244 248 -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r34574 r34587 464 464 " <uuid>|<filename>|host:<drive>]\n" 465 465 " [--passthrough on|off]\n" 466 " [--bandwidthgroup <name>]\n" 466 467 " [--forceunmount]\n" 467 468 "\n"); … … 481 482 " [--bootable on|off]\n" 482 483 " [--remove]\n" 484 "\n"); 485 } 486 487 if (u64Cmd & USAGE_BANDWIDTHCONTROL) 488 { 489 RTStrmPrintf(pStrm, 490 "VBoxManage bandwidthctl <uuid|vmname>\n" 491 " --name <name>\n" 492 " [--add disk|network]\n" 493 " [--limit <megabytes per second>\n" 494 " [--delete]\n" 483 495 "\n"); 484 496 } -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageStorageController.cpp
r34010 r34587 51 51 { "--type", 't', RTGETOPT_REQ_STRING }, 52 52 { "--passthrough", 'h', RTGETOPT_REQ_STRING }, 53 { "--bandwidthgroup", 'b', RTGETOPT_REQ_STRING }, 53 54 { "--forceunmount", 'f', RTGETOPT_REQ_NOTHING }, 54 55 }; … … 65 66 const char *pszMedium = NULL; 66 67 const char *pszPassThrough = NULL; 68 const char *pszBandwidthGroup = NULL; 67 69 RTGETOPTUNION ValueUnion; 68 70 RTGETOPTSTATE GetState; … … 127 129 if (ValueUnion.psz) 128 130 pszPassThrough = ValueUnion.psz; 131 else 132 rc = E_FAIL; 133 break; 134 } 135 136 case 'b': // bandwidthgroup <name> 137 { 138 if (ValueUnion.psz) 139 pszBandwidthGroup = ValueUnion.psz; 129 140 else 130 141 rc = E_FAIL; … … 185 196 { 186 197 errorArgument("Drive passthrough state can't be changed while the VM is running\n"); 198 goto leave; 199 } 200 201 if (fRunTime && pszBandwidthGroup) 202 { 203 errorArgument("Bandwidth group can't be changed while the VM is running\n"); 187 204 goto leave; 188 205 } … … 626 643 } 627 644 645 if ( pszBandwidthGroup 646 && !fRunTime 647 && SUCCEEDED(rc)) 648 { 649 650 if (!RTStrICmp(pszBandwidthGroup, "none")) 651 { 652 /* Just remove the bandwidth gorup. */ 653 CHECK_ERROR(machine, SetBandwidthGroupForDevice(Bstr(pszCtl).raw(), 654 port, device, NULL)); 655 } 656 else 657 { 658 ComPtr<IBandwidthControl> bwCtrl; 659 ComPtr<IBandwidthGroup> bwGroup; 660 661 CHECK_ERROR(machine, COMGETTER(BandwidthControl)(bwCtrl.asOutParam())); 662 663 if (SUCCEEDED(rc)) 664 { 665 CHECK_ERROR(bwCtrl, GetBandwidthGroup(Bstr(pszBandwidthGroup).raw(), bwGroup.asOutParam())); 666 if (SUCCEEDED(rc)) 667 { 668 CHECK_ERROR(machine, SetBandwidthGroupForDevice(Bstr(pszCtl).raw(), 669 port, device, bwGroup)); 670 } 671 } 672 } 673 } 674 628 675 /* commit changes */ 629 676 if (SUCCEEDED(rc))
Note:
See TracChangeset
for help on using the changeset viewer.