- Timestamp:
- Jul 13, 2011 6:34:49 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 72840
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/manual/en_US/user_VBoxManage.xml
r37925 r37929 1567 1567 <screen>VBoxManage storageattach <uuid|vmname> 1568 1568 --storagectl <name> 1569 --port <number>1569 [--port <number>] 1570 1570 [--device <number>] 1571 1571 [--type dvddrive|hdd|fdd] … … 1582 1582 [--server <name>|<ip>] 1583 1583 [--target <target>] 1584 [-- port <port>]1584 [--tport <port>] 1585 1585 [--lun <lun>] 1586 1586 [--encodedlun <lun>] … … 1618 1618 <glossdef> 1619 1619 <para>The number of the storage controller's port which is to be 1620 modified. Mandatory.</para> 1620 modified. Mandatory, unless the storage controller has only a 1621 single port.</para> 1621 1622 </glossdef> 1622 1623 </glossentry> … … 1627 1628 <glossdef> 1628 1629 <para>The number of the port's device which is to be modified. 1629 Optional. Default value is 0.</para> 1630 Mandatory, unless the storage controller has only a single device 1631 per port.</para> 1630 1632 </glossdef> 1631 1633 </glossentry> -
trunk/doc/manual/user_ChangeLogImpl.xml
r37915 r37929 111 111 <para>GUI: decrease time before showing the VM configuration 112 112 dialog</para> 113 </listitem> 114 115 <listitem> 116 <para>VBoxManage: more convenient configuration of storage controller 117 attachments by automatically determining the port or device parameter 118 when a storage controller has only one port or device per port</para> 113 119 </listitem> 114 120 -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r37925 r37929 458 458 "VBoxManage storageattach <uuid|vmname>\n" 459 459 " --storagectl <name>\n" 460 " --port <number>\n"460 " [--port <number>]\n" 461 461 " [--device <number>]\n" 462 462 " [--type dvddrive|hdd|fdd]\n" … … 475 475 " [--server <name>|<ip>]\n" 476 476 " [--target <target>]\n" 477 " [-- port <port>]\n"477 " [--tport <port>]\n" 478 478 " [--lun <lun>]\n" 479 479 " [--encodedlun <lun>]\n" -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageStorageController.cpp
r37925 r37929 62 62 { "--server", 'S', RTGETOPT_REQ_STRING }, 63 63 { "--target", 'T', RTGETOPT_REQ_STRING }, 64 { "-- port",'P', RTGETOPT_REQ_STRING },64 { "--tport", 'P', RTGETOPT_REQ_STRING }, 65 65 { "--lun", 'L', RTGETOPT_REQ_STRING }, 66 66 { "--encodedlun", 'E', RTGETOPT_REQ_STRING }, … … 75 75 HRESULT rc = S_OK; 76 76 ULONG port = ~0U; 77 ULONG device = 0; /* device is optional, default is 0 */77 ULONG device = ~0U; 78 78 bool fForceUnmount = false; 79 79 bool fSetMediumType = false; … … 239 239 break; 240 240 241 case 'P': // -- port241 case 'P': // --tport 242 242 bstrPort = ValueUnion.psz; 243 243 break; … … 286 286 if (!pszCtl) 287 287 return errorSyntax(USAGE_STORAGEATTACH, "Storage controller name not specified"); 288 if (port == ~0U)289 return errorSyntax(USAGE_STORAGEATTACH, "Port not specified");290 288 291 289 /* get the virtualbox system properties */ … … 317 315 if (FAILED(rc)) 318 316 throw Utf8StrFmt("Could not find a controller named '%s'\n", pszCtl); 317 318 StorageBus_T storageBus = StorageBus_Null; 319 CHECK_ERROR_RET(storageCtl, COMGETTER(Bus)(&storageBus), 1); 320 ULONG maxPorts = 0; 321 CHECK_ERROR_RET(systemProperties, GetMaxPortCountForStorageBus(storageBus, &maxPorts), 1); 322 ULONG maxDevices = 0; 323 CHECK_ERROR_RET(systemProperties, GetMaxDevicesPerPortForStorageBus(storageBus, &maxDevices), 1); 324 325 if (port == ~0U) 326 { 327 if (maxPorts == 1) 328 port = 0; 329 else 330 return errorSyntax(USAGE_STORAGEATTACH, "Port not specified"); 331 } 332 if (device == ~0U) 333 { 334 if (maxDevices == 1) 335 device = 0; 336 else 337 return errorSyntax(USAGE_STORAGEATTACH, "Device not specified"); 338 } 319 339 320 340 /* for sata controller check if the port count is big enough … … 376 396 else 377 397 { 378 StorageBus_T storageBus = StorageBus_Null;379 398 DeviceType_T deviceType = DeviceType_Null; 380 399 com::SafeArray <DeviceType_T> saDeviceTypes; … … 382 401 383 402 /* check if the device type is supported by the controller */ 384 CHECK_ERROR(storageCtl, COMGETTER(Bus)(&storageBus));385 403 CHECK_ERROR(systemProperties, GetDeviceTypesForStorageBus(storageBus, ComSafeArrayAsOutParam(saDeviceTypes))); 386 404 for (size_t i = 0; i < saDeviceTypes.size(); ++ i) … … 461 479 /* check if the device type is supported by the controller */ 462 480 { 463 StorageBus_T storageBus = StorageBus_Null;464 481 com::SafeArray <DeviceType_T> saDeviceTypes; 465 482 466 CHECK_ERROR(storageCtl, COMGETTER(Bus)(&storageBus));467 483 CHECK_ERROR(systemProperties, GetDeviceTypesForStorageBus(storageBus, ComSafeArrayAsOutParam(saDeviceTypes))); 468 484 if (SUCCEEDED(rc))
Note:
See TracChangeset
for help on using the changeset viewer.