Changeset 60410 in vbox
- Timestamp:
- Apr 10, 2016 3:42:46 PM (9 years ago)
- svn:sync-xref-src-repo-rev:
- 106496
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/settings.h
r60107 r60410 940 940 uint32_t ulCpuExecutionCap; // requires settings version 1.11 (VirtualBox 3.3) 941 941 uint32_t uCpuIdPortabilityLevel; // requires settings version 1.15 (VirtualBox 5.0) 942 com::Utf8Str strCpuProfile; // requires settings version 1.16 (VirtualBox 5.1) 942 943 943 944 CpuIdLeafsList llCpuIdLeafs; -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
r59269 r60410 36 36 37 37 #include <VBox/log.h> 38 #include <VBox/version.h> 38 39 #include <iprt/stream.h> 39 40 #include <iprt/time.h> … … 445 446 } while (0) 446 447 448 /** @def SHOW_STRING_PROP_MAJ 449 * For not breaking the output in a dot release we don't show default values. */ 450 #define SHOW_STRING_PROP_MAJ(a_pObj, a_Prop, a_szMachine, a_szHuman, a_szUnless, a_uMajorVer) \ 451 do \ 452 { \ 453 Bstr bstr; \ 454 CHECK_ERROR2I_RET(a_pObj, COMGETTER(a_Prop)(bstr.asOutParam()), hrcCheck); \ 455 if ((a_uMajorVer) <= VBOX_VERSION_MAJOR || !bstr.equals(a_szUnless)) \ 456 { \ 457 if (details == VMINFO_MACHINEREADABLE)\ 458 outputMachineReadableString(a_szMachine, &bstr); \ 459 else \ 460 RTPrintf("%-16s %ls\n", a_szHuman ":", bstr.raw()); \ 461 } \ 462 } while (0) 463 447 464 #define SHOW_STRINGARRAY_PROP(a_pObj, a_Prop, a_szMachine, a_szHuman) \ 448 465 do \ … … 564 581 SHOW_ULONG_PROP( machine, CPUExecutionCap, "cpuexecutioncap", "CPU exec cap", "%%"); 565 582 SHOW_BOOLEAN_PROP( machine, HPETEnabled, "hpet", "HPET"); 583 SHOW_STRING_PROP_MAJ( machine, CPUProfile, "cpu-profile", "CPUProfile", "host", 6); 566 584 567 585 ChipsetType_T chipsetType; -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r58437 r60410 72 72 MODIFYVM_CPUS, 73 73 MODIFYVM_CPUHOTPLUG, 74 MODIFYVM_CPU_PROFILE, 74 75 MODIFYVM_PLUGCPU, 75 76 MODIFYVM_UNPLUGCPU, … … 217 218 static const RTGETOPTDEF g_aModifyVMOptions[] = 218 219 { 220 /** @todo Convert to dash separated names like --triple-fault-reset! Please 221 * do that for all new options as we don't need more character soups 222 * around VirtualBox - typedefs more than covers that demand! */ 219 223 { "--name", MODIFYVM_NAME, RTGETOPT_REQ_STRING }, 220 224 { "--groups", MODIFYVM_GROUPS, RTGETOPT_REQ_STRING }, … … 244 248 { "--cpus", MODIFYVM_CPUS, RTGETOPT_REQ_UINT32 }, 245 249 { "--cpuhotplug", MODIFYVM_CPUHOTPLUG, RTGETOPT_REQ_BOOL_ONOFF }, 250 { "--cpu-profile", MODIFYVM_CPU_PROFILE, RTGETOPT_REQ_STRING }, 246 251 { "--plugcpu", MODIFYVM_PLUGCPU, RTGETOPT_REQ_UINT32 }, 247 252 { "--unplugcpu", MODIFYVM_UNPLUGCPU, RTGETOPT_REQ_UINT32 }, … … 774 779 } 775 780 781 case MODIFYVM_CPU_PROFILE: 782 { 783 CHECK_ERROR(sessionMachine, COMSETTER(CPUProfile)(Bstr(ValueUnion.psz).raw())); 784 break; 785 } 786 776 787 case MODIFYVM_PLUGCPU: 777 788 { -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r60408 r60410 4323 4323 <interface 4324 4324 name="IMachine" extends="$unknown" 4325 uuid=" e1aa7812-ec46-4612-d9d5-0a3d4703b3ab"4325 uuid="95565a66-622a-4ad0-4eed-9bb83c91c5be" 4326 4326 wsmap="managed" 4327 4327 wrap-hint-server-addinterfaces="IInternalMachineControl" 4328 4328 wrap-hint-server="manualaddinterfaces" 4329 reservedMethods="8" reservedAttributes="12" 4330 > 4329 reservedMethods="8" reservedAttributes="10" 4330 > 4331 <!-- Note! This interface is not compatible between 5.0 and 5.1 as it had too many 4332 methods/attributes for midl and the reservedAttributes had to be 4333 decreased. Max methods+attributes is 256, so in 6.0 this interface must 4334 be refactored a little! In the mean time, take from reservedMethods and 4335 reservedAttributes and update the UUID like always. --> 4331 4336 <desc> 4332 4337 The IMachine interface represents a virtual machine, or guest, created … … 5170 5175 <desc> 5171 5176 Debug parameters for the paravirtualized guest interface provider. 5177 </desc> 5178 </attribute> 5179 5180 <attribute name="CPUProfile" type="wstring"> 5181 <desc> 5182 Experimental feature to select the guest CPU profile. The default 5183 is "host", which indicates the host CPU. All other names are subject 5184 to change. 5185 5186 The profiles are found in src/VBox/VMM/VMMR3/cpus/. 5172 5187 </desc> 5173 5188 </attribute> -
trunk/src/VBox/Main/include/MachineImpl.h
r58437 r60410 290 290 ULONG mCpuExecutionCap; 291 291 uint32_t mCpuIdPortabilityLevel; 292 Utf8Str mCpuProfile; 292 293 BOOL mAccelerate3DEnabled; 293 294 BOOL mHPETEnabled; … … 875 876 HRESULT getCPUIDPortabilityLevel(ULONG *aCPUIDPortabilityLevel); 876 877 HRESULT setCPUIDPortabilityLevel(ULONG aCPUIDPortabilityLevel); 878 HRESULT getCPUProfile(com::Utf8Str &aCPUProfile); 879 HRESULT setCPUProfile(const com::Utf8Str &aCPUProfile); 877 880 HRESULT getMemorySize(ULONG *aMemorySize); 878 881 HRESULT setMemorySize(ULONG aMemorySize); -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r60045 r60410 876 876 877 877 /* 878 * EM values (before CPUM as it may need to set IemExecutesAll). 879 */ 880 PCFGMNODE pEM; 881 InsertConfigNode(pRoot, "EM", &pEM); 882 883 /* Triple fault behavior. */ 884 BOOL fTripleFaultReset = false; 885 hrc = pMachine->GetCPUProperty(CPUPropertyType_TripleFaultReset, &fTripleFaultReset); H(); 886 InsertConfigInteger(pEM, "TripleFaultReset", fTripleFaultReset); 887 888 /* 878 889 * CPUM values. 879 890 */ … … 957 968 /* CPU Portability level, */ 958 969 ULONG uCpuIdPortabilityLevel = 0; 959 hrc = pMachine->COMGETTER(CPUIDPortabilityLevel)(&uCpuIdPortabilityLevel); 970 hrc = pMachine->COMGETTER(CPUIDPortabilityLevel)(&uCpuIdPortabilityLevel); H(); 960 971 InsertConfigInteger(pCPUM, "PortableCpuIdLevel", uCpuIdPortabilityLevel); 961 972 … … 964 975 hrc = pMachine->GetCPUProperty(CPUPropertyType_PAE, &fEnablePAE); H(); 965 976 InsertConfigInteger(pRoot, "EnablePAE", fEnablePAE); 977 978 /* CPUM profile name. */ 979 hrc = pMachine->COMGETTER(CPUProfile)(bstr.asOutParam()); H(); 980 InsertConfigString(pRoot, "GuestCPUName", bstr); 981 982 /* 983 * Temporary(?) hack to make sure we emulate the ancient 16-bit CPUs 984 * correctly. There are way to many #UDs we'll miss using VT-x, 985 * raw-mode or qemu for the 186 and 286, while we'll get undefined opcodes 986 * dead wrong on 8086 (see http://www.os2museum.com/wp/undocumented-8086-opcodes/). 987 */ 988 if ( bstr.equals("80286") 989 || bstr.equals("80186") 990 || bstr.equals("V30") 991 || bstr.equals("V20") 992 || bstr.equals("8086") 993 || bstr.equals("8088") ) 994 InsertConfigInteger(pEM, "IemExecutesAll", true); 966 995 967 996 /* … … 1033 1062 } 1034 1063 InsertConfigInteger(pRoot, "HMEnabled", fHMEnabled); 1035 1036 /* /EM/xzy */1037 PCFGMNODE pEM;1038 InsertConfigNode(pRoot, "EM", &pEM);1039 1040 /* Triple fault behavior. */1041 BOOL fTripleFaultReset = false;1042 hrc = pMachine->GetCPUProperty(CPUPropertyType_TripleFaultReset, &fTripleFaultReset); H();1043 InsertConfigInteger(pEM, "TripleFaultReset", fTripleFaultReset);1044 1064 1045 1065 /* /HM/xzy */ -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r60054 r60410 197 197 mCpuExecutionCap = 100; /* Maximum CPU execution cap by default. */ 198 198 mCpuIdPortabilityLevel = 0; 199 mCpuProfile = "host"; 199 200 200 201 /* default boot order: floppy - DVD - HDD */ … … 1633 1634 } 1634 1635 1636 HRESULT Machine::getCPUProfile(com::Utf8Str &aCPUProfile) 1637 { 1638 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 1639 aCPUProfile = mHWData->mCpuProfile; 1640 return S_OK; 1641 } 1642 1643 HRESULT Machine::setCPUProfile(const com::Utf8Str &aCPUProfile) 1644 { 1645 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 1646 HRESULT hrc = i_checkStateDependency(MutableStateDep); 1647 if (SUCCEEDED(hrc)) 1648 { 1649 i_setModified(IsModified_MachineData); 1650 mHWData.backup(); 1651 /* Empty equals 'host'. */ 1652 if (aCPUProfile.isNotEmpty()) 1653 mHWData->mCpuProfile = aCPUProfile; 1654 else 1655 mHWData->mCpuProfile = "host"; 1656 } 1657 return hrc; 1658 } 1659 1635 1660 HRESULT Machine::getEmulatedUSBCardReaderEnabled(BOOL *aEmulatedUSBCardReaderEnabled) 1636 1661 { … … 8847 8872 mHWData->mCpuExecutionCap = data.ulCpuExecutionCap; 8848 8873 mHWData->mCpuIdPortabilityLevel = data.uCpuIdPortabilityLevel; 8874 mHWData->mCpuProfile = data.strCpuProfile; 8849 8875 8850 8876 // cpu … … 10182 10208 data.ulCpuExecutionCap = mHWData->mCpuExecutionCap; 10183 10209 data.uCpuIdPortabilityLevel = mHWData->mCpuIdPortabilityLevel; 10210 data.strCpuProfile = mHWData->mCpuProfile; 10184 10211 10185 10212 data.llCpus.clear(); -
trunk/src/VBox/Main/xml/Settings.cpp
r60283 r60410 2061 2061 ulCpuExecutionCap(100), 2062 2062 uCpuIdPortabilityLevel(0), 2063 strCpuProfile("host"), 2063 2064 ulMemorySizeMB((uint32_t)-1), 2064 2065 graphicsControllerType(GraphicsControllerType_VBoxVGA), … … 2135 2136 && (ulCpuExecutionCap == h.ulCpuExecutionCap) 2136 2137 && (uCpuIdPortabilityLevel == h.uCpuIdPortabilityLevel) 2138 && strCpuProfile == h.strCpuProfile 2137 2139 && (fHPETEnabled == h.fHPETEnabled) 2138 2140 && (llCpus == h.llCpus) … … 2170 2172 && (llSharedFolders == h.llSharedFolders) 2171 2173 && (clipboardMode == h.clipboardMode) 2172 && (dndMode == h.dndMode)2174 && (dndMode == h.dndMode) 2173 2175 && (ulMemoryBalloonSize == h.ulMemoryBalloonSize) 2174 2176 && (fPageFusionEnabled == h.fPageFusionEnabled) … … 2938 2940 } 2939 2941 pelmHwChild->getAttributeValue("CpuIdPortabilityLevel", hw.uCpuIdPortabilityLevel); 2942 pelmHwChild->getAttributeValue("CpuProfile", hw.strCpuProfile); 2940 2943 2941 2944 if ((pelmCPUChild = pelmHwChild->findChildElement("TripleFaultReset"))) … … 4248 4251 if (hw.uCpuIdPortabilityLevel != 0) 4249 4252 pelmCPU->setAttribute("CpuIdPortabilityLevel", hw.uCpuIdPortabilityLevel); 4253 if (!hw.strCpuProfile.equals("host") && hw.strCpuProfile.isNotEmpty()) 4254 pelmCPU->setAttribute("CpuProfile", hw.strCpuProfile); 4250 4255 4251 4256 /* Always save this setting as we have changed the default in 4.0 (on for large memory 64-bit systems). */ … … 5688 5693 if (m->sv < SettingsVersion_v1_16) 5689 5694 { 5690 // VirtualBox 5.1 adds a NVMe storage controller, paravirt debug options. 5695 // VirtualBox 5.1 adds a NVMe storage controller, paravirt debug options, cpu profile. 5696 5697 if ( hardwareMachine.strParavirtDebug.isNotEmpty() 5698 || (!hardwareMachine.strCpuProfile.equals("host") && hardwareMachine.strCpuProfile.isNotEmpty()) 5699 ) 5700 { 5701 m->sv = SettingsVersion_v1_16; 5702 return; 5703 } 5704 5691 5705 for (StorageControllersList::const_iterator it = storageMachine.llStorageControllers.begin(); 5692 5706 it != storageMachine.llStorageControllers.end(); … … 5700 5714 return; 5701 5715 } 5702 }5703 5704 if (hardwareMachine.strParavirtDebug.isNotEmpty())5705 {5706 m->sv = SettingsVersion_v1_16;5707 return;5708 5716 } 5709 5717 }
Note:
See TracChangeset
for help on using the changeset viewer.