Changeset 23902 in vbox for trunk/src/VBox
- Timestamp:
- Oct 20, 2009 2:32:19 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 53702
- Location:
- trunk/src/VBox/Frontends/VBoxManage
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r23802 r23902 2031 2031 { "closemedium", handleCloseMedium }, 2032 2032 { "unregisterimage", handleCloseMedium }, /* backward compatiblity */ 2033 { " attachdisk", handleAttachDisk},2033 { "storageattach", handleStorageAttach }, 2034 2034 { "storagectl", handleStorageController }, 2035 2035 { "showhdinfo", handleShowHardDiskInfo }, -
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h
r23882 r23902 92 92 #define USAGE_DHCPSERVER RT_BIT_64(47) 93 93 #define USAGE_DUMPHDINFO RT_BIT_64(48) 94 #define USAGE_ ATTACHDISKRT_BIT_64(49)94 #define USAGE_STORAGEATTACH RT_BIT_64(49) 95 95 #define USAGE_STORAGECONTROLLER RT_BIT_64(50) 96 96 #define USAGE_ALL (~(uint64_t)0) … … 197 197 198 198 /* VBoxManageStorageController.cpp */ 199 int handle AttachDisk(HandlerArg *a);199 int handleStorageAttach(HandlerArg *a); 200 200 int handleStorageController(HandlerArg *a); 201 201 -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageHelp.cpp
r23882 r23902 349 349 } 350 350 351 if (u64Cmd & USAGE_ATTACHDISK) 352 { 353 RTPrintf("VBoxManage attachdisk <uuid|vmname>\n" 354 " --type <dvd|hdd|fdd>\n" 355 " --file <null|none|uuid|filename|host:<drive>>\n" 356 " --controller <name>\n" 351 if (u64Cmd & USAGE_STORAGEATTACH) 352 { 353 RTPrintf("VBoxManage storageattach <uuid|vmname>\n" 354 " --storagectl <name>\n" 357 355 " --port <number>\n" 358 356 " --device <number>\n" 357 " [--type <dvddrive|hdd|fdd>\n" 358 " --medium <none|emptydrive|uuid|filename|host:<drive>>]\n" 359 " [--passthrough <on|off>]\n" 359 360 "\n"); 360 361 } … … 366 367 " [--add <ide/sata/scsi/floppy>]\n" 367 368 " [--controller <LsiLogic/BusLogic/IntelAhci/PIIX3/PIIX4/ICH6/I82078>]\n" 368 " [--passthrough <on|off> --port <number> --device <number>]\n"369 369 " [--sataideemulation<1-4> <1-30>]\n" 370 370 " [--sataportcount <1-30>]\n" -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageStorageController.cpp
r23809 r23902 47 47 48 48 49 static const RTGETOPTDEF g_a AttachDiskOptions[] =49 static const RTGETOPTDEF g_aStorageAttachOptions[] = 50 50 { 51 { "--type", 't', RTGETOPT_REQ_STRING }, 52 { "--file", 'f', RTGETOPT_REQ_STRING }, 53 { "--controller", 'c', RTGETOPT_REQ_STRING }, 51 { "--storagectl", 's', RTGETOPT_REQ_STRING }, 54 52 { "--port", 'p', RTGETOPT_REQ_UINT32 }, 55 53 { "--device", 'd', RTGETOPT_REQ_UINT32 }, 54 { "--medium", 'm', RTGETOPT_REQ_STRING }, 55 { "--type", 't', RTGETOPT_REQ_STRING }, 56 { "--passthrough", 'h', RTGETOPT_REQ_STRING }, 56 57 }; 57 58 58 int handle AttachDisk(HandlerArg *a)59 int handleStorageAttach(HandlerArg *a) 59 60 { 60 61 int c; 61 62 HRESULT rc = S_OK; 62 ULONG port = 0;63 ULONG device = 0;63 ULONG port = ~0U; 64 ULONG device = ~0U; 64 65 bool fRunTime = false; 65 66 const char *pszCtl = NULL; 66 67 const char *pszType = NULL; 67 const char *pszFile = NULL; 68 const char *pszMedium = NULL; 69 const char *pszPassThrough = NULL; 68 70 Bstr machineuuid (a->argv[0]); 69 71 RTGETOPTUNION ValueUnion; … … 72 74 ComPtr<IStorageController> storageCtl; 73 75 74 if (a->argc < 11)75 return errorSyntax(USAGE_ ATTACHDISK, "Too few parameters");76 else if (a->argc > 1 1)77 return errorSyntax(USAGE_ ATTACHDISK, "Too many parameters");78 79 RTGetOptInit (&GetState, a->argc, a->argv, g_a AttachDiskOptions,80 RT_ELEMENTS(g_a AttachDiskOptions), 1, 0 /* fFlags */);76 if (a->argc < 9) 77 return errorSyntax(USAGE_STORAGEATTACH, "Too few parameters"); 78 else if (a->argc > 13) 79 return errorSyntax(USAGE_STORAGEATTACH, "Too many parameters"); 80 81 RTGetOptInit (&GetState, a->argc, a->argv, g_aStorageAttachOptions, 82 RT_ELEMENTS(g_aStorageAttachOptions), 1, 0 /* fFlags */); 81 83 82 84 while ( SUCCEEDED(rc) … … 85 87 switch (c) 86 88 { 87 case 't': // type <dvd|hdd|fdd> 89 case 's': // storage controller name 90 { 91 if (ValueUnion.psz) 92 pszCtl = ValueUnion.psz; 93 else 94 rc = E_FAIL; 95 break; 96 } 97 98 case 'p': // port 99 { 100 port = ValueUnion.u32; 101 break; 102 } 103 104 case 'd': // device 105 { 106 device = ValueUnion.u32; 107 break; 108 } 109 110 case 'm': // medium <none|emptydrive|uuid|filename|host:<drive>> 111 { 112 if (ValueUnion.psz) 113 pszMedium = ValueUnion.psz; 114 else 115 rc = E_FAIL; 116 break; 117 } 118 119 case 't': // type <dvddrive|hdd|fdd> 88 120 { 89 121 if (ValueUnion.psz) … … 94 126 } 95 127 96 case ' f': // file <none|uuid|filename|host:<drive>>128 case 'h': // passthrough <on|off> 97 129 { 98 130 if (ValueUnion.psz) 99 pszFile = ValueUnion.psz; 100 else 101 rc = E_FAIL; 102 break; 103 } 104 105 case 'c': // controller name 106 { 107 if (ValueUnion.psz) 108 pszCtl = ValueUnion.psz; 109 else 110 rc = E_FAIL; 111 break; 112 } 113 114 case 'p': // port 115 { 116 port = ValueUnion.u32; 117 break; 118 } 119 120 case 'd': // device 121 { 122 device = ValueUnion.u32; 131 pszPassThrough = ValueUnion.psz; 132 else 133 rc = E_FAIL; 123 134 break; 124 135 } … … 126 137 default: 127 138 { 128 errorGetOpt(USAGE_ ATTACHDISK, c, &ValueUnion);139 errorGetOpt(USAGE_STORAGEATTACH, c, &ValueUnion); 129 140 rc = E_FAIL; 130 141 break; … … 133 144 } 134 145 135 if (FAILED(rc)) 136 return 1; 137 138 if ( fRunTime 139 && !RTStrICmp(pszType, "hdd")) 140 { 141 errorArgument("Harddisk's can't be changed while the VM is still running\n"); 146 if ( FAILED(rc) 147 || !pszCtl 148 || port == ~0U 149 || device == ~0U) 150 { 151 errorGetOpt(USAGE_STORAGEATTACH, c, &ValueUnion); 142 152 return 1; 143 153 } … … 163 173 } 164 174 175 if (fRunTime) 176 { 177 if ( !RTStrICmp(pszMedium, "none") 178 || !RTStrICmp(pszType, "hdd")) 179 errorArgument("DVD/HardDisk Drives can't be changed while the VM is still running\n"); 180 if (pszPassThrough) 181 errorArgument("Drive passthrough state can't be changed while the VM is still running\n"); 182 183 goto leave; 184 } 185 165 186 /* get the mutable session machine */ 166 187 a->session->COMGETTER(Machine)(machine.asOutParam()); … … 169 190 rc = machine->GetStorageControllerByName(Bstr(pszCtl), storageCtl.asOutParam()); 170 191 if (FAILED(rc)) 171 return errorSyntax(USAGE_ATTACHDISK, "Couldn't find the controller with the name: '%s'\n", pszCtl); 172 173 if (!RTStrICmp(pszType, "dvd")) 174 { 175 if (!RTStrICmp(pszFile, "null")) 176 { 177 if (fRunTime) 178 { 179 errorArgument("DVD Drive's can't be removed while the VM is still running\n"); 180 rc = E_FAIL; 181 } 182 else 183 { 184 CHECK_ERROR (machine, DetachDevice(Bstr(pszCtl), port, device)); 185 } 192 { 193 errorSyntax(USAGE_STORAGEATTACH, "Couldn't find the controller with the name: '%s'\n", pszCtl); 194 goto leave; 195 } 196 197 if (!RTStrICmp(pszMedium, "none")) 198 { 199 CHECK_ERROR (machine, DetachDevice(Bstr(pszCtl), port, device)); 200 } 201 else if (!RTStrICmp(pszMedium, "emptydrive")) 202 { 203 if (fRunTime) 204 { 205 ComPtr<IMediumAttachment> mediumAttachment; 206 rc = machine->GetMediumAttachment(Bstr(pszCtl), port, device, mediumAttachment.asOutParam()); 207 if (SUCCEEDED(rc)) 208 { 209 DeviceType_T deviceType; 210 mediumAttachment->COMGETTER(Type) (&deviceType); 211 212 if ( (deviceType == DeviceType_DVD) 213 || (deviceType == DeviceType_Floppy)) 214 { 215 /* just unmount the floppy/dvd */ 216 CHECK_ERROR (machine, MountMedium(Bstr(pszCtl), port, device, NULL)); 217 } 218 } 219 else 220 { 221 errorArgument("No DVD/Floppy Drive attached to the controller '%s'" 222 "at the port: %u, device: %u", pszCtl, port, device); 223 goto leave; 224 } 225 186 226 } 187 227 else 228 { 229 StorageBus_T storageBus = StorageBus_Null; 230 DeviceType_T deviceType = DeviceType_Null; 231 232 CHECK_ERROR (storageCtl, COMGETTER(Bus)(&storageBus)); 233 234 if (storageBus == StorageBus_Floppy) 235 deviceType = DeviceType_Floppy; 236 else 237 deviceType = DeviceType_DVD; 238 239 /* attach a empty floppy/dvd drive after removing previous attachment */ 240 machine->DetachDevice(Bstr(pszCtl), port, device); 241 CHECK_ERROR (machine, AttachDevice(Bstr(pszCtl), port, device, deviceType, NULL)); 242 } 243 } 244 else 245 { 246 if (!pszType) 247 { 248 errorSyntax(USAGE_STORAGEATTACH, "Argument --type not specified\n"); 249 goto leave; 250 } 251 252 if (!RTStrICmp(pszType, "dvddrive")) 188 253 { 189 254 Bstr uuid; … … 216 281 do 217 282 { 218 /* unmount? */219 if (!RTStrICmp(pszFile, "none"))220 {221 /* nothing to do, NULL object will cause unmount */222 }223 283 /* host drive? */ 224 else if (!RTStrNICmp(pszFile, "host:", 5))284 if (!RTStrNICmp(pszMedium, "host:", 5)) 225 285 { 226 286 ComPtr<IHost> host; 227 287 CHECK_ERROR (a->virtualBox, COMGETTER(Host)(host.asOutParam())); 228 rc = host->FindHostDVDDrive(Bstr(psz File+ 5), dvdMedium.asOutParam());288 rc = host->FindHostDVDDrive(Bstr(pszMedium + 5), dvdMedium.asOutParam()); 229 289 if (!dvdMedium) 230 290 { 231 291 /* 2nd try: try with the real name, important on Linux+libhal */ 232 292 char szPathReal[RTPATH_MAX]; 233 if (RT_FAILURE(RTPathReal(psz File+ 5, szPathReal, sizeof(szPathReal))))293 if (RT_FAILURE(RTPathReal(pszMedium + 5, szPathReal, sizeof(szPathReal)))) 234 294 { 235 errorArgument("Invalid host DVD drive name \"%s\"", psz File+ 5);295 errorArgument("Invalid host DVD drive name \"%s\"", pszMedium + 5); 236 296 rc = E_FAIL; 237 297 break; … … 240 300 if (!dvdMedium) 241 301 { 242 errorArgument("Invalid host DVD drive name \"%s\"", psz File+ 5);302 errorArgument("Invalid host DVD drive name \"%s\"", pszMedium + 5); 243 303 rc = E_FAIL; 244 304 break; … … 249 309 { 250 310 /* first assume it's a UUID */ 251 uuid = psz File;311 uuid = pszMedium; 252 312 rc = a->virtualBox->GetDVDImage(uuid, dvdMedium.asOutParam()); 253 313 if (FAILED(rc) || !dvdMedium) 254 314 { 255 315 /* must be a filename, check if it's in the collection */ 256 rc = a->virtualBox->FindDVDImage(Bstr(psz File), dvdMedium.asOutParam());316 rc = a->virtualBox->FindDVDImage(Bstr(pszMedium), dvdMedium.asOutParam()); 257 317 /* not registered, do that on the fly */ 258 318 if (!dvdMedium) 259 319 { 260 320 Bstr emptyUUID; 261 CHECK_ERROR (a->virtualBox, OpenDVDImage(Bstr(psz File),321 CHECK_ERROR (a->virtualBox, OpenDVDImage(Bstr(pszMedium), 262 322 emptyUUID, dvdMedium.asOutParam())); 263 323 } … … 265 325 if (!dvdMedium) 266 326 { 327 errorArgument("Invalid UUID or filename \"%s\"", pszMedium); 267 328 rc = E_FAIL; 268 329 break; 269 330 } 270 331 } 271 } 272 while (0); 332 } while (0); 273 333 274 334 if (dvdMedium) 335 { 275 336 dvdMedium->COMGETTER(Id)(uuid.asOutParam()); 276 if (SUCCEEDED(rc))277 337 CHECK_ERROR (machine, MountMedium(Bstr(pszCtl), port, device, uuid)); 278 } 279 } 280 else if ( !RTStrICmp(pszType, "hdd") 281 && !fRunTime) 282 { 283 Bstr uuid(pszFile); 284 285 if ( !RTStrICmp(pszFile, "none") 286 || !RTStrICmp(pszFile, "null")) 287 { 288 machine->DetachDevice(Bstr(pszCtl), port, device); 289 } 290 else 338 } 339 } 340 else if ( !RTStrICmp(pszType, "hdd") 341 && !fRunTime) 291 342 { 292 343 ComPtr<IMediumAttachment> mediumAttachement; … … 304 355 305 356 /* first guess is that it's a UUID */ 357 Bstr uuid(pszMedium); 306 358 ComPtr<IMedium> hardDisk; 307 359 rc = a->virtualBox->GetHardDisk(uuid, hardDisk.asOutParam()); … … 310 362 if (!hardDisk) 311 363 { 312 rc = a->virtualBox->FindHardDisk(Bstr(psz File), hardDisk.asOutParam());364 rc = a->virtualBox->FindHardDisk(Bstr(pszMedium), hardDisk.asOutParam()); 313 365 if (FAILED(rc)) 314 366 { 315 367 /* open the new hard disk object */ 316 368 CHECK_ERROR (a->virtualBox, 317 OpenHardDisk(Bstr(psz File),369 OpenHardDisk(Bstr(pszMedium), 318 370 AccessMode_ReadWrite, false, Bstr(""), 319 371 false, Bstr(""), hardDisk.asOutParam())); … … 327 379 } 328 380 else 381 { 382 errorArgument("Invalid UUID or filename \"%s\"", pszMedium); 329 383 rc = E_FAIL; 330 } 331 } 332 else if (!RTStrICmp(pszType, "fdd")) 333 { 334 ComPtr<IMediumAttachment> floppyAttachment; 335 machine->GetMediumAttachment(Bstr(pszCtl), port, device, floppyAttachment.asOutParam()); 336 337 if (!RTStrICmp(pszFile, "null")) 338 { 339 if (fRunTime) 340 { 341 errorArgument("Floppy Drive's can't be removed while the VM is still running\n"); 342 rc = E_FAIL; 343 } 344 else 345 { 346 if (floppyAttachment) 347 CHECK_ERROR (machine, DetachDevice(Bstr(pszCtl), port, device)); 348 } 349 } 350 else 384 } 385 } 386 else if (!RTStrICmp(pszType, "fdd")) 351 387 { 352 388 Bstr uuid; 353 389 ComPtr<IMedium> floppyMedium; 390 ComPtr<IMediumAttachment> floppyAttachment; 391 machine->GetMediumAttachment(Bstr(pszCtl), port, device, floppyAttachment.asOutParam()); 354 392 355 393 if ( !fRunTime … … 357 395 CHECK_ERROR (machine, AttachDevice(Bstr(pszCtl), port, device, DeviceType_Floppy, NULL)); 358 396 359 /* unmount? */360 if (!RTStrICmp(pszFile, "none"))361 {362 /* nothing to do, NULL object will cause unmount */363 }364 397 /* host drive? */ 365 else if (!RTStrNICmp(pszFile, "host:", 5))398 if (!RTStrNICmp(pszMedium, "host:", 5)) 366 399 { 367 400 ComPtr<IHost> host; 368 401 369 402 CHECK_ERROR (a->virtualBox, COMGETTER(Host)(host.asOutParam())); 370 rc = host->FindHostFloppyDrive(Bstr(psz File+ 5), floppyMedium.asOutParam());403 rc = host->FindHostFloppyDrive(Bstr(pszMedium + 5), floppyMedium.asOutParam()); 371 404 if (!floppyMedium) 372 405 { 373 errorArgument("Invalid host floppy drive name \"%s\"", psz File+ 5);406 errorArgument("Invalid host floppy drive name \"%s\"", pszMedium + 5); 374 407 rc = E_FAIL; 375 408 } … … 378 411 { 379 412 /* first assume it's a UUID */ 380 uuid = psz File;413 uuid = pszMedium; 381 414 rc = a->virtualBox->GetFloppyImage(uuid, floppyMedium.asOutParam()); 382 415 if (FAILED(rc) || !floppyMedium) 383 416 { 384 417 /* must be a filename, check if it's in the collection */ 385 rc = a->virtualBox->FindFloppyImage(Bstr(psz File), floppyMedium.asOutParam());418 rc = a->virtualBox->FindFloppyImage(Bstr(pszMedium), floppyMedium.asOutParam()); 386 419 /* not registered, do that on the fly */ 387 420 if (!floppyMedium) … … 389 422 Bstr emptyUUID; 390 423 CHECK_ERROR (a->virtualBox, 391 OpenFloppyImage(Bstr(psz File),424 OpenFloppyImage(Bstr(pszMedium), 392 425 emptyUUID, 393 426 floppyMedium.asOutParam())); … … 396 429 397 430 if (!floppyMedium) 398 rc = E_FAIL; 431 { 432 errorArgument("Invalid UUID or filename \"%s\"", pszMedium); 433 rc = E_FAIL; 434 } 399 435 } 400 436 401 437 if (floppyMedium) 438 { 402 439 floppyMedium->COMGETTER(Id)(uuid.asOutParam()); 403 if (SUCCEEDED(rc))404 440 CHECK_ERROR (machine, MountMedium(Bstr(pszCtl), port, device, uuid)); 441 } 442 } 443 else 444 { 445 errorArgument("Invalid --type argument '%s'", pszType); 446 rc = E_FAIL; 447 } 448 } 449 450 if ( pszPassThrough 451 && (SUCCEEDED(rc))) 452 { 453 ComPtr<IMediumAttachment> mattach; 454 455 CHECK_ERROR (machine, GetMediumAttachment(Bstr(pszCtl), port, device, mattach.asOutParam())); 456 457 if (SUCCEEDED(rc)) 458 { 459 if (!RTStrICmp(pszPassThrough, "on")) 460 { 461 CHECK_ERROR (mattach, COMSETTER(Passthrough)(true)); 462 } 463 else if (!RTStrICmp(pszPassThrough, "off")) 464 { 465 CHECK_ERROR (mattach, COMSETTER(Passthrough)(false)); 466 } 467 else 468 { 469 errorArgument("Invalid --passthrough argument '%s'", pszPassThrough); 470 rc = E_FAIL; 471 } 472 } 473 else 474 { 475 errorArgument("Couldn't find the controller attachment for the controller '%s'\n", pszCtl); 476 rc = E_FAIL; 405 477 } 406 478 } … … 410 482 CHECK_ERROR (machine, SaveSettings()); 411 483 484 leave: 412 485 /* it's important to always close sessions */ 413 486 a->session->Close(); … … 421 494 { "--name", 'n', RTGETOPT_REQ_STRING }, 422 495 { "--add", 'a', RTGETOPT_REQ_STRING }, 423 { "--controller", 't', RTGETOPT_REQ_STRING }, 424 { "--port", 'p', RTGETOPT_REQ_UINT32 }, 425 { "--device", 'd', RTGETOPT_REQ_UINT32 }, 426 { "--passthrough", 'h', RTGETOPT_REQ_STRING }, 496 { "--controller", 'c', RTGETOPT_REQ_STRING }, 427 497 { "--sataideemulation", 'e', RTGETOPT_REQ_UINT32 | RTGETOPT_FLAG_INDEX }, 428 { "--sataportcount", ' c', RTGETOPT_REQ_UINT32 },498 { "--sataportcount", 'p', RTGETOPT_REQ_UINT32 }, 429 499 { "--remove", 'r', RTGETOPT_REQ_NOTHING }, 430 500 }; … … 437 507 const char *pszBusType = NULL; 438 508 const char *pszCtlType = NULL; 439 const char *pszPassThrough = NULL;440 ULONG cPass = 0;441 509 ULONG satabootdev = ~0U; 442 510 ULONG sataidedev = ~0U; 443 511 ULONG sataportcount = ~0U; 444 ULONG port = ~0U;445 ULONG device = ~0U;446 512 bool fRemoveCtl = false; 447 513 Bstr machineuuid (a->argv[0]); … … 479 545 } 480 546 481 case ' t': // controller <lsilogic/buslogic/intelahci/piix3/piix4/ich6/i82078>547 case 'c': // controller <lsilogic/buslogic/intelahci/piix3/piix4/ich6/i82078> 482 548 { 483 549 if (ValueUnion.psz) 484 550 pszCtlType = ValueUnion.psz; 485 else486 rc = E_FAIL;487 break;488 }489 490 case 'p': // port491 {492 port = ValueUnion.u32;493 cPass++;494 break;495 }496 497 case 'd': // device498 {499 device = ValueUnion.u32;500 cPass++;501 break;502 }503 504 case 'h': // passthrough505 {506 if (ValueUnion.psz)507 {508 pszPassThrough = ValueUnion.psz;509 cPass++;510 }511 551 else 512 552 rc = E_FAIL; … … 531 571 } 532 572 533 case ' c': // sataportcount573 case 'p': // sataportcount 534 574 { 535 575 sataportcount = ValueUnion.u32; … … 574 614 if (!pszCtl) 575 615 { 616 /* it's important to always close sessions */ 617 a->session->Close(); 576 618 errorSyntax(USAGE_STORAGECONTROLLER, "Storage Controller Name not specified\n"); 577 return 1;578 }579 580 if (cPass != 0 && cPass != 3)581 {582 errorSyntax(USAGE_STORAGECONTROLLER,583 "All three options (--passthrough, --port, --device)\n"584 "need to be specified for dvd passthrough to be applied\n");585 619 return 1; 586 620 } … … 596 630 { 597 631 ComPtr<IMediumAttachment> mediumAttach = mediumAttachments[i]; 598 LONG cPort = 0;599 LONG cDevice = 0;600 601 CHECK_ERROR (mediumAttach, COMGETTER(Port)(& cPort));602 CHECK_ERROR (mediumAttach, COMGETTER(Device)(& cDevice));603 CHECK_ERROR (machine, DetachDevice(Bstr(pszCtl), cPort, cDevice));632 LONG port = 0; 633 LONG device = 0; 634 635 CHECK_ERROR (mediumAttach, COMGETTER(Port)(&port)); 636 CHECK_ERROR (mediumAttach, COMGETTER(Device)(&device)); 637 CHECK_ERROR (machine, DetachDevice(Bstr(pszCtl), port, device)); 604 638 } 605 639 … … 689 723 } 690 724 691 if ( (cPass == 3)692 && SUCCEEDED(rc))693 {694 ComPtr<IMediumAttachment> mattach;695 696 CHECK_ERROR (machine, GetMediumAttachment(Bstr(pszCtl), port, device, mattach.asOutParam()));697 698 if (SUCCEEDED(rc))699 {700 if (!RTStrICmp(pszPassThrough, "on"))701 {702 CHECK_ERROR (mattach, COMSETTER(Passthrough)(true));703 }704 else if (!RTStrICmp(pszPassThrough, "off"))705 {706 CHECK_ERROR (mattach, COMSETTER(Passthrough)(false));707 }708 else709 {710 errorArgument("Invalid --passthrough argument '%s'", pszPassThrough);711 rc = E_FAIL;712 }713 }714 else715 {716 errorArgument("Couldn't find the controller attachment for the controller '%s'\n", pszCtl);717 rc = E_FAIL;718 }719 }720 721 725 if ( (sataportcount != ~0U) 722 726 && SUCCEEDED(rc))
Note:
See TracChangeset
for help on using the changeset viewer.