Changeset 23934 in vbox
- Timestamp:
- Oct 21, 2009 1:52:11 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 53746
- Location:
- trunk/src/VBox/Frontends/VBoxManage
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManage.cpp
r23902 r23934 575 575 if (!Guid(uuid).isEmpty()) 576 576 { 577 CHECK_ERROR (a->virtualBox, GetMachine(uuid, machine.asOutParam()));577 CHECK_ERROR(a->virtualBox, GetMachine(uuid, machine.asOutParam())); 578 578 } 579 579 else 580 580 { 581 CHECK_ERROR (a->virtualBox, FindMachine(uuid, machine.asOutParam()));581 CHECK_ERROR(a->virtualBox, FindMachine(uuid, machine.asOutParam())); 582 582 if (SUCCEEDED (rc)) 583 machine->COMGETTER(Id) 583 machine->COMGETTER(Id)(uuid.asOutParam()); 584 584 } 585 585 if (FAILED (rc)) … … 587 587 588 588 /* open a session for the VM */ 589 CHECK_ERROR_RET (a->virtualBox, OpenExistingSession(a->session, uuid), 1);589 CHECK_ERROR_RET(a->virtualBox, OpenExistingSession(a->session, uuid), 1); 590 590 591 591 do … … 593 593 /* get the associated console */ 594 594 ComPtr<IConsole> console; 595 CHECK_ERROR_BREAK 595 CHECK_ERROR_BREAK(a->session, COMGETTER(Console)(console.asOutParam())); 596 596 /* ... and session machine */ 597 597 ComPtr<IMachine> sessionMachine; 598 CHECK_ERROR_BREAK 598 CHECK_ERROR_BREAK(a->session, COMGETTER(Machine)(sessionMachine.asOutParam())); 599 599 600 600 /* which command? */ 601 601 if (!strcmp(a->argv[1], "pause")) 602 602 { 603 CHECK_ERROR_BREAK 603 CHECK_ERROR_BREAK(console, Pause()); 604 604 } 605 605 else if (!strcmp(a->argv[1], "resume")) 606 606 { 607 CHECK_ERROR_BREAK 607 CHECK_ERROR_BREAK(console, Resume()); 608 608 } 609 609 else if (!strcmp(a->argv[1], "reset")) 610 610 { 611 CHECK_ERROR_BREAK 611 CHECK_ERROR_BREAK(console, Reset()); 612 612 } 613 613 else if (!strcmp(a->argv[1], "poweroff")) 614 614 { 615 615 ComPtr<IProgress> progress; 616 CHECK_ERROR_BREAK 616 CHECK_ERROR_BREAK(console, PowerDown(progress.asOutParam())); 617 617 618 618 showProgress(progress); … … 636 636 { 637 637 ComPtr<IProgress> progress; 638 CHECK_ERROR_BREAK 638 CHECK_ERROR_BREAK(console, SaveState(progress.asOutParam())); 639 639 640 640 showProgress(progress); … … 657 657 else if (!strcmp(a->argv[1], "acpipowerbutton")) 658 658 { 659 CHECK_ERROR_BREAK 659 CHECK_ERROR_BREAK(console, PowerButton()); 660 660 } 661 661 else if (!strcmp(a->argv[1], "acpisleepbutton")) 662 662 { 663 CHECK_ERROR_BREAK 663 CHECK_ERROR_BREAK(console, SleepButton()); 664 664 } 665 665 else if (!strcmp(a->argv[1], "injectnmi")) … … 738 738 ULONG NetworkAdapterCount = 0; 739 739 ComPtr <ISystemProperties> info; 740 CHECK_ERROR_BREAK (a->virtualBox, COMGETTER(SystemProperties)(info.asOutParam()));741 CHECK_ERROR_BREAK (info, COMGETTER(NetworkAdapterCount)(&NetworkAdapterCount));740 CHECK_ERROR_BREAK(a->virtualBox, COMGETTER(SystemProperties)(info.asOutParam())); 741 CHECK_ERROR_BREAK(info, COMGETTER(NetworkAdapterCount)(&NetworkAdapterCount)); 742 742 743 743 unsigned n = parseNum(&a->argv[1][12], NetworkAdapterCount, "NIC"); … … 755 755 /* get the corresponding network adapter */ 756 756 ComPtr<INetworkAdapter> adapter; 757 CHECK_ERROR_BREAK 757 CHECK_ERROR_BREAK(sessionMachine, GetNetworkAdapter(n - 1, adapter.asOutParam())); 758 758 if (adapter) 759 759 { 760 760 if (!strcmp(a->argv[2], "on")) 761 761 { 762 CHECK_ERROR_BREAK 762 CHECK_ERROR_BREAK(adapter, COMSETTER(CableConnected)(TRUE)); 763 763 } 764 764 else if (!strcmp(a->argv[2], "off")) 765 765 { 766 CHECK_ERROR_BREAK 766 CHECK_ERROR_BREAK(adapter, COMSETTER(CableConnected)(FALSE)); 767 767 } 768 768 else … … 785 785 ULONG NetworkAdapterCount = 0; 786 786 ComPtr <ISystemProperties> info; 787 CHECK_ERROR_BREAK (a->virtualBox, COMGETTER(SystemProperties)(info.asOutParam()));788 CHECK_ERROR_BREAK (info, COMGETTER(NetworkAdapterCount)(&NetworkAdapterCount));787 CHECK_ERROR_BREAK(a->virtualBox, COMGETTER(SystemProperties)(info.asOutParam())); 788 CHECK_ERROR_BREAK(info, COMGETTER(NetworkAdapterCount)(&NetworkAdapterCount)); 789 789 790 790 unsigned n = parseNum(&a->argv[1][12], NetworkAdapterCount, "NIC"); … … 803 803 /* get the corresponding network adapter */ 804 804 ComPtr<INetworkAdapter> adapter; 805 CHECK_ERROR_BREAK 805 CHECK_ERROR_BREAK(sessionMachine, GetNetworkAdapter(n - 1, adapter.asOutParam())); 806 806 if (adapter) 807 807 { … … 812 812 if (a->argv[2]) 813 813 { 814 CHECK_ERROR_RET(adapter, COMSETTER(TraceFile) 814 CHECK_ERROR_RET(adapter, COMSETTER(TraceFile)(Bstr(a->argv[2])), 1); 815 815 } 816 816 else … … 832 832 ULONG NetworkAdapterCount = 0; 833 833 ComPtr <ISystemProperties> info; 834 CHECK_ERROR_BREAK (a->virtualBox, COMGETTER(SystemProperties)(info.asOutParam()));835 CHECK_ERROR_BREAK (info, COMGETTER(NetworkAdapterCount)(&NetworkAdapterCount));834 CHECK_ERROR_BREAK(a->virtualBox, COMGETTER(SystemProperties)(info.asOutParam())); 835 CHECK_ERROR_BREAK(info, COMGETTER(NetworkAdapterCount)(&NetworkAdapterCount)); 836 836 837 837 unsigned n = parseNum(&a->argv[1][8], NetworkAdapterCount, "NIC"); … … 850 850 /* get the corresponding network adapter */ 851 851 ComPtr<INetworkAdapter> adapter; 852 CHECK_ERROR_BREAK 852 CHECK_ERROR_BREAK(sessionMachine, GetNetworkAdapter(n - 1, adapter.asOutParam())); 853 853 if (adapter) 854 854 { … … 883 883 ULONG NetworkAdapterCount = 0; 884 884 ComPtr <ISystemProperties> info; 885 CHECK_ERROR_BREAK (a->virtualBox, COMGETTER(SystemProperties)(info.asOutParam()));886 CHECK_ERROR_BREAK (info, COMGETTER(NetworkAdapterCount)(&NetworkAdapterCount));885 CHECK_ERROR_BREAK(a->virtualBox, COMGETTER(SystemProperties)(info.asOutParam())); 886 CHECK_ERROR_BREAK(info, COMGETTER(NetworkAdapterCount)(&NetworkAdapterCount)); 887 887 888 888 unsigned n = parseNum(&a->argv[1][3], NetworkAdapterCount, "NIC"); … … 901 901 /* get the corresponding network adapter */ 902 902 ComPtr<INetworkAdapter> adapter; 903 CHECK_ERROR_BREAK 903 CHECK_ERROR_BREAK(sessionMachine, GetNetworkAdapter(n - 1, adapter.asOutParam())); 904 904 if (adapter) 905 905 { … … 910 910 if (!strcmp(a->argv[2], "null")) 911 911 { 912 CHECK_ERROR_RET(adapter, COMSETTER(Enabled) 912 CHECK_ERROR_RET(adapter, COMSETTER(Enabled)(TRUE), 1); 913 913 CHECK_ERROR_RET(adapter, Detach(), 1); 914 914 } 915 915 else if (!strcmp(a->argv[2], "nat")) 916 916 { 917 CHECK_ERROR_RET(adapter, COMSETTER(Enabled) 917 CHECK_ERROR_RET(adapter, COMSETTER(Enabled)(TRUE), 1); 918 918 if (a->argc == 4) 919 919 CHECK_ERROR_RET(adapter, COMSETTER(NATNetwork)(Bstr(a->argv[3])), 1); … … 929 929 break; 930 930 } 931 CHECK_ERROR_RET(adapter, COMSETTER(Enabled) 931 CHECK_ERROR_RET(adapter, COMSETTER(Enabled)(TRUE), 1); 932 932 CHECK_ERROR_RET(adapter, COMSETTER(HostInterface)(Bstr(a->argv[3])), 1); 933 933 CHECK_ERROR_RET(adapter, AttachToBridgedInterface(), 1); … … 941 941 break; 942 942 } 943 CHECK_ERROR_RET(adapter, COMSETTER(Enabled) 943 CHECK_ERROR_RET(adapter, COMSETTER(Enabled)(TRUE), 1); 944 944 CHECK_ERROR_RET(adapter, COMSETTER(InternalNetwork)(Bstr(a->argv[3])), 1); 945 945 CHECK_ERROR_RET(adapter, AttachToInternalNetwork(), 1); … … 954 954 break; 955 955 } 956 CHECK_ERROR_RET(adapter, COMSETTER(Enabled) 956 CHECK_ERROR_RET(adapter, COMSETTER(Enabled)(TRUE), 1); 957 957 CHECK_ERROR_RET(adapter, COMSETTER(HostInterface)(Bstr(a->argv[3])), 1); 958 958 CHECK_ERROR_RET(adapter, AttachToHostOnlyInterface(), 1); … … 990 990 if (!strcmp(a->argv[2], "on")) 991 991 { 992 CHECK_ERROR_BREAK 992 CHECK_ERROR_BREAK(vrdpServer, COMSETTER(Enabled)(TRUE)); 993 993 } 994 994 else if (!strcmp(a->argv[2], "off")) 995 995 { 996 CHECK_ERROR_BREAK 996 CHECK_ERROR_BREAK(vrdpServer, COMSETTER(Enabled)(FALSE)); 997 997 } 998 998 else … … 1029 1029 } 1030 1030 #endif /* VBOX_WITH_VRDP */ 1031 else if ( !strcmp 1032 || !strcmp 1031 else if ( !strcmp(a->argv[1], "usbattach") 1032 || !strcmp(a->argv[1], "usbdetach")) 1033 1033 { 1034 1034 if (a->argc < 3) … … 1048 1048 { 1049 1049 ComPtr <IHost> host; 1050 CHECK_ERROR_BREAK (a->virtualBox, COMGETTER(Host)(host.asOutParam()));1050 CHECK_ERROR_BREAK(a->virtualBox, COMGETTER(Host)(host.asOutParam())); 1051 1051 SafeIfaceArray <IHostUSBDevice> coll; 1052 CHECK_ERROR_BREAK (host, COMGETTER(USBDevices)(ComSafeArrayAsOutParam(coll)));1052 CHECK_ERROR_BREAK(host, COMGETTER(USBDevices)(ComSafeArrayAsOutParam(coll))); 1053 1053 ComPtr <IHostUSBDevice> dev; 1054 CHECK_ERROR_BREAK (host, FindUSBDeviceByAddress (Bstr(a->argv [2]), dev.asOutParam()));1055 CHECK_ERROR_BREAK (dev, COMGETTER(Id)(usbId.asOutParam()));1054 CHECK_ERROR_BREAK(host, FindUSBDeviceByAddress(Bstr(a->argv [2]), dev.asOutParam())); 1055 CHECK_ERROR_BREAK(dev, COMGETTER(Id)(usbId.asOutParam())); 1056 1056 } 1057 1057 else 1058 1058 { 1059 1059 SafeIfaceArray <IUSBDevice> coll; 1060 CHECK_ERROR_BREAK 1060 CHECK_ERROR_BREAK(console, COMGETTER(USBDevices)(ComSafeArrayAsOutParam(coll))); 1061 1061 ComPtr <IUSBDevice> dev; 1062 CHECK_ERROR_BREAK (console, FindUSBDeviceByAddress (Bstr(a->argv [2]),1062 CHECK_ERROR_BREAK(console, FindUSBDeviceByAddress(Bstr(a->argv [2]), 1063 1063 dev.asOutParam())); 1064 CHECK_ERROR_BREAK (dev, COMGETTER(Id)(usbId.asOutParam()));1064 CHECK_ERROR_BREAK(dev, COMGETTER(Id)(usbId.asOutParam())); 1065 1065 } 1066 1066 } 1067 1067 1068 1068 if (attach) 1069 CHECK_ERROR_BREAK (console, AttachUSBDevice(usbId));1069 CHECK_ERROR_BREAK(console, AttachUSBDevice(usbId)); 1070 1070 else 1071 1071 { 1072 1072 ComPtr <IUSBDevice> dev; 1073 CHECK_ERROR_BREAK (console, DetachUSBDevice(usbId, dev.asOutParam()));1073 CHECK_ERROR_BREAK(console, DetachUSBDevice(usbId, dev.asOutParam())); 1074 1074 } 1075 1075 } … … 1343 1343 rc = E_FAIL; 1344 1344 } 1345 } 1346 while (0); 1345 } while (0); 1347 1346 1348 1347 a->session->Close(); 1349 1348 1350 return SUCCEEDED 1349 return SUCCEEDED(rc) ? 0 : 1; 1351 1350 } 1352 1351 … … 1379 1378 CHECK_ERROR_BREAK(a->session, COMGETTER(Console)(console.asOutParam())); 1380 1379 CHECK_ERROR_BREAK(console, ForgetSavedState(true)); 1381 } 1382 while (0); 1380 } while (0); 1383 1381 CHECK_ERROR_BREAK(a->session, Close()); 1384 } 1385 while (0); 1382 } while (0); 1386 1383 } 1387 1384 … … 1416 1413 ComPtr<IConsole> console; 1417 1414 CHECK_ERROR_BREAK(a->session, COMGETTER(Console)(console.asOutParam())); 1418 CHECK_ERROR_BREAK(console, AdoptSavedState (Bstr (a->argv[1]))); 1419 } 1420 while (0); 1415 CHECK_ERROR_BREAK(console, AdoptSavedState(Bstr(a->argv[1]))); 1416 } while (0); 1421 1417 CHECK_ERROR_BREAK(a->session, Close()); 1422 } 1423 while (0); 1418 } while (0); 1424 1419 } 1425 1420 … … 1605 1600 } 1606 1601 1607 static int handleSharedFolder 1602 static int handleSharedFolder(HandlerArg *a) 1608 1603 { 1609 1604 HRESULT rc; … … 1683 1678 1684 1679 /* open an existing session for the VM */ 1685 CHECK_ERROR_RET(a->virtualBox, OpenExistingSession 1680 CHECK_ERROR_RET(a->virtualBox, OpenExistingSession(a->session, uuid), 1); 1686 1681 /* get the session machine */ 1687 1682 CHECK_ERROR_RET(a->session, COMGETTER(Machine)(machine.asOutParam()), 1); … … 1697 1692 { 1698 1693 /* open a session for the VM */ 1699 CHECK_ERROR_RET 1694 CHECK_ERROR_RET(a->virtualBox, OpenSession(a->session, uuid), 1); 1700 1695 1701 1696 /* get the mutable session machine */ … … 1747 1742 1748 1743 /* open an existing session for the VM */ 1749 CHECK_ERROR_RET(a->virtualBox, OpenExistingSession 1744 CHECK_ERROR_RET(a->virtualBox, OpenExistingSession(a->session, uuid), 1); 1750 1745 /* get the session machine */ 1751 1746 CHECK_ERROR_RET(a->session, COMGETTER(Machine)(machine.asOutParam()), 1); … … 1761 1756 { 1762 1757 /* open a session for the VM */ 1763 CHECK_ERROR_RET 1758 CHECK_ERROR_RET(a->virtualBox, OpenSession(a->session, uuid), 1); 1764 1759 1765 1760 /* get the mutable session machine */ … … 2081 2076 // end "all-stuff" scope 2082 2077 //////////////////////////////////////////////////////////////////////////// 2083 } 2084 while (0); 2078 } while (0); 2085 2079 2086 2080 com::Shutdown(); -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r23928 r23934 223 223 { 224 224 ComPtr <ISystemProperties> info; 225 CHECK_ERROR_RET (a->virtualBox, COMGETTER(SystemProperties)(info.asOutParam()), 1);226 CHECK_ERROR_RET (info, COMGETTER(NetworkAdapterCount)(&NetworkAdapterCount), 1);225 CHECK_ERROR_RET(a->virtualBox, COMGETTER(SystemProperties)(info.asOutParam()), 1); 226 CHECK_ERROR_RET(info, COMGETTER(NetworkAdapterCount)(&NetworkAdapterCount), 1); 227 227 } 228 228 ULONG SerialPortCount = 0; 229 229 { 230 230 ComPtr <ISystemProperties> info; 231 CHECK_ERROR_RET (a->virtualBox, COMGETTER(SystemProperties)(info.asOutParam()), 1);232 CHECK_ERROR_RET (info, COMGETTER(SerialPortCount)(&SerialPortCount), 1);231 CHECK_ERROR_RET(a->virtualBox, COMGETTER(SystemProperties)(info.asOutParam()), 1); 232 CHECK_ERROR_RET(info, COMGETTER(SerialPortCount)(&SerialPortCount), 1); 233 233 } 234 234 … … 236 236 if (!Guid(machineuuid).isEmpty()) 237 237 { 238 CHECK_ERROR_RET (a->virtualBox, GetMachine(machineuuid, machine.asOutParam()), 1);238 CHECK_ERROR_RET(a->virtualBox, GetMachine(machineuuid, machine.asOutParam()), 1); 239 239 } 240 240 else 241 241 { 242 CHECK_ERROR_RET 242 CHECK_ERROR_RET(a->virtualBox, FindMachine(Bstr(a->argv[0]), machine.asOutParam()), 1); 243 243 machine->COMGETTER(Id)(machineuuid.asOutParam()); 244 244 } 245 245 246 246 /* open a session for the VM */ 247 CHECK_ERROR_RET 247 CHECK_ERROR_RET(a->virtualBox, OpenSession(a->session, machineuuid), 1); 248 248 249 249 /* get the mutable session machine */ … … 251 251 machine->COMGETTER(BIOSSettings)(biosSettings.asOutParam()); 252 252 253 RTGetOptInit 254 253 RTGetOptInit(&GetOptState, a->argc, a->argv, g_aModifyVMOptions, 254 RT_ELEMENTS(g_aModifyVMOptions), 1, 0 /* fFlags */); 255 255 256 256 while ( SUCCEEDED (rc) … … 262 262 { 263 263 if (ValueUnion.psz) 264 CHECK_ERROR 264 CHECK_ERROR(machine, COMSETTER(Name)(Bstr(ValueUnion.psz))); 265 265 break; 266 266 } … … 270 270 { 271 271 ComPtr<IGuestOSType> guestOSType; 272 CHECK_ERROR 272 CHECK_ERROR(a->virtualBox, GetGuestOSType(Bstr(ValueUnion.psz), guestOSType.asOutParam())); 273 273 if (SUCCEEDED(rc) && guestOSType) 274 274 { 275 CHECK_ERROR 275 CHECK_ERROR(machine, COMSETTER(OSTypeId)(Bstr(ValueUnion.psz))); 276 276 } 277 277 else … … 287 287 { 288 288 if (ValueUnion.u32 > 0) 289 CHECK_ERROR 289 CHECK_ERROR(machine, COMSETTER(MemorySize)(ValueUnion.u32)); 290 290 break; 291 291 } … … 294 294 { 295 295 if (ValueUnion.u32 > 0) 296 CHECK_ERROR 296 CHECK_ERROR(machine, COMSETTER(VRAMSize)(ValueUnion.u32)); 297 297 break; 298 298 } … … 304 304 if (!strcmp(ValueUnion.psz, "efi")) 305 305 { 306 CHECK_ERROR 306 CHECK_ERROR(machine, COMSETTER(FirmwareType)(FirmwareType_EFI)); 307 307 } 308 308 else if (!strcmp(ValueUnion.psz, "bios")) 309 309 { 310 CHECK_ERROR 310 CHECK_ERROR(machine, COMSETTER(FirmwareType)(FirmwareType_BIOS)); 311 311 } 312 312 else … … 325 325 if (!strcmp(ValueUnion.psz, "on")) 326 326 { 327 CHECK_ERROR 327 CHECK_ERROR(biosSettings, COMSETTER(ACPIEnabled)(true)); 328 328 } 329 329 else if (!strcmp(ValueUnion.psz, "off")) 330 330 { 331 CHECK_ERROR 331 CHECK_ERROR(biosSettings, COMSETTER(ACPIEnabled)(false)); 332 332 } 333 333 else … … 346 346 if (!strcmp(ValueUnion.psz, "on")) 347 347 { 348 CHECK_ERROR 348 CHECK_ERROR(biosSettings, COMSETTER(IOAPICEnabled)(true)); 349 349 } 350 350 else if (!strcmp(ValueUnion.psz, "off")) 351 351 { 352 CHECK_ERROR 352 CHECK_ERROR(biosSettings, COMSETTER(IOAPICEnabled)(false)); 353 353 } 354 354 else … … 367 367 if (!strcmp(ValueUnion.psz, "on")) 368 368 { 369 CHECK_ERROR 369 CHECK_ERROR(machine, SetCpuProperty(CpuPropertyType_PAE, true)); 370 370 } 371 371 else if (!strcmp(ValueUnion.psz, "off")) 372 372 { 373 CHECK_ERROR 373 CHECK_ERROR(machine, SetCpuProperty(CpuPropertyType_PAE, false)); 374 374 } 375 375 else … … 388 388 if (!strcmp(ValueUnion.psz, "on")) 389 389 { 390 CHECK_ERROR 390 CHECK_ERROR(machine, SetCpuProperty(CpuPropertyType_Synthetic, true)); 391 391 } 392 392 else if (!strcmp(ValueUnion.psz, "off")) 393 393 { 394 CHECK_ERROR 394 CHECK_ERROR(machine, SetCpuProperty(CpuPropertyType_Synthetic, false)); 395 395 } 396 396 else … … 409 409 if (!strcmp(ValueUnion.psz, "on")) 410 410 { 411 CHECK_ERROR 411 CHECK_ERROR(machine, SetHWVirtExProperty(HWVirtExPropertyType_Enabled, TRUE)); 412 412 } 413 413 else if (!strcmp(ValueUnion.psz, "off")) 414 414 { 415 CHECK_ERROR 415 CHECK_ERROR(machine, SetHWVirtExProperty(HWVirtExPropertyType_Enabled, FALSE)); 416 416 } 417 417 else … … 430 430 if (!strcmp(ValueUnion.psz, "on")) 431 431 { 432 CHECK_ERROR 432 CHECK_ERROR(machine, SetHWVirtExProperty(HWVirtExPropertyType_Exclusive, TRUE)); 433 433 } 434 434 else if (!strcmp(ValueUnion.psz, "off")) 435 435 { 436 CHECK_ERROR 436 CHECK_ERROR(machine, SetHWVirtExProperty(HWVirtExPropertyType_Exclusive, FALSE)); 437 437 } 438 438 else … … 451 451 if (!strcmp(ValueUnion.psz, "on")) 452 452 { 453 CHECK_ERROR 453 CHECK_ERROR(machine, SetHWVirtExProperty(HWVirtExPropertyType_NestedPaging, TRUE)); 454 454 } 455 455 else if (!strcmp(ValueUnion.psz, "off")) 456 456 { 457 CHECK_ERROR 457 CHECK_ERROR(machine, SetHWVirtExProperty(HWVirtExPropertyType_NestedPaging, FALSE)); 458 458 } 459 459 else … … 472 472 if (!strcmp(ValueUnion.psz, "on")) 473 473 { 474 CHECK_ERROR 474 CHECK_ERROR(machine, SetHWVirtExProperty(HWVirtExPropertyType_VPID, TRUE)); 475 475 } 476 476 else if (!strcmp(ValueUnion.psz, "off")) 477 477 { 478 CHECK_ERROR 478 CHECK_ERROR(machine, SetHWVirtExProperty(HWVirtExPropertyType_VPID, FALSE)); 479 479 } 480 480 else … … 490 490 { 491 491 if (ValueUnion.u32 > 0) 492 CHECK_ERROR 492 CHECK_ERROR(machine, COMSETTER(CPUCount)(ValueUnion.u32)); 493 493 break; 494 494 } … … 497 497 { 498 498 if (ValueUnion.u32 > 0) 499 CHECK_ERROR 499 CHECK_ERROR(machine, COMSETTER(MonitorCount)(ValueUnion.u32)); 500 500 break; 501 501 } … … 507 507 if (!strcmp(ValueUnion.psz, "on")) 508 508 { 509 CHECK_ERROR 509 CHECK_ERROR(machine, COMSETTER(Accelerate3DEnabled)(true)); 510 510 } 511 511 else if (!strcmp(ValueUnion.psz, "off")) 512 512 { 513 CHECK_ERROR 513 CHECK_ERROR(machine, COMSETTER(Accelerate3DEnabled)(false)); 514 514 } 515 515 else … … 529 529 if (!strcmp(ValueUnion.psz, "on")) 530 530 { 531 CHECK_ERROR 531 CHECK_ERROR(machine, COMSETTER(Accelerate2DVideoEnabled)(true)); 532 532 } 533 533 else if (!strcmp(ValueUnion.psz, "off")) 534 534 { 535 CHECK_ERROR 535 CHECK_ERROR(machine, COMSETTER(Accelerate2DVideoEnabled)(false)); 536 536 } 537 537 else … … 551 551 if (!strcmp(ValueUnion.psz, "on")) 552 552 { 553 CHECK_ERROR 553 CHECK_ERROR(biosSettings, COMSETTER(LogoFadeIn)(true)); 554 554 } 555 555 else if (!strcmp(ValueUnion.psz, "off")) 556 556 { 557 CHECK_ERROR 557 CHECK_ERROR(biosSettings, COMSETTER(LogoFadeIn)(false)); 558 558 } 559 559 else … … 572 572 if (!strcmp(ValueUnion.psz, "on")) 573 573 { 574 CHECK_ERROR 574 CHECK_ERROR(biosSettings, COMSETTER(LogoFadeOut)(true)); 575 575 } 576 576 else if (!strcmp(ValueUnion.psz, "off")) 577 577 { 578 CHECK_ERROR 578 CHECK_ERROR(biosSettings, COMSETTER(LogoFadeOut)(false)); 579 579 } 580 580 else … … 591 591 { 592 592 if (ValueUnion.u64 > 0) 593 CHECK_ERROR 593 CHECK_ERROR(biosSettings, COMSETTER(LogoDisplayTime)(ValueUnion.u64)); 594 594 break; 595 595 } … … 598 598 { 599 599 if (ValueUnion.psz) 600 CHECK_ERROR 600 CHECK_ERROR(biosSettings, COMSETTER(LogoImagePath)(Bstr(ValueUnion.psz))); 601 601 break; 602 602 } … … 607 607 { 608 608 if (!strcmp(ValueUnion.psz, "disabled")) 609 CHECK_ERROR 609 CHECK_ERROR(biosSettings, COMSETTER(BootMenuMode)(BIOSBootMenuMode_Disabled)); 610 610 else if (!strcmp(ValueUnion.psz, "menuonly")) 611 CHECK_ERROR 611 CHECK_ERROR(biosSettings, COMSETTER(BootMenuMode)(BIOSBootMenuMode_MenuOnly)); 612 612 else if (!strcmp(ValueUnion.psz, "messageandmenu")) 613 CHECK_ERROR 613 CHECK_ERROR(biosSettings, COMSETTER(BootMenuMode)(BIOSBootMenuMode_MessageAndMenu)); 614 614 else 615 615 { … … 624 624 { 625 625 if (ValueUnion.u64 > 0) 626 CHECK_ERROR 626 CHECK_ERROR(biosSettings, COMSETTER(TimeOffset)(ValueUnion.u64)); 627 627 break; 628 628 } … … 634 634 if (!strcmp(ValueUnion.psz, "on")) 635 635 { 636 CHECK_ERROR 636 CHECK_ERROR(biosSettings, COMSETTER(PXEDebugEnabled)(true)); 637 637 } 638 638 else if (!strcmp(ValueUnion.psz, "off")) 639 639 { 640 CHECK_ERROR 640 CHECK_ERROR(biosSettings, COMSETTER(PXEDebugEnabled)(false)); 641 641 } 642 642 else … … 658 658 if (!strcmp(ValueUnion.psz, "none")) 659 659 { 660 CHECK_ERROR (machine, SetBootOrder(GetOptState.uIndex, DeviceType_Null));660 CHECK_ERROR(machine, SetBootOrder(GetOptState.uIndex, DeviceType_Null)); 661 661 } 662 662 else if (!strcmp(ValueUnion.psz, "floppy")) 663 663 { 664 CHECK_ERROR (machine, SetBootOrder(GetOptState.uIndex, DeviceType_Floppy));664 CHECK_ERROR(machine, SetBootOrder(GetOptState.uIndex, DeviceType_Floppy)); 665 665 } 666 666 else if (!strcmp(ValueUnion.psz, "dvd")) 667 667 { 668 CHECK_ERROR (machine, SetBootOrder(GetOptState.uIndex, DeviceType_DVD));668 CHECK_ERROR(machine, SetBootOrder(GetOptState.uIndex, DeviceType_DVD)); 669 669 } 670 670 else if (!strcmp(ValueUnion.psz, "disk")) 671 671 { 672 CHECK_ERROR (machine, SetBootOrder(GetOptState.uIndex, DeviceType_HardDisk));672 CHECK_ERROR(machine, SetBootOrder(GetOptState.uIndex, DeviceType_HardDisk)); 673 673 } 674 674 else if (!strcmp(ValueUnion.psz, "net")) 675 675 { 676 CHECK_ERROR (machine, SetBootOrder(GetOptState.uIndex, DeviceType_Network));676 CHECK_ERROR(machine, SetBootOrder(GetOptState.uIndex, DeviceType_Network)); 677 677 } 678 678 else … … 701 701 { 702 702 /* open the new hard disk object */ 703 CHECK_ERROR 703 CHECK_ERROR(a->virtualBox, 704 704 OpenHardDisk(Bstr(ValueUnion.psz), 705 705 AccessMode_ReadWrite, false, Bstr(""), … … 710 710 { 711 711 hardDisk->COMGETTER(Id)(uuid.asOutParam()); 712 CHECK_ERROR 712 CHECK_ERROR(machine, AttachDevice(Bstr("IDE Controller"), 0, 0, DeviceType_HardDisk, uuid)); 713 713 } 714 714 else … … 737 737 { 738 738 /* open the new hard disk object */ 739 CHECK_ERROR 739 CHECK_ERROR(a->virtualBox, 740 740 OpenHardDisk(Bstr(ValueUnion.psz), 741 741 AccessMode_ReadWrite, false, Bstr(""), … … 746 746 { 747 747 hardDisk->COMGETTER(Id)(uuid.asOutParam()); 748 CHECK_ERROR 748 CHECK_ERROR(machine, AttachDevice(Bstr("IDE Controller"), 0, 1, DeviceType_HardDisk, uuid)); 749 749 } 750 750 else … … 773 773 { 774 774 /* open the new hard disk object */ 775 CHECK_ERROR 775 CHECK_ERROR(a->virtualBox, 776 776 OpenHardDisk(Bstr(ValueUnion.psz), 777 777 AccessMode_ReadWrite, false, Bstr(""), … … 782 782 { 783 783 hardDisk->COMGETTER(Id)(uuid.asOutParam()); 784 CHECK_ERROR 784 CHECK_ERROR(machine, AttachDevice(Bstr("IDE Controller"), 1, 1, DeviceType_HardDisk, uuid)); 785 785 } 786 786 else … … 793 793 { 794 794 ComPtr<IStorageController> storageController; 795 CHECK_ERROR 795 CHECK_ERROR(machine, GetStorageControllerByName(Bstr("IDE Controller"), 796 796 storageController.asOutParam())); 797 797 … … 819 819 { 820 820 ComPtr<IStorageController> SataCtl; 821 CHECK_ERROR 821 CHECK_ERROR(machine, GetStorageControllerByName(Bstr("SATA"), SataCtl.asOutParam())); 822 822 823 823 if ((GetOptState.uIndex < 1) && (GetOptState.uIndex > 4)) … … 840 840 { 841 841 ComPtr<IStorageController> SataCtl; 842 CHECK_ERROR 842 CHECK_ERROR(machine, GetStorageControllerByName(Bstr("SATA"), SataCtl.asOutParam())); 843 843 844 844 if (SUCCEEDED(rc) && ValueUnion.u32 > 0) … … 872 872 { 873 873 /* open the new hard disk object */ 874 CHECK_ERROR 874 CHECK_ERROR(a->virtualBox, 875 875 OpenHardDisk(Bstr(ValueUnion.psz), AccessMode_ReadWrite, 876 876 false, Bstr(""), false, … … 881 881 { 882 882 hardDisk->COMGETTER(Id)(uuid.asOutParam()); 883 CHECK_ERROR 883 CHECK_ERROR(machine, 884 884 AttachDevice(Bstr("SATA"), GetOptState.uIndex, 885 885 0, DeviceType_HardDisk, uuid)); … … 896 896 { 897 897 ComPtr<IStorageController> ctl; 898 CHECK_ERROR 899 CHECK_ERROR 898 CHECK_ERROR(machine, AddStorageController(Bstr("SATA"), StorageBus_SATA, ctl.asOutParam())); 899 CHECK_ERROR(ctl, COMSETTER(ControllerType)(StorageControllerType_IntelAhci)); 900 900 } 901 901 else if (!strcmp(ValueUnion.psz, "off") || !strcmp(ValueUnion.psz, "disable")) 902 CHECK_ERROR 902 CHECK_ERROR(machine, RemoveStorageController(Bstr("SATA"))); 903 903 else 904 904 return errorArgument("Invalid --usb argument '%s'", ValueUnion.psz); … … 932 932 { 933 933 /* open the new hard disk object */ 934 CHECK_ERROR 934 CHECK_ERROR(a->virtualBox, 935 935 OpenHardDisk(Bstr(ValueUnion.psz), 936 936 AccessMode_ReadWrite, false, Bstr(""), … … 943 943 rc = machine->AttachDevice(Bstr("LsiLogic"), GetOptState.uIndex, 0, DeviceType_HardDisk, uuid); 944 944 if (FAILED(rc)) 945 CHECK_ERROR 945 CHECK_ERROR(machine, 946 946 AttachDevice(Bstr("BusLogic"), 947 947 GetOptState.uIndex, 0, … … 962 962 rc = machine->RemoveStorageController(Bstr("BusLogic")); 963 963 if (FAILED(rc)) 964 CHECK_ERROR 965 966 CHECK_ERROR 964 CHECK_ERROR(machine, RemoveStorageController(Bstr("LsiLogic"))); 965 966 CHECK_ERROR(machine, 967 967 AddStorageController(Bstr("LsiLogic"), 968 968 StorageBus_SCSI, … … 970 970 971 971 if (SUCCEEDED(rc)) 972 CHECK_ERROR 972 CHECK_ERROR(ctl, COMSETTER(ControllerType)(StorageControllerType_LsiLogic)); 973 973 } 974 974 else if (!RTStrICmp(ValueUnion.psz, "BusLogic")) … … 976 976 rc = machine->RemoveStorageController(Bstr("LsiLogic")); 977 977 if (FAILED(rc)) 978 CHECK_ERROR 979 980 CHECK_ERROR 978 CHECK_ERROR(machine, RemoveStorageController(Bstr("BusLogic"))); 979 980 CHECK_ERROR(machine, 981 981 AddStorageController(Bstr("BusLogic"), 982 982 StorageBus_SCSI, … … 984 984 985 985 if (SUCCEEDED(rc)) 986 CHECK_ERROR 986 CHECK_ERROR(ctl, COMSETTER(ControllerType)(StorageControllerType_BusLogic)); 987 987 } 988 988 else … … 997 997 ComPtr<IStorageController> ctl; 998 998 999 CHECK_ERROR 999 CHECK_ERROR(machine, AddStorageController(Bstr("BusLogic"), StorageBus_SCSI, ctl.asOutParam())); 1000 1000 if (SUCCEEDED(rc)) 1001 CHECK_ERROR 1001 CHECK_ERROR(ctl, COMSETTER(ControllerType)(StorageControllerType_BusLogic)); 1002 1002 } 1003 1003 else if (!strcmp(ValueUnion.psz, "off") || !strcmp(ValueUnion.psz, "disable")) … … 1005 1005 rc = machine->RemoveStorageController(Bstr("BusLogic")); 1006 1006 if (FAILED(rc)) 1007 CHECK_ERROR 1007 CHECK_ERROR(machine, RemoveStorageController(Bstr("LsiLogic"))); 1008 1008 } 1009 1009 break; … … 1012 1012 case MODIFYVM_DVDPASSTHROUGH: // deprecated 1013 1013 { 1014 CHECK_ERROR 1014 CHECK_ERROR(machine, PassthroughDevice(Bstr("IDE Controller"), 1, 0, !strcmp(ValueUnion.psz, "on"))); 1015 1015 break; 1016 1016 } … … 1030 1030 { 1031 1031 ComPtr<IHost> host; 1032 CHECK_ERROR 1032 CHECK_ERROR(a->virtualBox, COMGETTER(Host)(host.asOutParam())); 1033 1033 rc = host->FindHostDVDDrive(Bstr(ValueUnion.psz + 5), dvdMedium.asOutParam()); 1034 1034 if (!dvdMedium) … … 1063 1063 { 1064 1064 Bstr emptyUUID; 1065 CHECK_ERROR 1065 CHECK_ERROR(a->virtualBox, OpenDVDImage(Bstr(ValueUnion.psz), 1066 1066 emptyUUID, dvdMedium.asOutParam())); 1067 1067 } … … 1079 1079 if (dvdMedium) 1080 1080 dvdMedium->COMGETTER(Id)(uuid.asOutParam()); 1081 CHECK_ERROR 1081 CHECK_ERROR(machine, MountMedium(Bstr("IDE Controller"), 1, 0, uuid)); 1082 1082 break; 1083 1083 } … … 1134 1134 { 1135 1135 Bstr emptyUUID; 1136 CHECK_ERROR 1136 CHECK_ERROR(a->virtualBox, 1137 1137 OpenFloppyImage(Bstr(ValueUnion.psz), 1138 1138 emptyUUID, … … 1147 1147 } 1148 1148 floppyMedium->COMGETTER(Id)(uuid.asOutParam()); 1149 CHECK_ERROR 1149 CHECK_ERROR(machine, MountMedium(Bstr("Floppy Controller"), 0, 0, uuid)); 1150 1150 } 1151 1151 break; … … 1161 1161 GetOptState.pDef->pszLong); 1162 1162 1163 CHECK_ERROR_BREAK (machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1163 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1164 1164 ASSERT(nic); 1165 1165 1166 CHECK_ERROR 1166 CHECK_ERROR(nic, COMSETTER(TraceFile)(Bstr(ValueUnion.psz))); 1167 1167 break; 1168 1168 } … … 1177 1177 GetOptState.pDef->pszLong); 1178 1178 1179 CHECK_ERROR_BREAK (machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1179 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1180 1180 ASSERT(nic); 1181 1181 1182 1182 if (!strcmp(ValueUnion.psz, "on")) 1183 1183 { 1184 CHECK_ERROR 1184 CHECK_ERROR(nic, COMSETTER(TraceEnabled)(TRUE)); 1185 1185 } 1186 1186 else if (!strcmp(ValueUnion.psz, "off")) 1187 1187 { 1188 CHECK_ERROR 1188 CHECK_ERROR(nic, COMSETTER(TraceEnabled)(FALSE)); 1189 1189 } 1190 1190 else … … 1205 1205 GetOptState.pDef->pszLong); 1206 1206 1207 CHECK_ERROR_BREAK (machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1207 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1208 1208 ASSERT(nic); 1209 1209 1210 1210 if (!strcmp(ValueUnion.psz, "Am79C970A")) 1211 1211 { 1212 CHECK_ERROR 1212 CHECK_ERROR(nic, COMSETTER(AdapterType)(NetworkAdapterType_Am79C970A)); 1213 1213 } 1214 1214 else if (!strcmp(ValueUnion.psz, "Am79C973")) 1215 1215 { 1216 CHECK_ERROR 1216 CHECK_ERROR(nic, COMSETTER(AdapterType)(NetworkAdapterType_Am79C973)); 1217 1217 } 1218 1218 #ifdef VBOX_WITH_E1000 1219 1219 else if (!strcmp(ValueUnion.psz, "82540EM")) 1220 1220 { 1221 CHECK_ERROR 1221 CHECK_ERROR(nic, COMSETTER(AdapterType)(NetworkAdapterType_I82540EM)); 1222 1222 } 1223 1223 else if (!strcmp(ValueUnion.psz, "82543GC")) 1224 1224 { 1225 CHECK_ERROR 1225 CHECK_ERROR(nic, COMSETTER(AdapterType)(NetworkAdapterType_I82543GC)); 1226 1226 } 1227 1227 else if (!strcmp(ValueUnion.psz, "82545EM")) 1228 1228 { 1229 CHECK_ERROR 1229 CHECK_ERROR(nic, COMSETTER(AdapterType)(NetworkAdapterType_I82545EM)); 1230 1230 } 1231 1231 #endif … … 1233 1233 else if (!strcmp(ValueUnion.psz, "virtio")) 1234 1234 { 1235 CHECK_ERROR 1235 CHECK_ERROR(nic, COMSETTER(AdapterType)(NetworkAdapterType_Virtio)); 1236 1236 } 1237 1237 #endif /* VBOX_WITH_VIRTIO */ … … 1260 1260 } 1261 1261 1262 CHECK_ERROR_BREAK (machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1262 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1263 1263 ASSERT(nic); 1264 1264 1265 CHECK_ERROR 1265 CHECK_ERROR(nic, COMSETTER(LineSpeed)(ValueUnion.u32)); 1266 1266 break; 1267 1267 } … … 1276 1276 GetOptState.pDef->pszLong); 1277 1277 1278 CHECK_ERROR_BREAK (machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1278 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1279 1279 ASSERT(nic); 1280 1280 1281 1281 if (!strcmp(ValueUnion.psz, "none")) 1282 1282 { 1283 CHECK_ERROR (nic, COMSETTER(Enabled)(FALSE));1283 CHECK_ERROR(nic, COMSETTER(Enabled)(FALSE)); 1284 1284 } 1285 1285 else if (!strcmp(ValueUnion.psz, "null")) 1286 1286 { 1287 CHECK_ERROR (nic, COMSETTER(Enabled)(TRUE));1288 CHECK_ERROR 1287 CHECK_ERROR(nic, COMSETTER(Enabled)(TRUE)); 1288 CHECK_ERROR(nic, Detach()); 1289 1289 } 1290 1290 else if (!strcmp(ValueUnion.psz, "nat")) 1291 1291 { 1292 CHECK_ERROR (nic, COMSETTER(Enabled)(TRUE));1293 CHECK_ERROR 1292 CHECK_ERROR(nic, COMSETTER(Enabled)(TRUE)); 1293 CHECK_ERROR(nic, AttachToNAT()); 1294 1294 } 1295 1295 else if ( !strcmp(ValueUnion.psz, "bridged") 1296 1296 || !strcmp(ValueUnion.psz, "hostif")) /* backward compatibility */ 1297 1297 { 1298 CHECK_ERROR (nic, COMSETTER(Enabled)(TRUE));1299 CHECK_ERROR 1298 CHECK_ERROR(nic, COMSETTER(Enabled)(TRUE)); 1299 CHECK_ERROR(nic, AttachToBridgedInterface()); 1300 1300 } 1301 1301 else if (!strcmp(ValueUnion.psz, "intnet")) 1302 1302 { 1303 CHECK_ERROR (nic, COMSETTER(Enabled)(TRUE));1304 CHECK_ERROR 1303 CHECK_ERROR(nic, COMSETTER(Enabled)(TRUE)); 1304 CHECK_ERROR(nic, AttachToInternalNetwork()); 1305 1305 } 1306 1306 #if defined(VBOX_WITH_NETFLT) … … 1308 1308 { 1309 1309 1310 CHECK_ERROR (nic, COMSETTER(Enabled)(TRUE));1311 CHECK_ERROR 1310 CHECK_ERROR(nic, COMSETTER(Enabled)(TRUE)); 1311 CHECK_ERROR(nic, AttachToHostOnlyInterface()); 1312 1312 } 1313 1313 #endif … … 1329 1329 GetOptState.pDef->pszLong); 1330 1330 1331 CHECK_ERROR_BREAK (machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1331 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1332 1332 ASSERT(nic); 1333 1333 1334 1334 if (!strcmp(ValueUnion.psz, "on")) 1335 1335 { 1336 CHECK_ERROR 1336 CHECK_ERROR(nic, COMSETTER(CableConnected)(TRUE)); 1337 1337 } 1338 1338 else if (!strcmp(ValueUnion.psz, "off")) 1339 1339 { 1340 CHECK_ERROR 1340 CHECK_ERROR(nic, COMSETTER(CableConnected)(FALSE)); 1341 1341 } 1342 1342 else … … 1358 1358 GetOptState.pDef->pszLong); 1359 1359 1360 CHECK_ERROR_BREAK (machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1360 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1361 1361 ASSERT(nic); 1362 1362 … … 1364 1364 if (!strcmp(ValueUnion.psz, "none")) 1365 1365 { 1366 CHECK_ERROR 1366 CHECK_ERROR(nic, COMSETTER(HostInterface)(NULL)); 1367 1367 } 1368 1368 else 1369 1369 { 1370 CHECK_ERROR 1370 CHECK_ERROR(nic, COMSETTER(HostInterface)(Bstr(ValueUnion.psz))); 1371 1371 } 1372 1372 break; … … 1382 1382 GetOptState.pDef->pszLong); 1383 1383 1384 CHECK_ERROR_BREAK (machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1384 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1385 1385 ASSERT(nic); 1386 1386 … … 1388 1388 if (!strcmp(ValueUnion.psz, "none")) 1389 1389 { 1390 CHECK_ERROR 1390 CHECK_ERROR(nic, COMSETTER(InternalNetwork)(NULL)); 1391 1391 } 1392 1392 else 1393 1393 { 1394 CHECK_ERROR 1394 CHECK_ERROR(nic, COMSETTER(InternalNetwork)(Bstr(ValueUnion.psz))); 1395 1395 } 1396 1396 break; … … 1406 1406 GetOptState.pDef->pszLong); 1407 1407 1408 CHECK_ERROR_BREAK (machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1408 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1409 1409 ASSERT(nic); 1410 1410 1411 CHECK_ERROR 1411 CHECK_ERROR(nic, COMSETTER(NATNetwork)(Bstr(ValueUnion.psz))); 1412 1412 1413 1413 break; … … 1423 1423 GetOptState.pDef->pszLong); 1424 1424 1425 CHECK_ERROR_BREAK (machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1425 CHECK_ERROR_BREAK(machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1426 1426 ASSERT(nic); 1427 1427 … … 1429 1429 if (!strcmp(ValueUnion.psz, "auto")) 1430 1430 { 1431 CHECK_ERROR 1431 CHECK_ERROR(nic, COMSETTER(MACAddress)(NULL)); 1432 1432 } 1433 1433 else 1434 1434 { 1435 CHECK_ERROR 1435 CHECK_ERROR(nic, COMSETTER(MACAddress)(Bstr(ValueUnion.psz))); 1436 1436 } 1437 1437 break; … … 1448 1448 GetOptState.pDef->pszLong); 1449 1449 1450 CHECK_ERROR_BREAK (machine, GetSerialPort(GetOptState.uIndex - 1, uart.asOutParam()));1450 CHECK_ERROR_BREAK(machine, GetSerialPort(GetOptState.uIndex - 1, uart.asOutParam())); 1451 1451 ASSERT(uart); 1452 1452 1453 1453 if (!strcmp(ValueUnion.psz, "disconnected")) 1454 1454 { 1455 CHECK_ERROR (uart, COMSETTER(HostMode)(PortMode_Disconnected));1455 CHECK_ERROR(uart, COMSETTER(HostMode)(PortMode_Disconnected)); 1456 1456 } 1457 1457 else if ( !strcmp(ValueUnion.psz, "server") … … 1467 1467 GetOptState.pDef->pszLong); 1468 1468 1469 CHECK_ERROR (uart, COMSETTER(Path)(Bstr(ValueUnion.psz)));1469 CHECK_ERROR(uart, COMSETTER(Path)(Bstr(ValueUnion.psz))); 1470 1470 1471 1471 if (!strcmp(pszMode, "server")) 1472 1472 { 1473 CHECK_ERROR (uart, COMSETTER(HostMode)(PortMode_HostPipe));1474 CHECK_ERROR (uart, COMSETTER(Server)(TRUE));1473 CHECK_ERROR(uart, COMSETTER(HostMode)(PortMode_HostPipe)); 1474 CHECK_ERROR(uart, COMSETTER(Server)(TRUE)); 1475 1475 } 1476 1476 else if (!strcmp(pszMode, "client")) 1477 1477 { 1478 CHECK_ERROR (uart, COMSETTER(HostMode)(PortMode_HostPipe));1479 CHECK_ERROR (uart, COMSETTER(Server)(FALSE));1478 CHECK_ERROR(uart, COMSETTER(HostMode)(PortMode_HostPipe)); 1479 CHECK_ERROR(uart, COMSETTER(Server)(FALSE)); 1480 1480 } 1481 1481 else if (!strcmp(pszMode, "file")) 1482 1482 { 1483 CHECK_ERROR (uart, COMSETTER(HostMode)(PortMode_RawFile));1483 CHECK_ERROR(uart, COMSETTER(HostMode)(PortMode_RawFile)); 1484 1484 } 1485 1485 } 1486 1486 else 1487 1487 { 1488 CHECK_ERROR (uart, COMSETTER(Path)(Bstr(ValueUnion.psz)));1489 CHECK_ERROR (uart, COMSETTER(HostMode)(PortMode_HostDevice));1488 CHECK_ERROR(uart, COMSETTER(Path)(Bstr(ValueUnion.psz))); 1489 CHECK_ERROR(uart, COMSETTER(HostMode)(PortMode_HostDevice)); 1490 1490 } 1491 1491 break; … … 1501 1501 GetOptState.pDef->pszLong); 1502 1502 1503 CHECK_ERROR_BREAK (machine, GetSerialPort(GetOptState.uIndex - 1, uart.asOutParam()));1503 CHECK_ERROR_BREAK(machine, GetSerialPort(GetOptState.uIndex - 1, uart.asOutParam())); 1504 1504 ASSERT(uart); 1505 1505 1506 1506 if (!strcmp(ValueUnion.psz, "off") || !strcmp(ValueUnion.psz, "disable")) 1507 CHECK_ERROR (uart, COMSETTER(Enabled)(FALSE));1507 CHECK_ERROR(uart, COMSETTER(Enabled)(FALSE)); 1508 1508 else 1509 1509 { … … 1517 1517 GetOptState.pDef->pszLong); 1518 1518 1519 CHECK_ERROR (uart, COMSETTER(IRQ)(ValueUnion.u32));1519 CHECK_ERROR(uart, COMSETTER(IRQ)(ValueUnion.u32)); 1520 1520 1521 1521 vrc = RTStrToUInt32Ex(pszIOBase, NULL, 0, &uVal); 1522 1522 if (vrc != VINF_SUCCESS || uVal == 0) 1523 1523 return errorArgument("Error parsing UART I/O base '%s'", pszIOBase); 1524 CHECK_ERROR (uart, COMSETTER(IOBase)(uVal));1525 1526 CHECK_ERROR (uart, COMSETTER(Enabled)(TRUE));1524 CHECK_ERROR(uart, COMSETTER(IOBase)(uVal)); 1525 1526 CHECK_ERROR(uart, COMSETTER(Enabled)(TRUE)); 1527 1527 } 1528 1528 break; … … 1532 1532 { 1533 1533 if (ValueUnion.u32 > 0) 1534 CHECK_ERROR 1534 CHECK_ERROR(machine, COMSETTER(StatisticsUpdateInterval)(ValueUnion.u32)); 1535 1535 break; 1536 1536 } … … 1540 1540 { 1541 1541 if (ValueUnion.u32 > 0) 1542 CHECK_ERROR 1542 CHECK_ERROR(machine, COMSETTER(MemoryBalloonSize)(ValueUnion.u32)); 1543 1543 break; 1544 1544 } … … 1554 1554 1555 1555 if (!strcmp(ValueUnion.psz, "sb16")) 1556 CHECK_ERROR 1556 CHECK_ERROR(audioAdapter, COMSETTER(AudioController)(AudioControllerType_SB16)); 1557 1557 else if (!strcmp(ValueUnion.psz, "ac97")) 1558 CHECK_ERROR 1558 CHECK_ERROR(audioAdapter, COMSETTER(AudioController)(AudioControllerType_AC97)); 1559 1559 else 1560 1560 { … … 1577 1577 if (!strcmp(ValueUnion.psz, "none")) 1578 1578 { 1579 CHECK_ERROR 1579 CHECK_ERROR(audioAdapter, COMSETTER(Enabled)(false)); 1580 1580 } 1581 1581 else if (!strcmp(ValueUnion.psz, "null")) 1582 1582 { 1583 CHECK_ERROR 1584 CHECK_ERROR 1583 CHECK_ERROR(audioAdapter, COMSETTER(AudioDriver)(AudioDriverType_Null)); 1584 CHECK_ERROR(audioAdapter, COMSETTER(Enabled)(true)); 1585 1585 } 1586 1586 #ifdef RT_OS_WINDOWS … … 1588 1588 else if (!strcmp(ValueUnion.psz, "winmm")) 1589 1589 { 1590 CHECK_ERROR 1591 CHECK_ERROR 1590 CHECK_ERROR(audioAdapter, COMSETTER(AudioDriver)(AudioDriverType_WinMM)); 1591 CHECK_ERROR(audioAdapter, COMSETTER(Enabled)(true)); 1592 1592 } 1593 1593 #endif 1594 1594 else if (!strcmp(ValueUnion.psz, "dsound")) 1595 1595 { 1596 CHECK_ERROR 1597 CHECK_ERROR 1596 CHECK_ERROR(audioAdapter, COMSETTER(AudioDriver)(AudioDriverType_DirectSound)); 1597 CHECK_ERROR(audioAdapter, COMSETTER(Enabled)(true)); 1598 1598 } 1599 1599 #endif /* RT_OS_WINDOWS */ … … 1601 1601 else if (!strcmp(ValueUnion.psz, "oss")) 1602 1602 { 1603 CHECK_ERROR 1604 CHECK_ERROR 1603 CHECK_ERROR(audioAdapter, COMSETTER(AudioDriver)(AudioDriverType_OSS)); 1604 CHECK_ERROR(audioAdapter, COMSETTER(Enabled)(true)); 1605 1605 } 1606 1606 # ifdef VBOX_WITH_ALSA 1607 1607 else if (!strcmp(ValueUnion.psz, "alsa")) 1608 1608 { 1609 CHECK_ERROR 1610 CHECK_ERROR 1609 CHECK_ERROR(audioAdapter, COMSETTER(AudioDriver)(AudioDriverType_ALSA)); 1610 CHECK_ERROR(audioAdapter, COMSETTER(Enabled)(true)); 1611 1611 } 1612 1612 # endif … … 1614 1614 else if (!strcmp(ValueUnion.psz, "pulse")) 1615 1615 { 1616 CHECK_ERROR 1617 CHECK_ERROR 1616 CHECK_ERROR(audioAdapter, COMSETTER(AudioDriver)(AudioDriverType_Pulse)); 1617 CHECK_ERROR(audioAdapter, COMSETTER(Enabled)(true)); 1618 1618 } 1619 1619 # endif … … 1622 1622 else if (!strcmp(ValueUnion.psz, "solaudio")) 1623 1623 { 1624 CHECK_ERROR 1625 CHECK_ERROR 1624 CHECK_ERROR(audioAdapter, COMSETTER(AudioDriver)(AudioDriverType_SolAudio)); 1625 CHECK_ERROR(audioAdapter, COMSETTER(Enabled)(true)); 1626 1626 } 1627 1627 … … 1629 1629 else if (!strcmp(ValueUnion.psz, "oss")) 1630 1630 { 1631 CHECK_ERROR 1632 CHECK_ERROR 1631 CHECK_ERROR(audioAdapter, COMSETTER(AudioDriver)(AudioDriverType_OSS)); 1632 CHECK_ERROR(audioAdapter, COMSETTER(Enabled)(true)); 1633 1633 } 1634 1634 # endif … … 1638 1638 else if (!strcmp(ValueUnion.psz, "coreaudio")) 1639 1639 { 1640 CHECK_ERROR 1641 CHECK_ERROR 1640 CHECK_ERROR(audioAdapter, COMSETTER(AudioDriver)(AudioDriverType_CoreAudio)); 1641 CHECK_ERROR(audioAdapter, COMSETTER(Enabled)(true)); 1642 1642 } 1643 1643 … … 1658 1658 if (!strcmp(ValueUnion.psz, "disabled")) 1659 1659 { 1660 CHECK_ERROR 1660 CHECK_ERROR(machine, COMSETTER(ClipboardMode)(ClipboardMode_Disabled)); 1661 1661 } 1662 1662 else if (!strcmp(ValueUnion.psz, "hosttoguest")) 1663 1663 { 1664 CHECK_ERROR 1664 CHECK_ERROR(machine, COMSETTER(ClipboardMode)(ClipboardMode_HostToGuest)); 1665 1665 } 1666 1666 else if (!strcmp(ValueUnion.psz, "guesttohost")) 1667 1667 { 1668 CHECK_ERROR 1668 CHECK_ERROR(machine, COMSETTER(ClipboardMode)(ClipboardMode_GuestToHost)); 1669 1669 } 1670 1670 else if (!strcmp(ValueUnion.psz, "bidirectional")) 1671 1671 { 1672 CHECK_ERROR 1672 CHECK_ERROR(machine, COMSETTER(ClipboardMode)(ClipboardMode_Bidirectional)); 1673 1673 } 1674 1674 else … … 1691 1691 1692 1692 if (!strcmp(ValueUnion.psz, "default")) 1693 CHECK_ERROR 1694 else 1695 CHECK_ERROR 1693 CHECK_ERROR(vrdpServer, COMSETTER(Ports)(Bstr("0"))); 1694 else 1695 CHECK_ERROR(vrdpServer, COMSETTER(Ports)(Bstr(ValueUnion.psz))); 1696 1696 } 1697 1697 break; … … 1706 1706 ASSERT(vrdpServer); 1707 1707 1708 CHECK_ERROR 1708 CHECK_ERROR(vrdpServer, COMSETTER(NetAddress)(Bstr(ValueUnion.psz))); 1709 1709 } 1710 1710 break; … … 1721 1721 if (!strcmp(ValueUnion.psz, "null")) 1722 1722 { 1723 CHECK_ERROR 1723 CHECK_ERROR(vrdpServer, COMSETTER(AuthType)(VRDPAuthType_Null)); 1724 1724 } 1725 1725 else if (!strcmp(ValueUnion.psz, "external")) 1726 1726 { 1727 CHECK_ERROR 1727 CHECK_ERROR(vrdpServer, COMSETTER(AuthType)(VRDPAuthType_External)); 1728 1728 } 1729 1729 else if (!strcmp(ValueUnion.psz, "guest")) 1730 1730 { 1731 CHECK_ERROR 1731 CHECK_ERROR(vrdpServer, COMSETTER(AuthType)(VRDPAuthType_Guest)); 1732 1732 } 1733 1733 else … … 1750 1750 if (!strcmp(ValueUnion.psz, "on")) 1751 1751 { 1752 CHECK_ERROR 1752 CHECK_ERROR(vrdpServer, COMSETTER(AllowMultiConnection)(true)); 1753 1753 } 1754 1754 else if (!strcmp(ValueUnion.psz, "off")) 1755 1755 { 1756 CHECK_ERROR 1756 CHECK_ERROR(vrdpServer, COMSETTER(AllowMultiConnection)(false)); 1757 1757 } 1758 1758 else … … 1775 1775 if (!strcmp(ValueUnion.psz, "on")) 1776 1776 { 1777 CHECK_ERROR 1777 CHECK_ERROR(vrdpServer, COMSETTER(ReuseSingleConnection)(true)); 1778 1778 } 1779 1779 else if (!strcmp(ValueUnion.psz, "off")) 1780 1780 { 1781 CHECK_ERROR 1781 CHECK_ERROR(vrdpServer, COMSETTER(ReuseSingleConnection)(false)); 1782 1782 } 1783 1783 else … … 1800 1800 if (!strcmp(ValueUnion.psz, "on")) 1801 1801 { 1802 CHECK_ERROR 1802 CHECK_ERROR(vrdpServer, COMSETTER(Enabled)(true)); 1803 1803 } 1804 1804 else if (!strcmp(ValueUnion.psz, "off")) 1805 1805 { 1806 CHECK_ERROR 1806 CHECK_ERROR(vrdpServer, COMSETTER(Enabled)(false)); 1807 1807 } 1808 1808 else … … 1821 1821 { 1822 1822 ComPtr<IUSBController> UsbCtl; 1823 CHECK_ERROR 1823 CHECK_ERROR(machine, COMGETTER(USBController)(UsbCtl.asOutParam())); 1824 1824 if (SUCCEEDED(rc)) 1825 1825 { 1826 1826 if (!strcmp(ValueUnion.psz, "on") || !strcmp(ValueUnion.psz, "enable")) 1827 CHECK_ERROR 1827 CHECK_ERROR(UsbCtl, COMSETTER(EnabledEhci)(true)); 1828 1828 else if (!strcmp(ValueUnion.psz, "off") || !strcmp(ValueUnion.psz, "disable")) 1829 CHECK_ERROR 1829 CHECK_ERROR(UsbCtl, COMSETTER(EnabledEhci)(false)); 1830 1830 else 1831 1831 return errorArgument("Invalid --usbehci argument '%s'", ValueUnion.psz); … … 1840 1840 { 1841 1841 ComPtr<IUSBController> UsbCtl; 1842 CHECK_ERROR 1842 CHECK_ERROR(machine, COMGETTER(USBController)(UsbCtl.asOutParam())); 1843 1843 if (SUCCEEDED(rc)) 1844 1844 { 1845 1845 if (!strcmp(ValueUnion.psz, "on") || !strcmp(ValueUnion.psz, "enable")) 1846 CHECK_ERROR 1846 CHECK_ERROR(UsbCtl, COMSETTER(Enabled)(true)); 1847 1847 else if (!strcmp(ValueUnion.psz, "off") || !strcmp(ValueUnion.psz, "disable")) 1848 CHECK_ERROR 1848 CHECK_ERROR(UsbCtl, COMSETTER(Enabled)(false)); 1849 1849 else 1850 1850 return errorArgument("Invalid --usb argument '%s'", ValueUnion.psz); … … 1859 1859 { 1860 1860 if (!strcmp(ValueUnion.psz, "default")) 1861 CHECK_ERROR 1862 else 1863 CHECK_ERROR 1861 CHECK_ERROR(machine, COMSETTER(SnapshotFolder)(NULL)); 1862 else 1863 CHECK_ERROR(machine, COMSETTER(SnapshotFolder)(Bstr(ValueUnion.psz))); 1864 1864 } 1865 1865 break; … … 1871 1871 { 1872 1872 if (!strcmp(ValueUnion.psz, "on")) 1873 CHECK_ERROR 1873 CHECK_ERROR(machine, COMSETTER(TeleporterEnabled)(1)); 1874 1874 else if (!strcmp(ValueUnion.psz, "off")) 1875 CHECK_ERROR 1875 CHECK_ERROR(machine, COMSETTER(TeleporterEnabled)(0)); 1876 1876 else 1877 1877 return errorArgument("Invalid --teleporterenabled value '%s'", ValueUnion.psz); … … 1912 1912 /* commit changes */ 1913 1913 if (SUCCEEDED(rc)) 1914 CHECK_ERROR 1914 CHECK_ERROR(machine, SaveSettings()); 1915 1915 1916 1916 /* it's important to always close sessions */ -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageStorageController.cpp
r23932 r23934 79 79 return errorSyntax(USAGE_STORAGEATTACH, "Too many parameters"); 80 80 81 RTGetOptInit 82 81 RTGetOptInit(&GetState, a->argc, a->argv, g_aStorageAttachOptions, 82 RT_ELEMENTS(g_aStorageAttachOptions), 1, 0 /* fFlags */); 83 83 84 84 while ( SUCCEEDED(rc) … … 156 156 if (!Guid(machineuuid).isEmpty()) 157 157 { 158 CHECK_ERROR_RET (a->virtualBox, GetMachine(machineuuid, machine.asOutParam()), 1);158 CHECK_ERROR_RET(a->virtualBox, GetMachine(machineuuid, machine.asOutParam()), 1); 159 159 } 160 160 else 161 161 { 162 CHECK_ERROR_RET 162 CHECK_ERROR_RET(a->virtualBox, FindMachine(Bstr(a->argv[0]), machine.asOutParam()), 1); 163 163 machine->COMGETTER(Id)(machineuuid.asOutParam()); 164 164 } … … 169 169 { 170 170 /* try to open an existing session for the VM */ 171 CHECK_ERROR_RET (a->virtualBox, OpenExistingSession(a->session, machineuuid), 1);171 CHECK_ERROR_RET(a->virtualBox, OpenExistingSession(a->session, machineuuid), 1); 172 172 fRunTime = true; 173 173 } … … 201 201 if (!RTStrICmp(pszMedium, "none")) 202 202 { 203 CHECK_ERROR 203 CHECK_ERROR(machine, DetachDevice(Bstr(pszCtl), port, device)); 204 204 } 205 205 else if (!RTStrICmp(pszMedium, "emptydrive")) … … 212 212 { 213 213 DeviceType_T deviceType; 214 mediumAttachment->COMGETTER(Type) 214 mediumAttachment->COMGETTER(Type)(&deviceType); 215 215 216 216 if ( (deviceType == DeviceType_DVD) … … 218 218 { 219 219 /* just unmount the floppy/dvd */ 220 CHECK_ERROR 220 CHECK_ERROR(machine, MountMedium(Bstr(pszCtl), port, device, Bstr(""))); 221 221 } 222 222 else … … 240 240 DeviceType_T deviceType = DeviceType_Null; 241 241 242 CHECK_ERROR 242 CHECK_ERROR(storageCtl, COMGETTER(Bus)(&storageBus)); 243 243 244 244 if (storageBus == StorageBus_Floppy) … … 249 249 /* attach a empty floppy/dvd drive after removing previous attachment */ 250 250 machine->DetachDevice(Bstr(pszCtl), port, device); 251 CHECK_ERROR 251 CHECK_ERROR(machine, AttachDevice(Bstr(pszCtl), port, device, deviceType, Bstr(""))); 252 252 } 253 253 } … … 274 274 { 275 275 DeviceType_T deviceType; 276 mediumAttachement->COMGETTER(Type) 276 mediumAttachement->COMGETTER(Type)(&deviceType); 277 277 278 278 if (deviceType != DeviceType_DVD) … … 295 295 { 296 296 ComPtr<IHost> host; 297 CHECK_ERROR 297 CHECK_ERROR(a->virtualBox, COMGETTER(Host)(host.asOutParam())); 298 298 rc = host->FindHostDVDDrive(Bstr(pszMedium + 5), dvdMedium.asOutParam()); 299 299 if (!dvdMedium) … … 329 329 { 330 330 Bstr emptyUUID; 331 CHECK_ERROR 331 CHECK_ERROR(a->virtualBox, OpenDVDImage(Bstr(pszMedium), 332 332 emptyUUID, dvdMedium.asOutParam())); 333 333 } … … 345 345 { 346 346 dvdMedium->COMGETTER(Id)(uuid.asOutParam()); 347 CHECK_ERROR 347 CHECK_ERROR(machine, MountMedium(Bstr(pszCtl), port, device, uuid)); 348 348 } 349 349 } … … 358 358 { 359 359 DeviceType_T deviceType; 360 mediumAttachement->COMGETTER(Type) 360 mediumAttachement->COMGETTER(Type)(&deviceType); 361 361 362 362 if (deviceType != DeviceType_HardDisk) … … 376 376 { 377 377 /* open the new hard disk object */ 378 CHECK_ERROR 378 CHECK_ERROR(a->virtualBox, 379 379 OpenHardDisk(Bstr(pszMedium), 380 380 AccessMode_ReadWrite, false, Bstr(""), … … 386 386 { 387 387 hardDisk->COMGETTER(Id)(uuid.asOutParam()); 388 CHECK_ERROR 388 CHECK_ERROR(machine, AttachDevice(Bstr(pszCtl), port, device, DeviceType_HardDisk, uuid)); 389 389 } 390 390 else … … 403 403 if ( !fRunTime 404 404 && !floppyAttachment) 405 CHECK_ERROR 405 CHECK_ERROR(machine, AttachDevice(Bstr(pszCtl), port, device, DeviceType_Floppy, Bstr(""))); 406 406 407 407 /* host drive? */ … … 410 410 ComPtr<IHost> host; 411 411 412 CHECK_ERROR 412 CHECK_ERROR(a->virtualBox, COMGETTER(Host)(host.asOutParam())); 413 413 rc = host->FindHostFloppyDrive(Bstr(pszMedium + 5), floppyMedium.asOutParam()); 414 414 if (!floppyMedium) … … 431 431 { 432 432 Bstr emptyUUID; 433 CHECK_ERROR 433 CHECK_ERROR(a->virtualBox, 434 434 OpenFloppyImage(Bstr(pszMedium), 435 435 emptyUUID, … … 448 448 { 449 449 floppyMedium->COMGETTER(Id)(uuid.asOutParam()); 450 CHECK_ERROR 450 CHECK_ERROR(machine, MountMedium(Bstr(pszCtl), port, device, uuid)); 451 451 } 452 452 } … … 463 463 ComPtr<IMediumAttachment> mattach; 464 464 465 CHECK_ERROR 465 CHECK_ERROR(machine, GetMediumAttachment(Bstr(pszCtl), port, device, mattach.asOutParam())); 466 466 467 467 if (SUCCEEDED(rc)) … … 469 469 if (!RTStrICmp(pszPassThrough, "on")) 470 470 { 471 CHECK_ERROR 471 CHECK_ERROR(machine, PassthroughDevice(Bstr(pszCtl), port, device, TRUE)); 472 472 } 473 473 else if (!RTStrICmp(pszPassThrough, "off")) 474 474 { 475 CHECK_ERROR 475 CHECK_ERROR(machine, PassthroughDevice(Bstr(pszCtl), port, device, FALSE)); 476 476 } 477 477 else … … 490 490 /* commit changes */ 491 491 if (SUCCEEDED(rc)) 492 CHECK_ERROR 492 CHECK_ERROR(machine, SaveSettings()); 493 493 494 494 leave: … … 608 608 if (!Guid(machineuuid).isEmpty()) 609 609 { 610 CHECK_ERROR_RET 610 CHECK_ERROR_RET(a->virtualBox, GetMachine (machineuuid, machine.asOutParam()), 1); 611 611 } 612 612 else 613 613 { 614 CHECK_ERROR_RET 614 CHECK_ERROR_RET(a->virtualBox, FindMachine(Bstr(a->argv[0]), machine.asOutParam()), 1); 615 615 machine->COMGETTER(Id)(machineuuid.asOutParam()); 616 616 } 617 617 618 618 /* open a session for the VM */ 619 CHECK_ERROR_RET 619 CHECK_ERROR_RET(a->virtualBox, OpenSession (a->session, machineuuid), 1); 620 620 621 621 /* get the mutable session machine */ … … 634 634 com::SafeIfaceArray<IMediumAttachment> mediumAttachments; 635 635 636 CHECK_ERROR 636 CHECK_ERROR(machine, 637 637 GetMediumAttachmentsOfController(Bstr(pszCtl), 638 638 ComSafeArrayAsOutParam(mediumAttachments))); … … 643 643 LONG device = 0; 644 644 645 CHECK_ERROR 646 CHECK_ERROR 647 CHECK_ERROR 645 CHECK_ERROR(mediumAttach, COMGETTER(Port)(&port)); 646 CHECK_ERROR(mediumAttach, COMGETTER(Device)(&device)); 647 CHECK_ERROR(machine, DetachDevice(Bstr(pszCtl), port, device)); 648 648 } 649 649 650 650 if (SUCCEEDED(rc)) 651 CHECK_ERROR 651 CHECK_ERROR(machine, RemoveStorageController(Bstr(pszCtl))); 652 652 else 653 653 errorArgument("Can't detach the devices connected to '%s' Controller\n" … … 662 662 if (!RTStrICmp(pszBusType, "ide")) 663 663 { 664 CHECK_ERROR 664 CHECK_ERROR(machine, AddStorageController(Bstr(pszCtl), StorageBus_IDE, ctl.asOutParam())); 665 665 } 666 666 else if (!RTStrICmp(pszBusType, "sata")) 667 667 { 668 CHECK_ERROR 668 CHECK_ERROR(machine, AddStorageController(Bstr(pszCtl), StorageBus_SATA, ctl.asOutParam())); 669 669 } 670 670 else if (!RTStrICmp(pszBusType, "scsi")) 671 671 { 672 CHECK_ERROR 672 CHECK_ERROR(machine, AddStorageController(Bstr(pszCtl), StorageBus_SCSI, ctl.asOutParam())); 673 673 } 674 674 else if (!RTStrICmp(pszBusType, "floppy")) 675 675 { 676 CHECK_ERROR 676 CHECK_ERROR(machine, AddStorageController(Bstr(pszCtl), StorageBus_Floppy, ctl.asOutParam())); 677 677 } 678 678 else … … 688 688 ComPtr<IStorageController> ctl; 689 689 690 CHECK_ERROR 690 CHECK_ERROR(machine, GetStorageControllerByName(Bstr(pszCtl), ctl.asOutParam())); 691 691 692 692 if (SUCCEEDED(rc)) … … 694 694 if (!RTStrICmp(pszCtlType, "lsilogic")) 695 695 { 696 CHECK_ERROR 696 CHECK_ERROR(ctl, COMSETTER(ControllerType)(StorageControllerType_LsiLogic)); 697 697 } 698 698 else if (!RTStrICmp(pszCtlType, "buslogic")) 699 699 { 700 CHECK_ERROR 700 CHECK_ERROR(ctl, COMSETTER(ControllerType)(StorageControllerType_BusLogic)); 701 701 } 702 702 else if (!RTStrICmp(pszCtlType, "intelahci")) 703 703 { 704 CHECK_ERROR 704 CHECK_ERROR(ctl, COMSETTER(ControllerType)(StorageControllerType_IntelAhci)); 705 705 } 706 706 else if (!RTStrICmp(pszCtlType, "piix3")) 707 707 { 708 CHECK_ERROR 708 CHECK_ERROR(ctl, COMSETTER(ControllerType)(StorageControllerType_PIIX3)); 709 709 } 710 710 else if (!RTStrICmp(pszCtlType, "piix4")) 711 711 { 712 CHECK_ERROR 712 CHECK_ERROR(ctl, COMSETTER(ControllerType)(StorageControllerType_PIIX4)); 713 713 } 714 714 else if (!RTStrICmp(pszCtlType, "ich6")) 715 715 { 716 CHECK_ERROR 716 CHECK_ERROR(ctl, COMSETTER(ControllerType)(StorageControllerType_ICH6)); 717 717 } 718 718 else if (!RTStrICmp(pszCtlType, "i82078")) 719 719 { 720 CHECK_ERROR 720 CHECK_ERROR(ctl, COMSETTER(ControllerType)(StorageControllerType_I82078)); 721 721 } 722 722 else … … 738 738 ComPtr<IStorageController> ctl; 739 739 740 CHECK_ERROR 740 CHECK_ERROR(machine, GetStorageControllerByName(Bstr(pszCtl), ctl.asOutParam())); 741 741 742 742 if (SUCCEEDED(rc)) 743 743 { 744 CHECK_ERROR 744 CHECK_ERROR(ctl, COMSETTER(PortCount)(sataportcount)); 745 745 } 746 746 else … … 757 757 ComPtr<IStorageController> ctl; 758 758 759 CHECK_ERROR 759 CHECK_ERROR(machine, GetStorageControllerByName(Bstr(pszCtl), ctl.asOutParam())); 760 760 761 761 if (SUCCEEDED(rc)) 762 762 { 763 CHECK_ERROR 763 CHECK_ERROR(ctl, SetIDEEmulationPort(satabootdev, sataidedev)); 764 764 } 765 765 else … … 773 773 /* commit changes */ 774 774 if (SUCCEEDED(rc)) 775 CHECK_ERROR 775 CHECK_ERROR(machine, SaveSettings()); 776 776 777 777 /* it's important to always close sessions */
Note:
See TracChangeset
for help on using the changeset viewer.