Changeset 55234 in vbox
- Timestamp:
- Apr 14, 2015 9:13:33 AM (10 years ago)
- Location:
- trunk/src/VBox/Frontends/VBoxManage
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageMisc.cpp
r55214 r55234 650 650 do 651 651 { 652 ComPtr<IMachine> console;653 CHECK_ERROR_BREAK(a->session, COMGETTER(Machine)( machine.asOutParam()));654 CHECK_ERROR_BREAK( console, DiscardSavedState(true /* fDeleteFile */));652 ComPtr<IMachine> sessionMachine; 653 CHECK_ERROR_BREAK(a->session, COMGETTER(Machine)(sessionMachine.asOutParam())); 654 CHECK_ERROR_BREAK(sessionMachine, DiscardSavedState(true /* fDeleteFile */)); 655 655 } while (0); 656 656 CHECK_ERROR_BREAK(a->session, UnlockMachine()); … … 687 687 do 688 688 { 689 ComPtr<IMachine> machine;690 CHECK_ERROR_BREAK(a->session, COMGETTER(Machine)( machine.asOutParam()));691 CHECK_ERROR_BREAK( machine, AdoptSavedState(Bstr(szStateFileAbs).raw()));689 ComPtr<IMachine> sessionMachine; 690 CHECK_ERROR_BREAK(a->session, COMGETTER(Machine)(sessionMachine.asOutParam())); 691 CHECK_ERROR_BREAK(sessionMachine, AdoptSavedState(Bstr(szStateFileAbs).raw())); 692 692 } while (0); 693 693 CHECK_ERROR_BREAK(a->session, UnlockMachine()); … … 807 807 CHECK_ERROR_RET(machine, LockMachine(a->session, LockType_Shared), 1); 808 808 /* get the session machine */ 809 CHECK_ERROR_RET(a->session, COMGETTER(Machine)(machine.asOutParam()), 1); 809 ComPtr<IMachine> sessionMachine; 810 CHECK_ERROR_RET(a->session, COMGETTER(Machine)(sessionMachine.asOutParam()), 1); 810 811 /** @todo passing NULL is deprecated */ 811 812 if (a->argc < 3) 812 CHECK_ERROR( machine, SetExtraData(Bstr(a->argv[1]).raw(),813 NULL));813 CHECK_ERROR(sessionMachine, SetExtraData(Bstr(a->argv[1]).raw(), 814 NULL)); 814 815 else if (a->argc == 3) 815 CHECK_ERROR( machine, SetExtraData(Bstr(a->argv[1]).raw(),816 Bstr(a->argv[2]).raw()));816 CHECK_ERROR(sessionMachine, SetExtraData(Bstr(a->argv[1]).raw(), 817 Bstr(a->argv[2]).raw())); 817 818 else 818 819 return errorSyntax(USAGE_SETEXTRADATA, "Too many parameters"); … … 989 990 /* open an existing session for the VM */ 990 991 CHECK_ERROR_RET(machine, LockMachine(a->session, LockType_Shared), 1); 992 991 993 /* get the session machine */ 992 CHECK_ERROR_RET(a->session, COMGETTER(Machine)(machine.asOutParam()), 1); 994 ComPtr<IMachine> sessionMachine; 995 CHECK_ERROR_RET(a->session, COMGETTER(Machine)(sessionMachine.asOutParam()), 1); 996 993 997 /* get the session console */ 994 998 CHECK_ERROR_RET(a->session, COMGETTER(Console)(console.asOutParam()), 1); … … 1006 1010 1007 1011 /* get the mutable session machine */ 1008 a->session->COMGETTER(Machine)(machine.asOutParam()); 1009 1010 CHECK_ERROR(machine, CreateSharedFolder(Bstr(name).raw(), 1011 Bstr(hostpath).raw(), 1012 fWritable, fAutoMount)); 1012 ComPtr<IMachine> sessionMachine; 1013 a->session->COMGETTER(Machine)(sessionMachine.asOutParam()); 1014 1015 CHECK_ERROR(sessionMachine, CreateSharedFolder(Bstr(name).raw(), 1016 Bstr(hostpath).raw(), 1017 fWritable, fAutoMount)); 1013 1018 if (SUCCEEDED(rc)) 1014 CHECK_ERROR( machine, SaveSettings());1019 CHECK_ERROR(sessionMachine, SaveSettings()); 1015 1020 1016 1021 a->session->UnlockMachine(); … … 1056 1061 CHECK_ERROR_RET(machine, LockMachine(a->session, LockType_Shared), 1); 1057 1062 /* get the session machine */ 1058 CHECK_ERROR_RET(a->session, COMGETTER(Machine)(machine.asOutParam()), 1); 1063 ComPtr<IMachine> sessionMachine; 1064 CHECK_ERROR_RET(a->session, COMGETTER(Machine)(sessionMachine.asOutParam()), 1); 1059 1065 /* get the session console */ 1060 1066 CHECK_ERROR_RET(a->session, COMGETTER(Console)(console.asOutParam()), 1); … … 1071 1077 1072 1078 /* get the mutable session machine */ 1073 a->session->COMGETTER(Machine)(machine.asOutParam()); 1074 1075 CHECK_ERROR(machine, RemoveSharedFolder(Bstr(name).raw())); 1079 ComPtr<IMachine> sessionMachine; 1080 a->session->COMGETTER(Machine)(sessionMachine.asOutParam()); 1081 1082 CHECK_ERROR(sessionMachine, RemoveSharedFolder(Bstr(name).raw())); 1076 1083 1077 1084 /* commit and close the session */ 1078 CHECK_ERROR( machine, SaveSettings());1085 CHECK_ERROR(sessionMachine, SaveSettings()); 1079 1086 a->session->UnlockMachine(); 1080 1087 } -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r54911 r55234 460 460 HRESULT rc; 461 461 Bstr name; 462 RTGETOPTUNION ValueUnion;463 RTGETOPTSTATE GetOptState;464 ComPtr<IMachine> machine;465 ComPtr<IBIOSSettings> biosSettings;466 462 467 463 /* VM ID + at least one parameter. Parameter arguments are checked … … 470 466 return errorSyntax(USAGE_MODIFYVM, "Not enough parameters"); 471 467 472 /* try to find the given machine */ 468 /* try to find the given sessionMachine */ 469 ComPtr<IMachine> machine; 473 470 CHECK_ERROR_RET(a->virtualBox, FindMachine(Bstr(a->argv[0]).raw(), 474 471 machine.asOutParam()), 1); … … 481 478 CHECK_ERROR_RET(machine, LockMachine(a->session, LockType_Write), 1); 482 479 483 /* get the mutable session machine */ 484 CHECK_ERROR_RET(a->session, COMGETTER(Machine)(machine.asOutParam()), 1); 485 machine->COMGETTER(BIOSSettings)(biosSettings.asOutParam()); 486 480 /* get the mutable session sessionMachine */ 481 ComPtr<IMachine> sessionMachine; 482 CHECK_ERROR_RET(a->session, COMGETTER(Machine)(sessionMachine.asOutParam()), 1); 483 484 ComPtr<IBIOSSettings> biosSettings; 485 sessionMachine->COMGETTER(BIOSSettings)(biosSettings.asOutParam()); 486 487 RTGETOPTSTATE GetOptState; 487 488 RTGetOptInit(&GetOptState, a->argc, a->argv, g_aModifyVMOptions, 488 489 RT_ELEMENTS(g_aModifyVMOptions), 1, RTGETOPTINIT_FLAGS_NO_STD_OPTS); 489 490 491 RTGETOPTUNION ValueUnion; 490 492 while ( SUCCEEDED (rc) 491 493 && (c = RTGetOpt(&GetOptState, &ValueUnion))) … … 495 497 case MODIFYVM_NAME: 496 498 { 497 CHECK_ERROR( machine, COMSETTER(Name)(Bstr(ValueUnion.psz).raw()));499 CHECK_ERROR(sessionMachine, COMSETTER(Name)(Bstr(ValueUnion.psz).raw())); 498 500 break; 499 501 } … … 502 504 com::SafeArray<BSTR> groups; 503 505 parseGroups(ValueUnion.psz, &groups); 504 CHECK_ERROR( machine, COMSETTER(Groups)(ComSafeArrayAsInParam(groups)));506 CHECK_ERROR(sessionMachine, COMSETTER(Groups)(ComSafeArrayAsInParam(groups))); 505 507 break; 506 508 } 507 509 case MODIFYVM_DESCRIPTION: 508 510 { 509 CHECK_ERROR( machine, COMSETTER(Description)(Bstr(ValueUnion.psz).raw()));511 CHECK_ERROR(sessionMachine, COMSETTER(Description)(Bstr(ValueUnion.psz).raw())); 510 512 break; 511 513 } … … 517 519 if (SUCCEEDED(rc) && guestOSType) 518 520 { 519 CHECK_ERROR( machine, COMSETTER(OSTypeId)(Bstr(ValueUnion.psz).raw()));521 CHECK_ERROR(sessionMachine, COMSETTER(OSTypeId)(Bstr(ValueUnion.psz).raw())); 520 522 } 521 523 else … … 560 562 } 561 563 RTFileClose(iconFile); 562 CHECK_ERROR( machine, COMSETTER(Icon)(ComSafeArrayAsInParam(icon)));564 CHECK_ERROR(sessionMachine, COMSETTER(Icon)(ComSafeArrayAsInParam(icon))); 563 565 break; 564 566 } … … 566 568 case MODIFYVM_MEMORY: 567 569 { 568 CHECK_ERROR( machine, COMSETTER(MemorySize)(ValueUnion.u32));570 CHECK_ERROR(sessionMachine, COMSETTER(MemorySize)(ValueUnion.u32)); 569 571 break; 570 572 } … … 572 574 case MODIFYVM_PAGEFUSION: 573 575 { 574 CHECK_ERROR( machine, COMSETTER(PageFusionEnabled)(ValueUnion.f));576 CHECK_ERROR(sessionMachine, COMSETTER(PageFusionEnabled)(ValueUnion.f)); 575 577 break; 576 578 } … … 578 580 case MODIFYVM_VRAM: 579 581 { 580 CHECK_ERROR( machine, COMSETTER(VRAMSize)(ValueUnion.u32));582 CHECK_ERROR(sessionMachine, COMSETTER(VRAMSize)(ValueUnion.u32)); 581 583 break; 582 584 } … … 586 588 if (!RTStrICmp(ValueUnion.psz, "efi")) 587 589 { 588 CHECK_ERROR( machine, COMSETTER(FirmwareType)(FirmwareType_EFI));590 CHECK_ERROR(sessionMachine, COMSETTER(FirmwareType)(FirmwareType_EFI)); 589 591 } 590 592 else if (!RTStrICmp(ValueUnion.psz, "efi32")) 591 593 { 592 CHECK_ERROR( machine, COMSETTER(FirmwareType)(FirmwareType_EFI32));594 CHECK_ERROR(sessionMachine, COMSETTER(FirmwareType)(FirmwareType_EFI32)); 593 595 } 594 596 else if (!RTStrICmp(ValueUnion.psz, "efi64")) 595 597 { 596 CHECK_ERROR( machine, COMSETTER(FirmwareType)(FirmwareType_EFI64));598 CHECK_ERROR(sessionMachine, COMSETTER(FirmwareType)(FirmwareType_EFI64)); 597 599 } 598 600 else if (!RTStrICmp(ValueUnion.psz, "efidual")) 599 601 { 600 CHECK_ERROR( machine, COMSETTER(FirmwareType)(FirmwareType_EFIDUAL));602 CHECK_ERROR(sessionMachine, COMSETTER(FirmwareType)(FirmwareType_EFIDUAL)); 601 603 } 602 604 else if (!RTStrICmp(ValueUnion.psz, "bios")) 603 605 { 604 CHECK_ERROR( machine, COMSETTER(FirmwareType)(FirmwareType_BIOS));606 CHECK_ERROR(sessionMachine, COMSETTER(FirmwareType)(FirmwareType_BIOS)); 605 607 } 606 608 else … … 626 628 case MODIFYVM_PAE: 627 629 { 628 CHECK_ERROR( machine, SetCPUProperty(CPUPropertyType_PAE, ValueUnion.f));630 CHECK_ERROR(sessionMachine, SetCPUProperty(CPUPropertyType_PAE, ValueUnion.f)); 629 631 break; 630 632 } … … 632 634 case MODIFYVM_LONGMODE: 633 635 { 634 CHECK_ERROR( machine, SetCPUProperty(CPUPropertyType_LongMode, ValueUnion.f));636 CHECK_ERROR(sessionMachine, SetCPUProperty(CPUPropertyType_LongMode, ValueUnion.f)); 635 637 break; 636 638 } … … 638 640 case MODIFYVM_SYNTHCPU: 639 641 { 640 CHECK_ERROR( machine, SetCPUProperty(CPUPropertyType_Synthetic, ValueUnion.f));642 CHECK_ERROR(sessionMachine, SetCPUProperty(CPUPropertyType_Synthetic, ValueUnion.f)); 641 643 break; 642 644 } … … 644 646 case MODIFYVM_TFRESET: 645 647 { 646 CHECK_ERROR( machine, SetCPUProperty(CPUPropertyType_TripleFaultReset, ValueUnion.f));648 CHECK_ERROR(sessionMachine, SetCPUProperty(CPUPropertyType_TripleFaultReset, ValueUnion.f)); 647 649 break; 648 650 } … … 652 654 if ( !RTStrICmp(ValueUnion.psz, "none") 653 655 || !RTStrICmp(ValueUnion.psz, "disabled")) 654 CHECK_ERROR( machine, COMSETTER(ParavirtProvider)(ParavirtProvider_None));656 CHECK_ERROR(sessionMachine, COMSETTER(ParavirtProvider)(ParavirtProvider_None)); 655 657 else if (!RTStrICmp(ValueUnion.psz, "default")) 656 CHECK_ERROR( machine, COMSETTER(ParavirtProvider)(ParavirtProvider_Default));658 CHECK_ERROR(sessionMachine, COMSETTER(ParavirtProvider)(ParavirtProvider_Default)); 657 659 else if (!RTStrICmp(ValueUnion.psz, "legacy")) 658 CHECK_ERROR( machine, COMSETTER(ParavirtProvider)(ParavirtProvider_Legacy));660 CHECK_ERROR(sessionMachine, COMSETTER(ParavirtProvider)(ParavirtProvider_Legacy)); 659 661 else if (!RTStrICmp(ValueUnion.psz, "minimal")) 660 CHECK_ERROR( machine, COMSETTER(ParavirtProvider)(ParavirtProvider_Minimal));662 CHECK_ERROR(sessionMachine, COMSETTER(ParavirtProvider)(ParavirtProvider_Minimal)); 661 663 else if (!RTStrICmp(ValueUnion.psz, "hyperv")) 662 CHECK_ERROR( machine, COMSETTER(ParavirtProvider)(ParavirtProvider_HyperV));664 CHECK_ERROR(sessionMachine, COMSETTER(ParavirtProvider)(ParavirtProvider_HyperV)); 663 665 else if (!RTStrICmp(ValueUnion.psz, "kvm")) 664 CHECK_ERROR( machine, COMSETTER(ParavirtProvider)(ParavirtProvider_KVM));666 CHECK_ERROR(sessionMachine, COMSETTER(ParavirtProvider)(ParavirtProvider_KVM)); 665 667 else 666 668 { … … 673 675 case MODIFYVM_HWVIRTEX: 674 676 { 675 CHECK_ERROR( machine, SetHWVirtExProperty(HWVirtExPropertyType_Enabled, ValueUnion.f));677 CHECK_ERROR(sessionMachine, SetHWVirtExProperty(HWVirtExPropertyType_Enabled, ValueUnion.f)); 676 678 break; 677 679 } … … 691 693 aValue[i] = ValueUnion.u32; 692 694 } 693 CHECK_ERROR( machine, SetCPUIDLeaf(id, aValue[0], aValue[1], aValue[2], aValue[3]));695 CHECK_ERROR(sessionMachine, SetCPUIDLeaf(id, aValue[0], aValue[1], aValue[2], aValue[3])); 694 696 break; 695 697 } … … 697 699 case MODIFYVM_DELCPUID: 698 700 { 699 CHECK_ERROR( machine, RemoveCPUIDLeaf(ValueUnion.u32));701 CHECK_ERROR(sessionMachine, RemoveCPUIDLeaf(ValueUnion.u32)); 700 702 break; 701 703 } … … 703 705 case MODIFYVM_DELALLCPUID: 704 706 { 705 CHECK_ERROR( machine, RemoveAllCPUIDLeaves());707 CHECK_ERROR(sessionMachine, RemoveAllCPUIDLeaves()); 706 708 break; 707 709 } … … 709 711 case MODIFYVM_NESTEDPAGING: 710 712 { 711 CHECK_ERROR( machine, SetHWVirtExProperty(HWVirtExPropertyType_NestedPaging, ValueUnion.f));713 CHECK_ERROR(sessionMachine, SetHWVirtExProperty(HWVirtExPropertyType_NestedPaging, ValueUnion.f)); 712 714 break; 713 715 } … … 715 717 case MODIFYVM_LARGEPAGES: 716 718 { 717 CHECK_ERROR( machine, SetHWVirtExProperty(HWVirtExPropertyType_LargePages, ValueUnion.f));719 CHECK_ERROR(sessionMachine, SetHWVirtExProperty(HWVirtExPropertyType_LargePages, ValueUnion.f)); 718 720 break; 719 721 } … … 721 723 case MODIFYVM_VTXVPID: 722 724 { 723 CHECK_ERROR( machine, SetHWVirtExProperty(HWVirtExPropertyType_VPID, ValueUnion.f));725 CHECK_ERROR(sessionMachine, SetHWVirtExProperty(HWVirtExPropertyType_VPID, ValueUnion.f)); 724 726 break; 725 727 } … … 727 729 case MODIFYVM_VTXUX: 728 730 { 729 CHECK_ERROR( machine, SetHWVirtExProperty(HWVirtExPropertyType_UnrestrictedExecution, ValueUnion.f));731 CHECK_ERROR(sessionMachine, SetHWVirtExProperty(HWVirtExPropertyType_UnrestrictedExecution, ValueUnion.f)); 730 732 break; 731 733 } … … 733 735 case MODIFYVM_CPUS: 734 736 { 735 CHECK_ERROR( machine, COMSETTER(CPUCount)(ValueUnion.u32));737 CHECK_ERROR(sessionMachine, COMSETTER(CPUCount)(ValueUnion.u32)); 736 738 break; 737 739 } … … 739 741 case MODIFYVM_RTCUSEUTC: 740 742 { 741 CHECK_ERROR( machine, COMSETTER(RTCUseUTC)(ValueUnion.f));743 CHECK_ERROR(sessionMachine, COMSETTER(RTCUseUTC)(ValueUnion.f)); 742 744 break; 743 745 } … … 745 747 case MODIFYVM_CPUHOTPLUG: 746 748 { 747 CHECK_ERROR( machine, COMSETTER(CPUHotPlugEnabled)(ValueUnion.f));749 CHECK_ERROR(sessionMachine, COMSETTER(CPUHotPlugEnabled)(ValueUnion.f)); 748 750 break; 749 751 } … … 751 753 case MODIFYVM_PLUGCPU: 752 754 { 753 CHECK_ERROR( machine, HotPlugCPU(ValueUnion.u32));755 CHECK_ERROR(sessionMachine, HotPlugCPU(ValueUnion.u32)); 754 756 break; 755 757 } … … 757 759 case MODIFYVM_UNPLUGCPU: 758 760 { 759 CHECK_ERROR( machine, HotUnplugCPU(ValueUnion.u32));761 CHECK_ERROR(sessionMachine, HotUnplugCPU(ValueUnion.u32)); 760 762 break; 761 763 } … … 763 765 case MODIFYVM_CPU_EXECTUION_CAP: 764 766 { 765 CHECK_ERROR( machine, COMSETTER(CPUExecutionCap)(ValueUnion.u32));767 CHECK_ERROR(sessionMachine, COMSETTER(CPUExecutionCap)(ValueUnion.u32)); 766 768 break; 767 769 } … … 771 773 if ( !RTStrICmp(ValueUnion.psz, "none") 772 774 || !RTStrICmp(ValueUnion.psz, "disabled")) 773 CHECK_ERROR( machine, COMSETTER(GraphicsControllerType)(GraphicsControllerType_Null));775 CHECK_ERROR(sessionMachine, COMSETTER(GraphicsControllerType)(GraphicsControllerType_Null)); 774 776 else if ( !RTStrICmp(ValueUnion.psz, "vboxvga") 775 777 || !RTStrICmp(ValueUnion.psz, "vbox") 776 778 || !RTStrICmp(ValueUnion.psz, "vga") 777 779 || !RTStrICmp(ValueUnion.psz, "vesa")) 778 CHECK_ERROR( machine, COMSETTER(GraphicsControllerType)(GraphicsControllerType_VBoxVGA));780 CHECK_ERROR(sessionMachine, COMSETTER(GraphicsControllerType)(GraphicsControllerType_VBoxVGA)); 779 781 #ifdef VBOX_WITH_VMSVGA 780 782 else if ( !RTStrICmp(ValueUnion.psz, "vmsvga") 781 783 || !RTStrICmp(ValueUnion.psz, "vmware")) 782 CHECK_ERROR( machine, COMSETTER(GraphicsControllerType)(GraphicsControllerType_VMSVGA));784 CHECK_ERROR(sessionMachine, COMSETTER(GraphicsControllerType)(GraphicsControllerType_VMSVGA)); 783 785 #endif 784 786 else … … 792 794 case MODIFYVM_MONITORCOUNT: 793 795 { 794 CHECK_ERROR( machine, COMSETTER(MonitorCount)(ValueUnion.u32));796 CHECK_ERROR(sessionMachine, COMSETTER(MonitorCount)(ValueUnion.u32)); 795 797 break; 796 798 } … … 798 800 case MODIFYVM_ACCELERATE3D: 799 801 { 800 CHECK_ERROR( machine, COMSETTER(Accelerate3DEnabled)(ValueUnion.f));802 CHECK_ERROR(sessionMachine, COMSETTER(Accelerate3DEnabled)(ValueUnion.f)); 801 803 break; 802 804 } … … 805 807 case MODIFYVM_ACCELERATE2DVIDEO: 806 808 { 807 CHECK_ERROR( machine, COMSETTER(Accelerate2DVideoEnabled)(ValueUnion.f));809 CHECK_ERROR(sessionMachine, COMSETTER(Accelerate2DVideoEnabled)(ValueUnion.f)); 808 810 break; 809 811 } … … 872 874 if (!RTStrICmp(ValueUnion.psz, "none")) 873 875 { 874 CHECK_ERROR( machine, SetBootOrder(GetOptState.uIndex, DeviceType_Null));876 CHECK_ERROR(sessionMachine, SetBootOrder(GetOptState.uIndex, DeviceType_Null)); 875 877 } 876 878 else if (!RTStrICmp(ValueUnion.psz, "floppy")) 877 879 { 878 CHECK_ERROR( machine, SetBootOrder(GetOptState.uIndex, DeviceType_Floppy));880 CHECK_ERROR(sessionMachine, SetBootOrder(GetOptState.uIndex, DeviceType_Floppy)); 879 881 } 880 882 else if (!RTStrICmp(ValueUnion.psz, "dvd")) 881 883 { 882 CHECK_ERROR( machine, SetBootOrder(GetOptState.uIndex, DeviceType_DVD));884 CHECK_ERROR(sessionMachine, SetBootOrder(GetOptState.uIndex, DeviceType_DVD)); 883 885 } 884 886 else if (!RTStrICmp(ValueUnion.psz, "disk")) 885 887 { 886 CHECK_ERROR( machine, SetBootOrder(GetOptState.uIndex, DeviceType_HardDisk));888 CHECK_ERROR(sessionMachine, SetBootOrder(GetOptState.uIndex, DeviceType_HardDisk)); 887 889 } 888 890 else if (!RTStrICmp(ValueUnion.psz, "net")) 889 891 { 890 CHECK_ERROR( machine, SetBootOrder(GetOptState.uIndex, DeviceType_Network));892 CHECK_ERROR(sessionMachine, SetBootOrder(GetOptState.uIndex, DeviceType_Network)); 891 893 } 892 894 else … … 927 929 if (!RTStrICmp(ValueUnion.psz, "none")) 928 930 { 929 machine->DetachDevice(bstrController.raw(), u1, u2);931 sessionMachine->DetachDevice(bstrController.raw(), u1, u2); 930 932 } 931 933 else … … 940 942 if (hardDisk) 941 943 { 942 CHECK_ERROR( machine, AttachDevice(bstrController.raw(),944 CHECK_ERROR(sessionMachine, AttachDevice(bstrController.raw(), 943 945 u1, u2, 944 946 DeviceType_HardDisk, … … 954 956 { 955 957 ComPtr<IStorageController> storageController; 956 CHECK_ERROR( machine, GetStorageControllerByName(Bstr("IDE Controller").raw(),958 CHECK_ERROR(sessionMachine, GetStorageControllerByName(Bstr("IDE Controller").raw(), 957 959 storageController.asOutParam())); 958 960 … … 980 982 { 981 983 ComPtr<IStorageController> SataCtl; 982 CHECK_ERROR( machine, GetStorageControllerByName(Bstr("SATA").raw(),984 CHECK_ERROR(sessionMachine, GetStorageControllerByName(Bstr("SATA").raw(), 983 985 SataCtl.asOutParam())); 984 986 … … 993 995 { 994 996 ComPtr<IStorageController> ctl; 995 CHECK_ERROR( machine, AddStorageController(Bstr("SATA").raw(),997 CHECK_ERROR(sessionMachine, AddStorageController(Bstr("SATA").raw(), 996 998 StorageBus_SATA, 997 999 ctl.asOutParam())); … … 999 1001 } 1000 1002 else if (!RTStrICmp(ValueUnion.psz, "off") || !RTStrICmp(ValueUnion.psz, "disable")) 1001 CHECK_ERROR( machine, RemoveStorageController(Bstr("SATA").raw()));1003 CHECK_ERROR(sessionMachine, RemoveStorageController(Bstr("SATA").raw())); 1002 1004 else 1003 1005 return errorArgument("Invalid --usb argument '%s'", ValueUnion.psz); … … 1009 1011 if (!RTStrICmp(ValueUnion.psz, "none")) 1010 1012 { 1011 rc = machine->DetachDevice(Bstr("LsiLogic").raw(),1013 rc = sessionMachine->DetachDevice(Bstr("LsiLogic").raw(), 1012 1014 GetOptState.uIndex, 0); 1013 1015 if (FAILED(rc)) 1014 CHECK_ERROR( machine, DetachDevice(Bstr("BusLogic").raw(),1016 CHECK_ERROR(sessionMachine, DetachDevice(Bstr("BusLogic").raw(), 1015 1017 GetOptState.uIndex, 0)); 1016 1018 } … … 1026 1028 if (hardDisk) 1027 1029 { 1028 rc = machine->AttachDevice(Bstr("LsiLogic").raw(),1030 rc = sessionMachine->AttachDevice(Bstr("LsiLogic").raw(), 1029 1031 GetOptState.uIndex, 0, 1030 1032 DeviceType_HardDisk, 1031 1033 hardDisk); 1032 1034 if (FAILED(rc)) 1033 CHECK_ERROR( machine,1035 CHECK_ERROR(sessionMachine, 1034 1036 AttachDevice(Bstr("BusLogic").raw(), 1035 1037 GetOptState.uIndex, 0, … … 1049 1051 if (!RTStrICmp(ValueUnion.psz, "LsiLogic")) 1050 1052 { 1051 rc = machine->RemoveStorageController(Bstr("BusLogic").raw());1053 rc = sessionMachine->RemoveStorageController(Bstr("BusLogic").raw()); 1052 1054 if (FAILED(rc)) 1053 CHECK_ERROR( machine, RemoveStorageController(Bstr("LsiLogic").raw()));1054 1055 CHECK_ERROR( machine,1055 CHECK_ERROR(sessionMachine, RemoveStorageController(Bstr("LsiLogic").raw())); 1056 1057 CHECK_ERROR(sessionMachine, 1056 1058 AddStorageController(Bstr("LsiLogic").raw(), 1057 1059 StorageBus_SCSI, … … 1063 1065 else if (!RTStrICmp(ValueUnion.psz, "BusLogic")) 1064 1066 { 1065 rc = machine->RemoveStorageController(Bstr("LsiLogic").raw());1067 rc = sessionMachine->RemoveStorageController(Bstr("LsiLogic").raw()); 1066 1068 if (FAILED(rc)) 1067 CHECK_ERROR( machine, RemoveStorageController(Bstr("BusLogic").raw()));1068 1069 CHECK_ERROR( machine,1069 CHECK_ERROR(sessionMachine, RemoveStorageController(Bstr("BusLogic").raw())); 1070 1071 CHECK_ERROR(sessionMachine, 1070 1072 AddStorageController(Bstr("BusLogic").raw(), 1071 1073 StorageBus_SCSI, … … 1086 1088 ComPtr<IStorageController> ctl; 1087 1089 1088 CHECK_ERROR( machine, AddStorageController(Bstr("BusLogic").raw(),1090 CHECK_ERROR(sessionMachine, AddStorageController(Bstr("BusLogic").raw(), 1089 1091 StorageBus_SCSI, 1090 1092 ctl.asOutParam())); … … 1094 1096 else if (!RTStrICmp(ValueUnion.psz, "off") || !RTStrICmp(ValueUnion.psz, "disable")) 1095 1097 { 1096 rc = machine->RemoveStorageController(Bstr("BusLogic").raw());1098 rc = sessionMachine->RemoveStorageController(Bstr("BusLogic").raw()); 1097 1099 if (FAILED(rc)) 1098 CHECK_ERROR( machine, RemoveStorageController(Bstr("LsiLogic").raw()));1100 CHECK_ERROR(sessionMachine, RemoveStorageController(Bstr("LsiLogic").raw())); 1099 1101 } 1100 1102 break; … … 1103 1105 case MODIFYVM_DVDPASSTHROUGH: // deprecated 1104 1106 { 1105 CHECK_ERROR( machine, PassthroughDevice(Bstr("IDE Controller").raw(),1107 CHECK_ERROR(sessionMachine, PassthroughDevice(Bstr("IDE Controller").raw(), 1106 1108 1, 0, 1107 1109 !RTStrICmp(ValueUnion.psz, "on"))); … … 1160 1162 } 1161 1163 1162 CHECK_ERROR( machine, MountMedium(Bstr("IDE Controller").raw(),1164 CHECK_ERROR(sessionMachine, MountMedium(Bstr("IDE Controller").raw(), 1163 1165 1, 0, 1164 1166 dvdMedium, … … 1171 1173 ComPtr<IMedium> floppyMedium; 1172 1174 ComPtr<IMediumAttachment> floppyAttachment; 1173 machine->GetMediumAttachment(Bstr("Floppy Controller").raw(),1175 sessionMachine->GetMediumAttachment(Bstr("Floppy Controller").raw(), 1174 1176 0, 0, floppyAttachment.asOutParam()); 1175 1177 … … 1179 1181 /* disable the controller */ 1180 1182 if (floppyAttachment) 1181 CHECK_ERROR( machine, DetachDevice(Bstr("Floppy Controller").raw(),1183 CHECK_ERROR(sessionMachine, DetachDevice(Bstr("Floppy Controller").raw(), 1182 1184 0, 0)); 1183 1185 } … … 1186 1188 /* enable the controller */ 1187 1189 if (!floppyAttachment) 1188 CHECK_ERROR( machine, AttachDeviceWithoutMedium(Bstr("Floppy Controller").raw(),1190 CHECK_ERROR(sessionMachine, AttachDeviceWithoutMedium(Bstr("Floppy Controller").raw(), 1189 1191 0, 0, 1190 1192 DeviceType_Floppy)); … … 1224 1226 } 1225 1227 } 1226 CHECK_ERROR( machine, MountMedium(Bstr("Floppy Controller").raw(),1228 CHECK_ERROR(sessionMachine, MountMedium(Bstr("Floppy Controller").raw(), 1227 1229 0, 0, 1228 1230 floppyMedium, … … 1239 1241 1240 1242 ComPtr<INetworkAdapter> nic; 1241 CHECK_ERROR_BREAK( machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1243 CHECK_ERROR_BREAK(sessionMachine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1242 1244 ASSERT(nic); 1243 1245 … … 1252 1254 1253 1255 ComPtr<INetworkAdapter> nic; 1254 CHECK_ERROR_BREAK( machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1256 CHECK_ERROR_BREAK(sessionMachine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1255 1257 ASSERT(nic); 1256 1258 … … 1265 1267 1266 1268 ComPtr<INetworkAdapter> nic; 1267 CHECK_ERROR_BREAK( machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1269 CHECK_ERROR_BREAK(sessionMachine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1268 1270 ASSERT(nic); 1269 1271 … … 1304 1306 1305 1307 ComPtr<INetworkAdapter> nic; 1306 CHECK_ERROR_BREAK( machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1308 CHECK_ERROR_BREAK(sessionMachine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1307 1309 ASSERT(nic); 1308 1310 … … 1349 1351 1350 1352 ComPtr<INetworkAdapter> nic; 1351 CHECK_ERROR_BREAK( machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1353 CHECK_ERROR_BREAK(sessionMachine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1352 1354 ASSERT(nic); 1353 1355 … … 1362 1364 1363 1365 ComPtr<INetworkAdapter> nic; 1364 CHECK_ERROR_BREAK( machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1366 CHECK_ERROR_BREAK(sessionMachine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1365 1367 ASSERT(nic); 1366 1368 … … 1402 1404 1403 1405 ComPtr<INetworkAdapter> nic; 1404 CHECK_ERROR_BREAK( machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1406 CHECK_ERROR_BREAK(sessionMachine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1405 1407 ASSERT(nic); 1406 1408 … … 1415 1417 1416 1418 ComPtr<INetworkAdapter> nic; 1417 CHECK_ERROR_BREAK( machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1419 CHECK_ERROR_BREAK(sessionMachine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1418 1420 ASSERT(nic); 1419 1421 … … 1428 1430 ComPtr<IBandwidthGroup> bwGroup; 1429 1431 1430 CHECK_ERROR( machine, COMGETTER(BandwidthControl)(bwCtrl.asOutParam()));1432 CHECK_ERROR(sessionMachine, COMGETTER(BandwidthControl)(bwCtrl.asOutParam())); 1431 1433 1432 1434 if (SUCCEEDED(rc)) … … 1448 1450 1449 1451 ComPtr<INetworkAdapter> nic; 1450 CHECK_ERROR_BREAK( machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1452 CHECK_ERROR_BREAK(sessionMachine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1451 1453 ASSERT(nic); 1452 1454 … … 1508 1510 1509 1511 ComPtr<INetworkAdapter> nic; 1510 CHECK_ERROR_BREAK( machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1512 CHECK_ERROR_BREAK(sessionMachine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1511 1513 ASSERT(nic); 1512 1514 … … 1521 1523 1522 1524 ComPtr<INetworkAdapter> nic; 1523 CHECK_ERROR_BREAK( machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1525 CHECK_ERROR_BREAK(sessionMachine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1524 1526 ASSERT(nic); 1525 1527 … … 1542 1544 1543 1545 ComPtr<INetworkAdapter> nic; 1544 CHECK_ERROR_BREAK( machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1546 CHECK_ERROR_BREAK(sessionMachine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1545 1547 ASSERT(nic); 1546 1548 … … 1563 1565 1564 1566 ComPtr<INetworkAdapter> nic; 1565 CHECK_ERROR_BREAK( machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1567 CHECK_ERROR_BREAK(sessionMachine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1566 1568 ASSERT(nic); 1567 1569 … … 1584 1586 1585 1587 ComPtr<INetworkAdapter> nic; 1586 CHECK_ERROR_BREAK( machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1588 CHECK_ERROR_BREAK(sessionMachine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1587 1589 ASSERT(nic); 1588 1590 … … 1597 1599 1598 1600 ComPtr<INetworkAdapter> nic; 1599 CHECK_ERROR_BREAK( machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1601 CHECK_ERROR_BREAK(sessionMachine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1600 1602 ASSERT(nic); 1601 1603 … … 1610 1612 1611 1613 ComPtr<INetworkAdapter> nic; 1612 CHECK_ERROR_BREAK( machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1614 CHECK_ERROR_BREAK(sessionMachine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1613 1615 ASSERT(nic); 1614 1616 … … 1630 1632 1631 1633 ComPtr<INetworkAdapter> nic; 1632 CHECK_ERROR_BREAK( machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1634 CHECK_ERROR_BREAK(sessionMachine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1633 1635 ASSERT(nic); 1634 1636 … … 1680 1682 break; 1681 1683 1682 CHECK_ERROR_BREAK( machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1684 CHECK_ERROR_BREAK(sessionMachine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1683 1685 ASSERT(nic); 1684 1686 … … 1696 1698 1697 1699 ComPtr<INetworkAdapter> nic; 1698 CHECK_ERROR_BREAK( machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1700 CHECK_ERROR_BREAK(sessionMachine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1699 1701 ASSERT(nic); 1700 1702 … … 1759 1761 uint32_t aliasMode = 0; 1760 1762 1761 CHECK_ERROR_BREAK( machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1763 CHECK_ERROR_BREAK(sessionMachine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1762 1764 ASSERT(nic); 1763 1765 … … 1792 1794 1793 1795 ComPtr<INetworkAdapter> nic; 1794 CHECK_ERROR_BREAK( machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1796 CHECK_ERROR_BREAK(sessionMachine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1795 1797 ASSERT(nic); 1796 1798 … … 1808 1810 1809 1811 ComPtr<INetworkAdapter> nic; 1810 CHECK_ERROR_BREAK( machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1812 CHECK_ERROR_BREAK(sessionMachine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1811 1813 ASSERT(nic); 1812 1814 … … 1824 1826 1825 1827 ComPtr<INetworkAdapter> nic; 1826 CHECK_ERROR_BREAK( machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1828 CHECK_ERROR_BREAK(sessionMachine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1827 1829 ASSERT(nic); 1828 1830 … … 1839 1841 1840 1842 ComPtr<INetworkAdapter> nic; 1841 CHECK_ERROR_BREAK( machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1843 CHECK_ERROR_BREAK(sessionMachine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1842 1844 ASSERT(nic); 1843 1845 … … 1855 1857 1856 1858 ComPtr<INetworkAdapter> nic; 1857 CHECK_ERROR_BREAK( machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1859 CHECK_ERROR_BREAK(sessionMachine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1858 1860 ASSERT(nic); 1859 1861 … … 1871 1873 1872 1874 ComPtr<INetworkAdapter> nic; 1873 CHECK_ERROR_BREAK( machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1875 CHECK_ERROR_BREAK(sessionMachine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1874 1876 ASSERT(nic); 1875 1877 … … 1886 1888 1887 1889 ComPtr<INetworkAdapter> nic; 1888 CHECK_ERROR_BREAK( machine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam()));1890 CHECK_ERROR_BREAK(sessionMachine, GetNetworkAdapter(GetOptState.uIndex - 1, nic.asOutParam())); 1889 1891 ASSERT(nic); 1890 1892 … … 1906 1908 if (!RTStrICmp(ValueUnion.psz, "ps2")) 1907 1909 { 1908 CHECK_ERROR( machine, COMSETTER(PointingHIDType)(PointingHIDType_PS2Mouse));1910 CHECK_ERROR(sessionMachine, COMSETTER(PointingHIDType)(PointingHIDType_PS2Mouse)); 1909 1911 } 1910 1912 else if (!RTStrICmp(ValueUnion.psz, "usb")) 1911 1913 { 1912 CHECK_ERROR( machine, COMSETTER(PointingHIDType)(PointingHIDType_USBMouse));1914 CHECK_ERROR(sessionMachine, COMSETTER(PointingHIDType)(PointingHIDType_USBMouse)); 1913 1915 if (SUCCEEDED(rc)) 1914 1916 fEnableUsb = true; … … 1916 1918 else if (!RTStrICmp(ValueUnion.psz, "usbtablet")) 1917 1919 { 1918 CHECK_ERROR( machine, COMSETTER(PointingHIDType)(PointingHIDType_USBTablet));1920 CHECK_ERROR(sessionMachine, COMSETTER(PointingHIDType)(PointingHIDType_USBTablet)); 1919 1921 if (SUCCEEDED(rc)) 1920 1922 fEnableUsb = true; … … 1922 1924 else if (!RTStrICmp(ValueUnion.psz, "usbmultitouch")) 1923 1925 { 1924 CHECK_ERROR( machine, COMSETTER(PointingHIDType)(PointingHIDType_USBMultiTouch));1926 CHECK_ERROR(sessionMachine, COMSETTER(PointingHIDType)(PointingHIDType_USBMultiTouch)); 1925 1927 if (SUCCEEDED(rc)) 1926 1928 fEnableUsb = true; … … 1935 1937 /* Make sure the OHCI controller is enabled. */ 1936 1938 ULONG cOhciCtrls = 0; 1937 rc = machine->GetUSBControllerCountByType(USBControllerType_OHCI, &cOhciCtrls);1939 rc = sessionMachine->GetUSBControllerCountByType(USBControllerType_OHCI, &cOhciCtrls); 1938 1940 if ( SUCCEEDED(rc) 1939 1941 && !cOhciCtrls) 1940 1942 { 1941 1943 ComPtr<IUSBController> UsbCtl; 1942 CHECK_ERROR( machine, AddUSBController(Bstr("OHCI").raw(), USBControllerType_OHCI,1944 CHECK_ERROR(sessionMachine, AddUSBController(Bstr("OHCI").raw(), USBControllerType_OHCI, 1943 1945 UsbCtl.asOutParam())); 1944 1946 } … … 1952 1954 if (!RTStrICmp(ValueUnion.psz, "ps2")) 1953 1955 { 1954 CHECK_ERROR( machine, COMSETTER(KeyboardHIDType)(KeyboardHIDType_PS2Keyboard));1956 CHECK_ERROR(sessionMachine, COMSETTER(KeyboardHIDType)(KeyboardHIDType_PS2Keyboard)); 1955 1957 } 1956 1958 else if (!RTStrICmp(ValueUnion.psz, "usb")) 1957 1959 { 1958 CHECK_ERROR( machine, COMSETTER(KeyboardHIDType)(KeyboardHIDType_USBKeyboard));1960 CHECK_ERROR(sessionMachine, COMSETTER(KeyboardHIDType)(KeyboardHIDType_USBKeyboard)); 1959 1961 if (SUCCEEDED(rc)) 1960 1962 fEnableUsb = true; … … 1969 1971 /* Make sure the OHCI controller is enabled. */ 1970 1972 ULONG cOhciCtrls = 0; 1971 rc = machine->GetUSBControllerCountByType(USBControllerType_OHCI, &cOhciCtrls);1973 rc = sessionMachine->GetUSBControllerCountByType(USBControllerType_OHCI, &cOhciCtrls); 1972 1974 if ( SUCCEEDED(rc) 1973 1975 && !cOhciCtrls) 1974 1976 { 1975 1977 ComPtr<IUSBController> UsbCtl; 1976 CHECK_ERROR( machine, AddUSBController(Bstr("OHCI").raw(), USBControllerType_OHCI,1978 CHECK_ERROR(sessionMachine, AddUSBController(Bstr("OHCI").raw(), USBControllerType_OHCI, 1977 1979 UsbCtl.asOutParam())); 1978 1980 } … … 1986 1988 char *pszIRQ = NULL; 1987 1989 1988 CHECK_ERROR_BREAK( machine, GetSerialPort(GetOptState.uIndex - 1, uart.asOutParam()));1990 CHECK_ERROR_BREAK(sessionMachine, GetSerialPort(GetOptState.uIndex - 1, uart.asOutParam())); 1989 1991 ASSERT(uart); 1990 1992 … … 2034 2036 ComPtr<ISerialPort> uart; 2035 2037 2036 CHECK_ERROR_BREAK( machine, GetSerialPort(GetOptState.uIndex - 1, uart.asOutParam()));2038 CHECK_ERROR_BREAK(sessionMachine, GetSerialPort(GetOptState.uIndex - 1, uart.asOutParam())); 2037 2039 ASSERT(uart); 2038 2040 … … 2068 2070 char *pszIRQ = NULL; 2069 2071 2070 CHECK_ERROR_BREAK( machine, GetParallelPort(GetOptState.uIndex - 1, lpt.asOutParam()));2072 CHECK_ERROR_BREAK(sessionMachine, GetParallelPort(GetOptState.uIndex - 1, lpt.asOutParam())); 2071 2073 ASSERT(lpt); 2072 2074 … … 2079 2081 ComPtr<IParallelPort> lpt; 2080 2082 2081 CHECK_ERROR_BREAK( machine, GetParallelPort(GetOptState.uIndex - 1, lpt.asOutParam()));2083 CHECK_ERROR_BREAK(sessionMachine, GetParallelPort(GetOptState.uIndex - 1, lpt.asOutParam())); 2082 2084 ASSERT(lpt); 2083 2085 … … 2110 2112 case MODIFYVM_GUESTMEMORYBALLOON: 2111 2113 { 2112 CHECK_ERROR( machine, COMSETTER(MemoryBalloonSize)(ValueUnion.u32));2114 CHECK_ERROR(sessionMachine, COMSETTER(MemoryBalloonSize)(ValueUnion.u32)); 2113 2115 break; 2114 2116 } … … 2117 2119 { 2118 2120 ComPtr<IAudioAdapter> audioAdapter; 2119 machine->COMGETTER(AudioAdapter)(audioAdapter.asOutParam());2121 sessionMachine->COMGETTER(AudioAdapter)(audioAdapter.asOutParam()); 2120 2122 ASSERT(audioAdapter); 2121 2123 … … 2137 2139 { 2138 2140 ComPtr<IAudioAdapter> audioAdapter; 2139 machine->COMGETTER(AudioAdapter)(audioAdapter.asOutParam());2141 sessionMachine->COMGETTER(AudioAdapter)(audioAdapter.asOutParam()); 2140 2142 ASSERT(audioAdapter); 2141 2143 … … 2242 2244 if (SUCCEEDED(rc)) 2243 2245 { 2244 CHECK_ERROR( machine, COMSETTER(ClipboardMode)(mode));2246 CHECK_ERROR(sessionMachine, COMSETTER(ClipboardMode)(mode)); 2245 2247 } 2246 2248 break; … … 2265 2267 if (SUCCEEDED(rc)) 2266 2268 { 2267 CHECK_ERROR( machine, COMSETTER(DnDMode)(mode));2269 CHECK_ERROR(sessionMachine, COMSETTER(DnDMode)(mode)); 2268 2270 } 2269 2271 break; … … 2273 2275 { 2274 2276 ComPtr<IVRDEServer> vrdeServer; 2275 machine->COMGETTER(VRDEServer)(vrdeServer.asOutParam());2277 sessionMachine->COMGETTER(VRDEServer)(vrdeServer.asOutParam()); 2276 2278 ASSERT(vrdeServer); 2277 2279 … … 2292 2294 { 2293 2295 ComPtr<IVRDEServer> vrdeServer; 2294 machine->COMGETTER(VRDEServer)(vrdeServer.asOutParam());2296 sessionMachine->COMGETTER(VRDEServer)(vrdeServer.asOutParam()); 2295 2297 ASSERT(vrdeServer); 2296 2298 … … 2335 2337 { 2336 2338 ComPtr<IVRDEServer> vrdeServer; 2337 machine->COMGETTER(VRDEServer)(vrdeServer.asOutParam());2339 sessionMachine->COMGETTER(VRDEServer)(vrdeServer.asOutParam()); 2338 2340 ASSERT(vrdeServer); 2339 2341 … … 2351 2353 { 2352 2354 ComPtr<IVRDEServer> vrdeServer; 2353 machine->COMGETTER(VRDEServer)(vrdeServer.asOutParam());2355 sessionMachine->COMGETTER(VRDEServer)(vrdeServer.asOutParam()); 2354 2356 ASSERT(vrdeServer); 2355 2357 … … 2363 2365 { 2364 2366 ComPtr<IVRDEServer> vrdeServer; 2365 machine->COMGETTER(VRDEServer)(vrdeServer.asOutParam());2367 sessionMachine->COMGETTER(VRDEServer)(vrdeServer.asOutParam()); 2366 2368 ASSERT(vrdeServer); 2367 2369 … … 2389 2391 { 2390 2392 ComPtr<IVRDEServer> vrdeServer; 2391 machine->COMGETTER(VRDEServer)(vrdeServer.asOutParam());2393 sessionMachine->COMGETTER(VRDEServer)(vrdeServer.asOutParam()); 2392 2394 ASSERT(vrdeServer); 2393 2395 … … 2410 2412 { 2411 2413 ComPtr<IVRDEServer> vrdeServer; 2412 machine->COMGETTER(VRDEServer)(vrdeServer.asOutParam());2414 sessionMachine->COMGETTER(VRDEServer)(vrdeServer.asOutParam()); 2413 2415 ASSERT(vrdeServer); 2414 2416 … … 2422 2424 { 2423 2425 ComPtr<IVRDEServer> vrdeServer; 2424 machine->COMGETTER(VRDEServer)(vrdeServer.asOutParam());2426 sessionMachine->COMGETTER(VRDEServer)(vrdeServer.asOutParam()); 2425 2427 ASSERT(vrdeServer); 2426 2428 … … 2434 2436 { 2435 2437 ComPtr<IVRDEServer> vrdeServer; 2436 machine->COMGETTER(VRDEServer)(vrdeServer.asOutParam());2438 sessionMachine->COMGETTER(VRDEServer)(vrdeServer.asOutParam()); 2437 2439 ASSERT(vrdeServer); 2438 2440 … … 2447 2449 { 2448 2450 ComPtr<IVRDEServer> vrdeServer; 2449 machine->COMGETTER(VRDEServer)(vrdeServer.asOutParam());2451 sessionMachine->COMGETTER(VRDEServer)(vrdeServer.asOutParam()); 2450 2452 ASSERT(vrdeServer); 2451 2453 … … 2460 2462 { 2461 2463 ComPtr<IVRDEServer> vrdeServer; 2462 machine->COMGETTER(VRDEServer)(vrdeServer.asOutParam());2464 sessionMachine->COMGETTER(VRDEServer)(vrdeServer.asOutParam()); 2463 2465 ASSERT(vrdeServer); 2464 2466 … … 2470 2472 { 2471 2473 ULONG cXhciCtrls = 0; 2472 rc = machine->GetUSBControllerCountByType(USBControllerType_XHCI, &cXhciCtrls);2474 rc = sessionMachine->GetUSBControllerCountByType(USBControllerType_XHCI, &cXhciCtrls); 2473 2475 if (SUCCEEDED(rc)) 2474 2476 { … … 2476 2478 { 2477 2479 ComPtr<IUSBController> UsbCtl; 2478 CHECK_ERROR( machine, AddUSBController(Bstr("XHCI").raw(), USBControllerType_XHCI,2480 CHECK_ERROR(sessionMachine, AddUSBController(Bstr("XHCI").raw(), USBControllerType_XHCI, 2479 2481 UsbCtl.asOutParam())); 2480 2482 } 2481 2483 else if (cXhciCtrls && !ValueUnion.f) 2482 CHECK_ERROR( machine, RemoveUSBController(Bstr("XHCI").raw()));2484 CHECK_ERROR(sessionMachine, RemoveUSBController(Bstr("XHCI").raw())); 2483 2485 } 2484 2486 break; … … 2488 2490 { 2489 2491 ULONG cEhciCtrls = 0; 2490 rc = machine->GetUSBControllerCountByType(USBControllerType_EHCI, &cEhciCtrls);2492 rc = sessionMachine->GetUSBControllerCountByType(USBControllerType_EHCI, &cEhciCtrls); 2491 2493 if (SUCCEEDED(rc)) 2492 2494 { … … 2494 2496 { 2495 2497 ComPtr<IUSBController> UsbCtl; 2496 CHECK_ERROR( machine, AddUSBController(Bstr("EHCI").raw(), USBControllerType_EHCI,2498 CHECK_ERROR(sessionMachine, AddUSBController(Bstr("EHCI").raw(), USBControllerType_EHCI, 2497 2499 UsbCtl.asOutParam())); 2498 2500 } 2499 2501 else if (cEhciCtrls && !ValueUnion.f) 2500 CHECK_ERROR( machine, RemoveUSBController(Bstr("EHCI").raw()));2502 CHECK_ERROR(sessionMachine, RemoveUSBController(Bstr("EHCI").raw())); 2501 2503 } 2502 2504 break; … … 2506 2508 { 2507 2509 ULONG cOhciCtrls = 0; 2508 rc = machine->GetUSBControllerCountByType(USBControllerType_OHCI, &cOhciCtrls);2510 rc = sessionMachine->GetUSBControllerCountByType(USBControllerType_OHCI, &cOhciCtrls); 2509 2511 if (SUCCEEDED(rc)) 2510 2512 { … … 2512 2514 { 2513 2515 ComPtr<IUSBController> UsbCtl; 2514 CHECK_ERROR( machine, AddUSBController(Bstr("OHCI").raw(), USBControllerType_OHCI,2516 CHECK_ERROR(sessionMachine, AddUSBController(Bstr("OHCI").raw(), USBControllerType_OHCI, 2515 2517 UsbCtl.asOutParam())); 2516 2518 } 2517 2519 else if (cOhciCtrls && !ValueUnion.f) 2518 CHECK_ERROR( machine, RemoveUSBController(Bstr("OHCI").raw()));2520 CHECK_ERROR(sessionMachine, RemoveUSBController(Bstr("OHCI").raw())); 2519 2521 } 2520 2522 break; … … 2524 2526 { 2525 2527 if (!RTStrICmp(ValueUnion.psz, "default")) 2526 CHECK_ERROR( machine, COMSETTER(SnapshotFolder)(Bstr().raw()));2527 else 2528 CHECK_ERROR( machine, COMSETTER(SnapshotFolder)(Bstr(ValueUnion.psz).raw()));2528 CHECK_ERROR(sessionMachine, COMSETTER(SnapshotFolder)(Bstr().raw())); 2529 else 2530 CHECK_ERROR(sessionMachine, COMSETTER(SnapshotFolder)(Bstr(ValueUnion.psz).raw())); 2529 2531 break; 2530 2532 } … … 2532 2534 case MODIFYVM_TELEPORTER_ENABLED: 2533 2535 { 2534 CHECK_ERROR( machine, COMSETTER(TeleporterEnabled)(ValueUnion.f));2536 CHECK_ERROR(sessionMachine, COMSETTER(TeleporterEnabled)(ValueUnion.f)); 2535 2537 break; 2536 2538 } … … 2538 2540 case MODIFYVM_TELEPORTER_PORT: 2539 2541 { 2540 CHECK_ERROR( machine, COMSETTER(TeleporterPort)(ValueUnion.u32));2542 CHECK_ERROR(sessionMachine, COMSETTER(TeleporterPort)(ValueUnion.u32)); 2541 2543 break; 2542 2544 } … … 2544 2546 case MODIFYVM_TELEPORTER_ADDRESS: 2545 2547 { 2546 CHECK_ERROR( machine, COMSETTER(TeleporterAddress)(Bstr(ValueUnion.psz).raw()));2548 CHECK_ERROR(sessionMachine, COMSETTER(TeleporterAddress)(Bstr(ValueUnion.psz).raw())); 2547 2549 break; 2548 2550 } … … 2550 2552 case MODIFYVM_TELEPORTER_PASSWORD: 2551 2553 { 2552 CHECK_ERROR( machine, COMSETTER(TeleporterPassword)(Bstr(ValueUnion.psz).raw()));2554 CHECK_ERROR(sessionMachine, COMSETTER(TeleporterPassword)(Bstr(ValueUnion.psz).raw())); 2553 2555 break; 2554 2556 } … … 2561 2563 rc = E_FAIL; 2562 2564 else 2563 CHECK_ERROR( machine, COMSETTER(TeleporterPassword)(Bstr(password).raw()));2565 CHECK_ERROR(sessionMachine, COMSETTER(TeleporterPassword)(Bstr(password).raw())); 2564 2566 break; 2565 2567 } … … 2567 2569 case MODIFYVM_TRACING_ENABLED: 2568 2570 { 2569 CHECK_ERROR( machine, COMSETTER(TracingEnabled)(ValueUnion.f));2571 CHECK_ERROR(sessionMachine, COMSETTER(TracingEnabled)(ValueUnion.f)); 2570 2572 break; 2571 2573 } … … 2573 2575 case MODIFYVM_TRACING_CONFIG: 2574 2576 { 2575 CHECK_ERROR( machine, COMSETTER(TracingConfig)(Bstr(ValueUnion.psz).raw()));2577 CHECK_ERROR(sessionMachine, COMSETTER(TracingConfig)(Bstr(ValueUnion.psz).raw())); 2576 2578 break; 2577 2579 } … … 2579 2581 case MODIFYVM_TRACING_ALLOW_VM_ACCESS: 2580 2582 { 2581 CHECK_ERROR( machine, COMSETTER(AllowTracingToAccessVM)(ValueUnion.f));2583 CHECK_ERROR(sessionMachine, COMSETTER(AllowTracingToAccessVM)(ValueUnion.f)); 2582 2584 break; 2583 2585 } … … 2587 2589 if (!RTStrICmp(ValueUnion.psz, "master")) 2588 2590 { 2589 CHECK_ERROR( machine, COMSETTER(FaultToleranceState(FaultToleranceState_Master)));2591 CHECK_ERROR(sessionMachine, COMSETTER(FaultToleranceState(FaultToleranceState_Master))); 2590 2592 } 2591 2593 else 2592 2594 if (!RTStrICmp(ValueUnion.psz, "standby")) 2593 2595 { 2594 CHECK_ERROR( machine, COMSETTER(FaultToleranceState(FaultToleranceState_Standby)));2596 CHECK_ERROR(sessionMachine, COMSETTER(FaultToleranceState(FaultToleranceState_Standby))); 2595 2597 } 2596 2598 else … … 2604 2606 case MODIFYVM_FAULT_TOLERANCE_ADDRESS: 2605 2607 { 2606 CHECK_ERROR( machine, COMSETTER(FaultToleranceAddress)(Bstr(ValueUnion.psz).raw()));2608 CHECK_ERROR(sessionMachine, COMSETTER(FaultToleranceAddress)(Bstr(ValueUnion.psz).raw())); 2607 2609 break; 2608 2610 } … … 2610 2612 case MODIFYVM_FAULT_TOLERANCE_PORT: 2611 2613 { 2612 CHECK_ERROR( machine, COMSETTER(FaultTolerancePort)(ValueUnion.u32));2614 CHECK_ERROR(sessionMachine, COMSETTER(FaultTolerancePort)(ValueUnion.u32)); 2613 2615 break; 2614 2616 } … … 2616 2618 case MODIFYVM_FAULT_TOLERANCE_PASSWORD: 2617 2619 { 2618 CHECK_ERROR( machine, COMSETTER(FaultTolerancePassword)(Bstr(ValueUnion.psz).raw()));2620 CHECK_ERROR(sessionMachine, COMSETTER(FaultTolerancePassword)(Bstr(ValueUnion.psz).raw())); 2619 2621 break; 2620 2622 } … … 2622 2624 case MODIFYVM_FAULT_TOLERANCE_SYNC_INTERVAL: 2623 2625 { 2624 CHECK_ERROR( machine, COMSETTER(FaultToleranceSyncInterval)(ValueUnion.u32));2626 CHECK_ERROR(sessionMachine, COMSETTER(FaultToleranceSyncInterval)(ValueUnion.u32)); 2625 2627 break; 2626 2628 } … … 2628 2630 case MODIFYVM_HARDWARE_UUID: 2629 2631 { 2630 CHECK_ERROR( machine, COMSETTER(HardwareUUID)(Bstr(ValueUnion.psz).raw()));2632 CHECK_ERROR(sessionMachine, COMSETTER(HardwareUUID)(Bstr(ValueUnion.psz).raw())); 2631 2633 break; 2632 2634 } … … 2634 2636 case MODIFYVM_HPET: 2635 2637 { 2636 CHECK_ERROR( machine, COMSETTER(HPETEnabled)(ValueUnion.f));2638 CHECK_ERROR(sessionMachine, COMSETTER(HPETEnabled)(ValueUnion.f)); 2637 2639 break; 2638 2640 } … … 2640 2642 case MODIFYVM_IOCACHE: 2641 2643 { 2642 CHECK_ERROR( machine, COMSETTER(IOCacheEnabled)(ValueUnion.f));2644 CHECK_ERROR(sessionMachine, COMSETTER(IOCacheEnabled)(ValueUnion.f)); 2643 2645 break; 2644 2646 } … … 2646 2648 case MODIFYVM_IOCACHESIZE: 2647 2649 { 2648 CHECK_ERROR( machine, COMSETTER(IOCacheSize)(ValueUnion.u32));2650 CHECK_ERROR(sessionMachine, COMSETTER(IOCacheSize)(ValueUnion.u32)); 2649 2651 break; 2650 2652 } … … 2654 2656 if (!RTStrICmp(ValueUnion.psz, "piix3")) 2655 2657 { 2656 CHECK_ERROR( machine, COMSETTER(ChipsetType)(ChipsetType_PIIX3));2658 CHECK_ERROR(sessionMachine, COMSETTER(ChipsetType)(ChipsetType_PIIX3)); 2657 2659 } 2658 2660 else if (!RTStrICmp(ValueUnion.psz, "ich9")) 2659 2661 { 2660 CHECK_ERROR( machine, COMSETTER(ChipsetType)(ChipsetType_ICH9));2662 CHECK_ERROR(sessionMachine, COMSETTER(ChipsetType)(ChipsetType_ICH9)); 2661 2663 BOOL fIoApic = FALSE; 2662 2664 CHECK_ERROR(biosSettings, COMGETTER(IOAPICEnabled)(&fIoApic)); … … 2677 2679 case MODIFYVM_VCP: 2678 2680 { 2679 CHECK_ERROR( machine, COMSETTER(VideoCaptureEnabled)(ValueUnion.f));2681 CHECK_ERROR(sessionMachine, COMSETTER(VideoCaptureEnabled)(ValueUnion.f)); 2680 2682 break; 2681 2683 } … … 2683 2685 { 2684 2686 ULONG cMonitors = 64; 2685 CHECK_ERROR( machine, COMGETTER(MonitorCount)(&cMonitors));2687 CHECK_ERROR(sessionMachine, COMGETTER(MonitorCount)(&cMonitors)); 2686 2688 com::SafeArray<BOOL> screens(cMonitors); 2687 2689 if (parseScreens(ValueUnion.psz, &screens)) … … 2691 2693 break; 2692 2694 } 2693 CHECK_ERROR( machine, COMSETTER(VideoCaptureScreens)(ComSafeArrayAsInParam(screens)));2695 CHECK_ERROR(sessionMachine, COMSETTER(VideoCaptureScreens)(ComSafeArrayAsInParam(screens))); 2694 2696 break; 2695 2697 } … … 2710 2712 bstr = szVCFileAbs; 2711 2713 } 2712 CHECK_ERROR( machine, COMSETTER(VideoCaptureFile)(bstr.raw()));2714 CHECK_ERROR(sessionMachine, COMSETTER(VideoCaptureFile)(bstr.raw())); 2713 2715 break; 2714 2716 } 2715 2717 case MODIFYVM_VCP_WIDTH: 2716 2718 { 2717 CHECK_ERROR( machine, COMSETTER(VideoCaptureWidth)(ValueUnion.u32));2719 CHECK_ERROR(sessionMachine, COMSETTER(VideoCaptureWidth)(ValueUnion.u32)); 2718 2720 break; 2719 2721 } 2720 2722 case MODIFYVM_VCP_HEIGHT: 2721 2723 { 2722 CHECK_ERROR( machine, COMSETTER(VideoCaptureHeight)(ValueUnion.u32));2724 CHECK_ERROR(sessionMachine, COMSETTER(VideoCaptureHeight)(ValueUnion.u32)); 2723 2725 break; 2724 2726 } 2725 2727 case MODIFYVM_VCP_RATE: 2726 2728 { 2727 CHECK_ERROR( machine, COMSETTER(VideoCaptureRate)(ValueUnion.u32));2729 CHECK_ERROR(sessionMachine, COMSETTER(VideoCaptureRate)(ValueUnion.u32)); 2728 2730 break; 2729 2731 } 2730 2732 case MODIFYVM_VCP_FPS: 2731 2733 { 2732 CHECK_ERROR( machine, COMSETTER(VideoCaptureFPS)(ValueUnion.u32));2734 CHECK_ERROR(sessionMachine, COMSETTER(VideoCaptureFPS)(ValueUnion.u32)); 2733 2735 break; 2734 2736 } 2735 2737 case MODIFYVM_VCP_MAXTIME: 2736 2738 { 2737 CHECK_ERROR( machine, COMSETTER(VideoCaptureMaxTime)(ValueUnion.u32));2739 CHECK_ERROR(sessionMachine, COMSETTER(VideoCaptureMaxTime)(ValueUnion.u32)); 2738 2740 break; 2739 2741 } 2740 2742 case MODIFYVM_VCP_MAXSIZE: 2741 2743 { 2742 CHECK_ERROR( machine, COMSETTER(VideoCaptureMaxFileSize)(ValueUnion.u32));2744 CHECK_ERROR(sessionMachine, COMSETTER(VideoCaptureMaxFileSize)(ValueUnion.u32)); 2743 2745 break; 2744 2746 } … … 2746 2748 { 2747 2749 Bstr bstr(ValueUnion.psz); 2748 CHECK_ERROR( machine, COMSETTER(VideoCaptureOptions)(bstr.raw()));2750 CHECK_ERROR(sessionMachine, COMSETTER(VideoCaptureOptions)(bstr.raw())); 2749 2751 break; 2750 2752 } … … 2752 2754 case MODIFYVM_AUTOSTART_ENABLED: 2753 2755 { 2754 CHECK_ERROR( machine, COMSETTER(AutostartEnabled)(ValueUnion.f));2756 CHECK_ERROR(sessionMachine, COMSETTER(AutostartEnabled)(ValueUnion.f)); 2755 2757 break; 2756 2758 } … … 2758 2760 case MODIFYVM_AUTOSTART_DELAY: 2759 2761 { 2760 CHECK_ERROR( machine, COMSETTER(AutostartDelay)(ValueUnion.u32));2762 CHECK_ERROR(sessionMachine, COMSETTER(AutostartDelay)(ValueUnion.u32)); 2761 2763 break; 2762 2764 } … … 2781 2783 2782 2784 if (SUCCEEDED(rc)) 2783 CHECK_ERROR( machine, COMSETTER(AutostopType)(enmAutostopType));2785 CHECK_ERROR(sessionMachine, COMSETTER(AutostopType)(enmAutostopType)); 2784 2786 break; 2785 2787 } … … 2800 2802 else 2801 2803 { 2802 CHECK_ERROR( machine, AttachHostPCIDevice(iHostAddr, iGuestAddr, TRUE));2804 CHECK_ERROR(sessionMachine, AttachHostPCIDevice(iHostAddr, iGuestAddr, TRUE)); 2803 2805 } 2804 2806 … … 2817 2819 else 2818 2820 { 2819 CHECK_ERROR( machine, DetachHostPCIDevice(iHostAddr));2821 CHECK_ERROR(sessionMachine, DetachHostPCIDevice(iHostAddr)); 2820 2822 } 2821 2823 … … 2827 2829 case MODIFYVM_USBCARDREADER: 2828 2830 { 2829 CHECK_ERROR( machine, COMSETTER(EmulatedUSBCardReaderEnabled)(ValueUnion.f));2831 CHECK_ERROR(sessionMachine, COMSETTER(EmulatedUSBCardReaderEnabled)(ValueUnion.f)); 2830 2832 break; 2831 2833 } … … 2837 2839 if (bstr == "default") 2838 2840 bstr = Bstr::Empty; 2839 CHECK_ERROR( machine, COMSETTER(DefaultFrontend)(bstr.raw()));2841 CHECK_ERROR(sessionMachine, COMSETTER(DefaultFrontend)(bstr.raw())); 2840 2842 break; 2841 2843 } … … 2852 2854 /* commit changes */ 2853 2855 if (SUCCEEDED(rc)) 2854 CHECK_ERROR( machine, SaveSettings());2856 CHECK_ERROR(sessionMachine, SaveSettings()); 2855 2857 2856 2858 /* it's important to always close sessions */ -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageSnapshot.cpp
r55214 r55234 198 198 { 199 199 ComPtr<ISnapshot> pCurrentSnapshot; 200 CHECK_ERROR2_RET(pMachine, COMGETTER(CurrentSnapshot)(pCurrentSnapshot.asOutParam()), RTEXITCODE_FAILURE);200 CHECK_ERROR2_RET(pMachine, COMGETTER(CurrentSnapshot)(pCurrentSnapshot.asOutParam()), RTEXITCODE_FAILURE); 201 201 hrc = showSnapshots(pSnapshot, pCurrentSnapshot, enmDetails); 202 202 if (FAILED(hrc)) … … 286 286 { 287 287 /* replace the (read-only) IMachine object by a writable one */ 288 CHECK_ERROR_BREAK(a->session, COMGETTER(Machine)(pMachine.asOutParam())); 288 ComPtr<IMachine> sessionMachine; 289 CHECK_ERROR_BREAK(a->session, COMGETTER(Machine)(sessionMachine.asOutParam())); 289 290 290 291 /* switch based on the command */ … … 347 348 348 349 ComPtr<IProgress> progress; 349 CHECK_ERROR_BREAK( pMachine, TakeSnapshot(name.raw(), desc.raw(),350 fPause,351 progress.asOutParam()));350 CHECK_ERROR_BREAK(sessionMachine, TakeSnapshot(name.raw(), desc.raw(), 351 fPause, 352 progress.asOutParam())); 352 353 353 354 rc = showProgress(progress); … … 382 383 if (fRestoreCurrent) 383 384 { 384 CHECK_ERROR_BREAK( pMachine, COMGETTER(CurrentSnapshot)(pSnapshot.asOutParam()));385 CHECK_ERROR_BREAK(sessionMachine, COMGETTER(CurrentSnapshot)(pSnapshot.asOutParam())); 385 386 } 386 387 else 387 388 { 388 389 // restore or delete snapshot: then resolve cmd line argument to snapshot instance 389 CHECK_ERROR_BREAK( pMachine, FindSnapshot(Bstr(a->argv[2]).raw(),390 CHECK_ERROR_BREAK(sessionMachine, FindSnapshot(Bstr(a->argv[2]).raw(), 390 391 pSnapshot.asOutParam())); 391 392 } … … 395 396 if (fDelete) 396 397 { 397 CHECK_ERROR_BREAK( pMachine, DeleteSnapshot(bstrSnapGuid.raw(),398 CHECK_ERROR_BREAK(sessionMachine, DeleteSnapshot(bstrSnapGuid.raw(), 398 399 pProgress.asOutParam())); 399 400 } … … 402 403 // restore or restore current 403 404 RTPrintf("Restoring snapshot %ls\n", bstrSnapGuid.raw()); 404 CHECK_ERROR_BREAK( pMachine, RestoreSnapshot(pSnapshot, pProgress.asOutParam()));405 CHECK_ERROR_BREAK(sessionMachine, RestoreSnapshot(pSnapshot, pProgress.asOutParam())); 405 406 } 406 407 … … 422 423 || !strcmp(a->argv[2], "-current")) 423 424 { 424 CHECK_ERROR_BREAK( pMachine, COMGETTER(CurrentSnapshot)(pSnapshot.asOutParam()));425 CHECK_ERROR_BREAK(sessionMachine, COMGETTER(CurrentSnapshot)(pSnapshot.asOutParam())); 425 426 } 426 427 else 427 428 { 428 CHECK_ERROR_BREAK( pMachine, FindSnapshot(Bstr(a->argv[2]).raw(),429 CHECK_ERROR_BREAK(sessionMachine, FindSnapshot(Bstr(a->argv[2]).raw(), 429 430 pSnapshot.asOutParam())); 430 431 } … … 480 481 ComPtr<ISnapshot> pSnapshot; 481 482 482 CHECK_ERROR_BREAK( pMachine, FindSnapshot(Bstr(a->argv[2]).raw(),483 pSnapshot.asOutParam()));483 CHECK_ERROR_BREAK(sessionMachine, FindSnapshot(Bstr(a->argv[2]).raw(), 484 pSnapshot.asOutParam())); 484 485 485 486 /* get the machine of the given snapshot */ … … 489 490 } 490 491 else if (!strcmp(a->argv[1], "list")) 491 rc = handleSnapshotList(a, pMachine) == RTEXITCODE_SUCCESS ? S_OK : E_FAIL;492 rc = handleSnapshotList(a, sessionMachine) == RTEXITCODE_SUCCESS ? S_OK : E_FAIL; 492 493 else if (!strcmp(a->argv[1], "dump")) // undocumented parameter to debug snapshot info 493 DumpSnapshot( pMachine);494 DumpSnapshot(sessionMachine); 494 495 else 495 496 {
Note:
See TracChangeset
for help on using the changeset viewer.