Changeset 24504 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Nov 9, 2009 1:35:37 PM (15 years ago)
- Location:
- trunk/src/VBox/Frontends/VBoxManage
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r24404 r24504 361 361 " --medium <none|emptydrive|uuid|filename|host:<drive>>]\n" 362 362 " [--passthrough <on|off>]\n" 363 " [--forceunmount <on|off>]\n" 363 364 "\n"); 364 365 } -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageStorageController.cpp
r24493 r24504 55 55 { "--type", 't', RTGETOPT_REQ_STRING }, 56 56 { "--passthrough", 'h', RTGETOPT_REQ_STRING }, 57 { "--forceunmount", 'f', RTGETOPT_REQ_BOOL_ONOFF }, 57 58 }; 58 59 … … 64 65 ULONG device = ~0U; 65 66 bool fRunTime = false; 67 bool fForceUnmount = false; 66 68 const char *pszCtl = NULL; 67 69 const char *pszType = NULL; … … 136 138 } 137 139 140 case 'f': // force unmount medium during runtime <on|off> 141 { 142 fForceUnmount = ValueUnion.f; 143 break; 144 } 145 138 146 default: 139 147 { … … 228 236 { 229 237 ComPtr<IMediumAttachment> mediumAttachment; 238 DeviceType_T deviceType = DeviceType_Null; 230 239 rc = machine->GetMediumAttachment(Bstr(pszCtl), port, device, mediumAttachment.asOutParam()); 231 240 if (SUCCEEDED(rc)) 232 241 { 233 DeviceType_T deviceType;234 242 mediumAttachment->COMGETTER(Type)(&deviceType); 235 243 … … 238 246 { 239 247 /* just unmount the floppy/dvd */ 240 CHECK_ERROR(machine, MountMedium(Bstr(pszCtl), port, device, Bstr(""), FALSE /* aForce */)); 241 } 242 else 243 { 244 errorArgument("No DVD/Floppy Drive attached to the controller '%s'" 245 "at the port: %u, device: %u", pszCtl, port, device); 246 goto leave; 247 } 248 } 249 else 248 CHECK_ERROR(machine, MountMedium(Bstr(pszCtl), port, device, Bstr(""), fForceUnmount)); 249 } 250 } 251 252 if ( FAILED(rc) 253 || !( deviceType == DeviceType_DVD 254 || deviceType == DeviceType_Floppy)) 250 255 { 251 256 errorArgument("No DVD/Floppy Drive attached to the controller '%s'" … … 493 498 { 494 499 dvdMedium->COMGETTER(Id)(uuid.asOutParam()); 495 CHECK_ERROR(machine, MountMedium(Bstr(pszCtl), port, device, uuid, FALSE /* aForce */));500 CHECK_ERROR(machine, MountMedium(Bstr(pszCtl), port, device, uuid, fForceUnmount)); 496 501 } 497 502 } … … 588 593 { 589 594 floppyMedium->COMGETTER(Id)(uuid.asOutParam()); 590 CHECK_ERROR(machine, MountMedium(Bstr(pszCtl), port, device, uuid, FALSE /* aForce */));595 CHECK_ERROR(machine, MountMedium(Bstr(pszCtl), port, device, uuid, fForceUnmount)); 591 596 } 592 597 }
Note:
See TracChangeset
for help on using the changeset viewer.