Changeset 42017 in vbox for trunk/src/VBox
- Timestamp:
- Jul 4, 2012 9:19:44 AM (13 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageStorageController.cpp
r41347 r42017 1013 1013 if (fRemoveCtl) 1014 1014 { 1015 com::SafeIfaceArray<IMediumAttachment> mediumAttachments; 1016 1017 CHECK_ERROR(machine, 1018 GetMediumAttachmentsOfController(Bstr(pszCtl).raw(), 1019 ComSafeArrayAsOutParam(mediumAttachments))); 1020 for (size_t i = 0; i < mediumAttachments.size(); ++ i) 1021 { 1022 ComPtr<IMediumAttachment> mediumAttach = mediumAttachments[i]; 1023 LONG port = 0; 1024 LONG device = 0; 1025 1026 CHECK_ERROR(mediumAttach, COMGETTER(Port)(&port)); 1027 CHECK_ERROR(mediumAttach, COMGETTER(Device)(&device)); 1028 CHECK_ERROR(machine, DetachDevice(Bstr(pszCtl).raw(), port, device)); 1029 } 1030 1031 if (SUCCEEDED(rc)) 1032 CHECK_ERROR(machine, RemoveStorageController(Bstr(pszCtl).raw())); 1033 else 1034 errorArgument("Can't detach the devices connected to '%s' Controller\n" 1035 "and thus its removal failed.", pszCtl); 1015 CHECK_ERROR(machine, RemoveStorageController(Bstr(pszCtl).raw())); 1036 1016 } 1037 1017 else -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp
r41819 r42017 3276 3276 if (fSuccess && !controller.isNull()) 3277 3277 { 3278 /* Remove storage attachments first: */ 3279 // TODO: Later, it will be possible to remove controller with all the attachments at one shot! 3280 /* For each storage attachment: */ 3281 for (int iAttachmentIndex = 0; fSuccess && iAttachmentIndex < controllerCache.childCount(); ++iAttachmentIndex) 3282 { 3283 /* Get attachment cache: */ 3284 const UICacheSettingsMachineStorageAttachment &attachmentCache = controllerCache.child(iAttachmentIndex); 3285 3286 /* Remove attachment if it was not just 'created': */ 3287 if (!attachmentCache.wasCreated()) 3288 fSuccess = removeStorageAttachment(controllerCache, attachmentCache); 3289 } 3290 /* Remove storage controller finally: */ 3291 if (fSuccess) 3292 { 3293 m_machine.RemoveStorageController(strControllerName); 3294 /* Check that machine is OK: */ 3295 fSuccess = m_machine.isOk(); 3296 } 3278 /*remove controller with all the attachments at one shot*/ 3279 m_machine.RemoveStorageController(strControllerName); 3280 /* Check that machine is OK: */ 3281 fSuccess = m_machine.isOk(); 3297 3282 } 3298 3283 } -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r41925 r42017 5202 5202 <method name="removeStorageController"> 5203 5203 <desc> 5204 Removes a storage controller from the machine .5204 Removes a storage controller from the machine with all devices attache to one. 5205 5205 5206 5206 <result name="VBOX_E_OBJECT_NOT_FOUND">
Note:
See TracChangeset
for help on using the changeset viewer.