Changeset 106384 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Oct 16, 2024 1:58:41 PM (4 months ago)
- svn:sync-xref-src-repo-rev:
- 165197
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r106061 r106384 250 250 MODIFYVM_GUEST_DEBUG_ADDRESS, 251 251 MODIFYVM_GUEST_DEBUG_PORT, 252 253 /* 254 * Stuff common between x86 and ARM. 255 */ 256 MODIFYVM_NESTED_HW_VIRT, 257 252 258 /* 253 259 * x86-specific stuff. … … 267 273 MODIFYVM_X86_MDS_CLEAR_ON_SCHED, 268 274 MODIFYVM_X86_MDS_CLEAR_ON_VM_ENTRY, 269 MODIFYVM_X86_NESTED_HW_VIRT,270 275 MODIFYVM_X86_NESTEDPAGING, 271 276 MODIFYVM_X86_PAE, … … 516 521 OPT1("--x86-mds-clear-on-vm-entry", MODIFYVM_X86_MDS_CLEAR_ON_VM_ENTRY, RTGETOPT_REQ_BOOL_ONOFF), 517 522 OPT1("--mds-clear-on-vm-entry", MODIFYVM_X86_MDS_CLEAR_ON_VM_ENTRY, RTGETOPT_REQ_BOOL_ONOFF), 518 OPT1("--x86-nested-hw-virt", MODIFYVM_ X86_NESTED_HW_VIRT,RTGETOPT_REQ_BOOL_ONOFF),519 OPT1("--nested-hw-virt", MODIFYVM_ X86_NESTED_HW_VIRT,RTGETOPT_REQ_BOOL_ONOFF),523 OPT1("--x86-nested-hw-virt", MODIFYVM_NESTED_HW_VIRT, RTGETOPT_REQ_BOOL_ONOFF), 524 OPT1("--nested-hw-virt", MODIFYVM_NESTED_HW_VIRT, RTGETOPT_REQ_BOOL_ONOFF), 520 525 OPT1("--x86-nested-paging", MODIFYVM_X86_NESTEDPAGING, RTGETOPT_REQ_BOOL_ONOFF), 521 526 OPT2("--nested-paging", "--nestedpaging", MODIFYVM_X86_NESTEDPAGING, RTGETOPT_REQ_BOOL_ONOFF), … … 792 797 break; 793 798 794 case MODIFYVM_ X86_NESTED_HW_VIRT:799 case MODIFYVM_NESTED_HW_VIRT: 795 800 CHECK_ERROR(platformX86, SetCPUProperty(CPUPropertyTypeX86_HWVirt, pValueUnion->f)); 796 801 break; … … 825 830 } 826 831 832 /** 833 * Handles the x86-specific modifyvm options. 834 * 835 * @returns HRESULT 836 * @retval E_INVALIDARG if handed-in option was not being handled. 837 * @param pGetOptState Pointer to GetOpt state to use. 838 * @param c Current GetOpt value (short form). 839 * @param pValueUnion Pointer to current value union. 840 * @param sessionMachine Session machine to use. 841 * @param platformARM ARM-specific platform object to use. 842 */ 843 static HRESULT handleModifyVM_ARM(PRTGETOPTSTATE pGetOptState, int c, PRTGETOPTUNION pValueUnion, 844 ComPtr<IMachine> &sessionMachine, ComPtr<IPlatformARM> &platformARM) 845 { 846 RT_NOREF(pGetOptState, sessionMachine); 847 848 HRESULT hrc = S_OK; 849 850 switch (c) 851 { 852 case MODIFYVM_NESTED_HW_VIRT: 853 CHECK_ERROR(platformARM, SetCPUProperty(CPUPropertyTypeARM_HWVirt, pValueUnion->f)); 854 break; 855 856 default: 857 hrc = E_INVALIDARG; 858 break; 859 } 860 861 return hrc; 862 } 863 827 864 RTEXITCODE handleModifyVM(HandlerArg *a) 828 865 { … … 857 894 ComPtr<IPlatform> platform; 858 895 CHECK_ERROR_RET(sessionMachine, COMGETTER(Platform)(platform.asOutParam()), RTEXITCODE_FAILURE); 859 860 /* For the x86-based options we need the x86-specific platform object. */861 ComPtr<IPlatformX86> platformX86;862 platform->COMGETTER(X86)(platformX86.asOutParam());863 896 864 897 ComPtr<IGraphicsAdapter> pGraphicsAdapter; … … 3739 3772 default: 3740 3773 { 3741 hrc = handleModifyVM_x86(&GetOptState, c, &ValueUnion, sessionMachine, platformX86); 3774 PlatformArchitecture_T enmArch; 3775 CHECK_ERROR_RET(platform, COMGETTER(Architecture)(&enmArch), RTEXITCODE_FAILURE); 3776 3777 if (enmArch == PlatformArchitecture_x86) 3778 { 3779 /* For the x86-based options we need the x86-specific platform object. */ 3780 ComPtr<IPlatformX86> platformX86; 3781 CHECK_ERROR_RET(platform, COMGETTER(X86)(platformX86.asOutParam()), RTEXITCODE_FAILURE); 3782 3783 hrc = handleModifyVM_x86(&GetOptState, c, &ValueUnion, sessionMachine, platformX86); 3784 } 3785 else if (enmArch == PlatformArchitecture_ARM) 3786 { 3787 /* For the ARM-based options we need the x86-specific platform object. */ 3788 ComPtr<IPlatformARM> platformARM; 3789 CHECK_ERROR_RET(platform, COMGETTER(ARM)(platformARM.asOutParam()), RTEXITCODE_FAILURE); 3790 3791 hrc = handleModifyVM_ARM(&GetOptState, c, &ValueUnion, sessionMachine, platformARM); 3792 } 3793 else 3794 { 3795 errorArgument(ModifyVM::tr("Invalid platform architecture returned for VM")); 3796 hrc = E_FAIL; 3797 } 3798 3742 3799 if (FAILED(hrc)) 3743 3800 errorGetOpt(c, &ValueUnion);
Note:
See TracChangeset
for help on using the changeset viewer.