Changeset 101035 in vbox for trunk/src/VBox/Main
- Timestamp:
- Sep 7, 2023 8:59:15 AM (17 months ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 15 added
- 2 deleted
- 32 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/Makefile.kmk
r100606 r101035 570 570 $(if $(VBOX_WITH_TPM),VBOX_WITH_TPM,) \ 571 571 $(if $(VBOX_WITH_FULL_VM_ENCRYPTION),VBOX_WITH_FULL_VM_ENCRYPTION,) \ 572 $(if-expr defined(VBOX_WITH_SDS),VBOX_WITH_SDS,) 572 $(if-expr defined(VBOX_WITH_SDS),VBOX_WITH_SDS,) \ 573 $(if $(VBOX_WITH_VIRT_ARMV8),VBOX_WITH_VIRT_ARMV8,) 573 574 ifdef VBOX_WITH_USB 574 575 VBoxSVC_DEFS += \ … … 637 638 src-all/NvramStoreImpl.cpp \ 638 639 src-all/PCIDeviceAttachmentImpl.cpp \ 640 src-all/PlatformPropertiesImpl.cpp \ 639 641 src-all/ProgressImpl.cpp \ 640 642 src-all/SecretKeyStore.cpp \ … … 653 655 src-server/BandwidthControlImpl.cpp \ 654 656 src-server/BandwidthGroupImpl.cpp \ 655 src-server/ BIOSSettingsImpl.cpp \657 src-server/FirmwareSettingsImpl.cpp \ 656 658 src-server/RecordingSettingsImpl.cpp \ 657 659 src-server/RecordingScreenSettingsImpl.cpp \ … … 674 676 src-server/HostDnsService.cpp \ 675 677 src-server/HostImpl.cpp \ 678 src-server/HostX86Impl.cpp \ 676 679 src-server/HostAudioDeviceImpl.cpp \ 677 680 src-server/HostNetworkInterfaceImpl.cpp \ … … 697 700 src-server/NetworkAdapterImpl.cpp \ 698 701 src-server/ParallelPortImpl.cpp \ 702 src-server/PlatformBase.cpp \ 703 src-server/PlatformImpl.cpp \ 704 $(if $(VBOX_WITH_VIRT_ARMV8), src-server/PlatformARMImpl.cpp,) \ 705 src-server/PlatformX86Impl.cpp \ 699 706 src-server/ProgressProxyImpl.cpp \ 700 707 src-server/SerialPortImpl.cpp \ … … 1139 1146 src-all/NvramStoreImpl.cpp \ 1140 1147 src-all/PCIDeviceAttachmentImpl.cpp \ 1148 src-all/PlatformPropertiesImpl.cpp \ 1141 1149 src-all/ProgressImpl.cpp \ 1142 1150 src-all/SecretKeyStore.cpp \ -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r100807 r101035 297 297 <application 298 298 name="VirtualBox" 299 uuid=" 819B4D85-9CEE-493C-B6FC-64FFE759B3C9"299 uuid="a89ce63a-c7c9-4380-a62a-ffb9052ddb37" 300 300 supportsErrorInfo="yes" 301 301 > … … 464 464 </result> 465 465 466 <result name="VBOX_E_PLATFORM_ARCH_NOT_SUPPORTED" value="0x80BB0012"> 467 <desc> 468 Platform architecture is not supported. 469 </desc> 470 </result> 471 466 472 <!-- 467 473 Note that src/VBox/Runtime/common/err/errmsgvboxcom.xsl will ignore … … 479 485 <enum 480 486 name="SettingsVersion" 481 uuid=" b4cc23c2-96f2-419d-830b-bd13c1135dfb"487 uuid="6ad3da60-5ed2-49cd-b882-96a72308ebf6" 482 488 > 483 489 <desc> … … 629 635 --> 630 636 </const> 637 <const name="v1_20" value="22"> 638 <desc>Settings version "1.20", written by VirtualBox 7.1.x.</desc> 639 <!-- 640 Adds VM platform support: Non-platform-specific 641 settings were moved to the new Platform element, which now contains 642 the platform architecture for this VM. x86-specific 643 settings were moved from Machine to a new, dedicated Platform/x86 element. 644 BIOSSettings were renamed to FirmwareSettings. 645 --> 646 </const> 631 647 <const name="Future" value="99999"> 632 <desc>Settings version greater than "1. 19", written by a future VirtualBox version.</desc>648 <desc>Settings version greater than "1.20", written by a future VirtualBox version.</desc> 633 649 </const> 634 650 </enum> … … 1014 1030 1015 1031 <enum 1032 name="PlatformArchitecture" 1033 uuid="36e21926-1713-413d-8cf5-2f169b2cbcf3" 1034 > 1035 <desc> 1036 Platform architecture. 1037 <note> 1038 <para>This does not specify the CPU type. 1039 See <link to="CPUArchitecture"/> for more information.</para> 1040 </note> 1041 </desc> 1042 <const name="None" value="0"> 1043 <desc>No platform selected. Never used by the API.</desc> 1044 </const> 1045 <const name="x86" value="1"> 1046 <desc> 1047 x86-based platform (AMD64 / x86). 1048 Valid CPUArchitecture choices: <link to="CPUArchitecture_AMD64"/>, <link to="CPUArchitecture_x86"/> 1049 </desc> 1050 </const> 1051 <const name="ARM" value="2"> 1052 <desc> 1053 ARM-based platform (AArch32, AArch64). 1054 Valid CPUArchitecture choices: <link to="CPUArchitecture_ARMv8_32"/>, <link to="CPUArchitecture_ARMv8_64"/> 1055 </desc> 1056 </const> 1057 </enum> 1058 1059 <enum 1016 1060 name="CPUArchitecture" 1017 uuid=" 4a2c9915-12f1-43b2-bb84-e4bd4d5ca227"1061 uuid="12906c63-9967-49c8-ba5a-6521adaf0185" 1018 1062 > 1019 1063 <desc>Basic CPU architecture types.</desc> … … 1027 1071 <desc>64-bit x86. (Also known as x86-64 or x64.)</desc> 1028 1072 </const> 1073 <const name="ARMv8_32" value="3"> 1074 <desc>32-bit only ARMv8. (Also known as AArch32 or ARM32.)</desc> 1075 </const> 1076 <const name="ARMv8_64" value="4"> 1077 <desc>64-bit only ARMv8. (Also known as AArch64 or ARM64.)</desc> 1078 </const> 1029 1079 </enum> 1030 1080 1031 1081 <enum 1032 name="CPUPropertyType "1033 uuid=" 3fcfe589-ca66-468f-e313-656f9d0b2eb6"1034 > 1035 <desc> 1036 Virtual CPU property type . This enumeration represents possible values of the1037 I Machineget- and setCPUProperty methods.1082 name="CPUPropertyTypeX86" 1083 uuid="a754b765-3687-4a68-abb9-78dcf4c07d5f" 1084 > 1085 <desc> 1086 Virtual CPU property type for x86-based CPUs. This enumeration represents possible values of the 1087 IPlatformX86 get- and setCPUProperty methods. 1038 1088 </desc> 1039 1089 <const name="Null" value="0"> … … 1144 1194 </enum> 1145 1195 1146 1147 1196 <enum 1148 1197 name="HWVirtExPropertyType" … … 1151 1200 <desc> 1152 1201 Hardware virtualization property type. This enumeration represents possible values 1153 for the <link to="I Machine::getHWVirtExProperty"/> and1154 <link to="I Machine::setHWVirtExProperty"/> methods.1202 for the <link to="IPlatformX86::getHWVirtExProperty"/> and 1203 <link to="IPlatformX86::setHWVirtExProperty"/> methods. 1155 1204 </desc> 1156 1205 <const name="Null" value="0"> … … 1390 1439 1391 1440 <enum 1392 name=" BIOSBootMenuMode"1393 uuid=" ae4fb9f7-29d2-45b4-b2c7-d579603135d5"1441 name="FirmwareBootMenuMode" 1442 uuid="bf88ec90-7fbb-4c78-bd71-5f8751d71450" 1394 1443 > 1395 1444 <desc> … … 1441 1490 </desc> 1442 1491 <const name="BIOS" value="1"> 1443 <desc>BIOS Firmware. </desc>1492 <desc>BIOS Firmware. Only applicable to x86 platforms.</desc> 1444 1493 </const> 1445 1494 <const name="EFI" value="2"> … … 2652 2701 <interface 2653 2702 name="IVirtualBox" extends="$unknown" 2654 uuid=" 7682d5eb-f00e-44f1-8ca2-99d08b1cd607"2703 uuid="0f22e6d1-07f5-4168-b3ef-167c57670c17" 2655 2704 wsmap="managed" 2656 2705 rest="managed" … … 2950 2999 </method> 2951 3000 3001 <method name="getPlatformProperties"> 3002 <rest name="getPlatformProperties" request="get" path="/platform/properties"/> 3003 <desc> 3004 Gets the associated properties object for the given VM platform architecture. 3005 </desc> 3006 <param name="architecture" type="PlatformArchitecture" dir="in"> 3007 <desc> 3008 The platform architecture to return the platform properties for. 3009 </desc> 3010 </param> 3011 <param name="properties" type="IPlatformProperties" dir="return"> 3012 <desc> 3013 Returned platform properties. 3014 </desc> 3015 </param> 3016 </method> 3017 2952 3018 <method name="createMachine"> 2953 3019 <rest name="create" request="post" path="/vms/"/> … … 3033 3099 <param name="name" type="wstring" dir="in"> 3034 3100 <desc>Machine name.</desc> 3101 </param> 3102 <param name="platform" type="PlatformArchitecture" dir="in"> 3103 <desc>The platform architecture for the new VM.</desc> 3035 3104 </param> 3036 3105 <param name="groups" type="wstring" safearray="yes" dir="in"> … … 5628 5697 5629 5698 <interface 5630 name="I BIOSSettings" extends="$unknown"5631 uuid=" a0a7f210-b857-4468-be26-c29f36a84345"5699 name="IFirmwareSettings" extends="$unknown" 5700 uuid="7831C899-DF5D-456A-A37B-0D4EC05D54D0" 5632 5701 wsmap="managed" 5633 5702 rest="managed" … … 5635 5704 > 5636 5705 <desc> 5637 The IBIOSSettings interface represents BIOS settings of the virtual 5638 machine. This is used only in the <link to="IMachine::BIOSSettings" /> attribute. 5639 </desc> 5706 The IFirmwareSettings interface represents firmware settings of the virtual 5707 machine. This is used only in the <link to="IMachine::firmwareSettings" /> attribute. 5708 </desc> 5709 5710 <attribute name="firmwareType" type="FirmwareType"> 5711 <desc>Type of firmware (such as legacy BIOS or EFI), used for initial 5712 bootstrap in this VM.</desc> 5713 </attribute> 5714 5640 5715 <attribute name="logoFadeIn" type="boolean"> 5641 5716 <desc>Fade in flag for BIOS logo animation.</desc> … … 5657 5732 </attribute> 5658 5733 5659 <attribute name="bootMenuMode" type=" BIOSBootMenuMode">5660 <desc>Mode of the BIOSboot device menu.</desc>5734 <attribute name="bootMenuMode" type="FirmwareBootMenuMode"> 5735 <desc>Mode of the firmware boot device menu.</desc> 5661 5736 </attribute> 5662 5737 … … 6698 6773 <desc> 6699 6774 The IOMMU type. This enumeration represents possible 6700 values for the <link to="I Machine::iommuType"/> attribute.6775 values for the <link to="IPlatform::iommuType"/> attribute. 6701 6776 </desc> 6702 6777 <const name="None" value="0"> … … 6715 6790 6716 6791 <interface 6792 name="IPlatform" extends="$unknown" 6793 uuid="a670a023-e172-452c-b731-14ef855f4da6" 6794 wsmap="managed" 6795 rest="managed" 6796 reservedMethods="8" reservedAttributes="16"> 6797 6798 <desc> 6799 Platform object for a virtual machine. 6800 6801 Accessed via <link to="IMachine::platform"/>. 6802 </desc> 6803 6804 <attribute name="architecture" type="PlatformArchitecture" readonly="no"> 6805 <desc> 6806 Returns the platform architecture. 6807 6808 Changing this means settings for the previously selected architecture 6809 will be discarded and replaced by defaults. 6810 6811 <note>Setting the platform architecture currently is 6812 not implemented yet.</note> 6813 6814 <result name="E_NOTIMPL"> 6815 Not implemented yet. 6816 </result> 6817 </desc> 6818 </attribute> 6819 6820 <attribute name="properties" type="IPlatformProperties" readonly="yes"> 6821 <desc> 6822 Returns the platform properties. 6823 </desc> 6824 </attribute> 6825 6826 <attribute name="x86" type="IPlatformX86" readonly="yes"> 6827 <desc> 6828 Platform object for x86-specific platform properties. 6829 6830 Changes to this object will not necessarily be preserved unless 6831 <link to="IPlatform::architecture"/> is set to <link to="PlatformArchitecture_x86"/>. 6832 </desc> 6833 6834 <result name="VBOX_E_PLATFORM_ARCH_NOT_SUPPORTED"> 6835 Current platform architecture is not x86. 6836 </result> 6837 </attribute> 6838 6839 <attribute name="ARM" type="IPlatformARM" readonly="yes"> 6840 <desc> 6841 Platform object for ARM-specific platform properties. 6842 6843 Changes to this object will not necessarily be preserved unless 6844 <link to="IPlatform::architecture"/> is set to <link to="PlatformArchitecture_ARM"/>. 6845 </desc> 6846 6847 <result name="VBOX_E_PLATFORM_ARCH_NOT_SUPPORTED"> 6848 Current platform architecture is not ARM. 6849 </result> 6850 </attribute> 6851 6852 <!-- Properties common to both (placed here to reduce IMachine bloat): --> 6853 6854 <attribute name="chipsetType" type="ChipsetType"> 6855 <desc>Chipset type used in this VM.</desc> 6856 </attribute> 6857 6858 <attribute name="iommuType" type="IommuType"> 6859 <desc>IOMMU type used in this VM.</desc> 6860 </attribute> 6861 6862 <attribute name="RTCUseUTC" type="boolean"> 6863 <desc> 6864 When set to @a true, the RTC device of the virtual machine will run 6865 in UTC time, otherwise in local time. Especially Unix guests prefer 6866 the time in UTC. 6867 </desc> 6868 </attribute> 6869 6870 </interface> 6871 6872 <interface 6873 name="IPlatformX86" extends="$unknown" 6874 uuid="5ada589f-09c9-4604-b700-9ab3a5572e3a" 6875 wsmap="managed" 6876 rest="managed" 6877 reservedMethods="8" reservedAttributes="16"> 6878 6879 <desc> 6880 The x86 specific platform properties for a virtual machine. 6881 6882 Accessed via <link to="IMachine::platform"/> and <link to="IPlatform::x86"/>. 6883 </desc> 6884 6885 <attribute name="HPETEnabled" type="boolean"> 6886 <desc>This attribute controls if High Precision Event Timer (HPET) is 6887 enabled in this VM. Use this property if you want to provide guests 6888 with additional time source, or if guest requires HPET to function correctly. 6889 Default is false.</desc> 6890 </attribute> 6891 6892 <method name="getCPUProperty" const="yes"> 6893 <rest request="get" path="/vms/{vmid}/configuration/"/> 6894 <desc> 6895 Returns the virtual CPU boolean value of the specified property. 6896 6897 <result name="E_INVALIDARG"> 6898 Invalid property. 6899 </result> 6900 6901 </desc> 6902 <param name="property" type="CPUPropertyTypeX86" dir="in"> 6903 <desc> 6904 Property type to query. 6905 </desc> 6906 </param> 6907 <param name="value" type="boolean" dir="return"> 6908 <desc> 6909 Property value. 6910 </desc> 6911 </param> 6912 </method> 6913 6914 <method name="setCPUProperty"> 6915 <rest request="post" path="/vms/{vmid}/configuration/"/> 6916 <desc> 6917 Sets the virtual CPU boolean value of the specified property. 6918 6919 <result name="E_INVALIDARG"> 6920 Invalid property. 6921 </result> 6922 6923 </desc> 6924 <param name="property" type="CPUPropertyTypeX86" dir="in"> 6925 <desc> 6926 Property type to query. 6927 </desc> 6928 </param> 6929 <param name="value" type="boolean" dir="in"> 6930 <desc> 6931 Property value. 6932 </desc> 6933 </param> 6934 </method> 6935 6936 <method name="getCPUIDLeafByOrdinal" const="yes"> 6937 <desc> 6938 Used to enumerate CPUID information override values. 6939 6940 <result name="E_INVALIDARG"> 6941 Invalid ordinal number is out of range. 6942 </result> 6943 </desc> 6944 <param name="ordinal" type="unsigned long" dir="in"> 6945 <desc> 6946 The ordinal number of the leaf to get. 6947 </desc> 6948 </param> 6949 <param name="idx" type="unsigned long" dir="out"> 6950 <desc> 6951 CPUID leaf index. 6952 </desc> 6953 </param> 6954 <param name="idxSub" type="unsigned long" dir="out"> 6955 <desc> 6956 CPUID leaf sub-index. 6957 </desc> 6958 </param> 6959 <param name="valEax" type="unsigned long" dir="out"> 6960 <desc> 6961 CPUID leaf value for register eax. 6962 </desc> 6963 </param> 6964 <param name="valEbx" type="unsigned long" dir="out"> 6965 <desc> 6966 CPUID leaf value for register ebx. 6967 </desc> 6968 </param> 6969 <param name="valEcx" type="unsigned long" dir="out"> 6970 <desc> 6971 CPUID leaf value for register ecx. 6972 </desc> 6973 </param> 6974 <param name="valEdx" type="unsigned long" dir="out"> 6975 <desc> 6976 CPUID leaf value for register edx. 6977 </desc> 6978 </param> 6979 </method> 6980 6981 <method name="getCPUIDLeaf" const="yes"> 6982 <desc> 6983 Returns the virtual CPU cpuid information for the specified leaf. 6984 6985 Currently supported index values for cpuid: 6986 Standard CPUID leaves: 0 - 0x1f 6987 Extended CPUID leaves: 0x80000000 - 0x8000001f 6988 VIA CPUID leaves: 0xc0000000 - 0xc000000f 6989 6990 See the Intel, AMD and VIA programmer's manuals for detailed information 6991 about the CPUID instruction and its leaves. 6992 <result name="E_INVALIDARG"> 6993 Invalid index. 6994 </result> 6995 6996 </desc> 6997 <param name="idx" type="unsigned long" dir="in"> 6998 <desc> 6999 CPUID leaf index. 7000 </desc> 7001 </param> 7002 <param name="idxSub" type="unsigned long" dir="in"> 7003 <desc> 7004 CPUID leaf sub-index (ECX). Set to 0xffffffff (or 0) if not applicable. 7005 </desc> 7006 </param> 7007 <param name="valEax" type="unsigned long" dir="out"> 7008 <desc> 7009 CPUID leaf value for register eax. 7010 </desc> 7011 </param> 7012 <param name="valEbx" type="unsigned long" dir="out"> 7013 <desc> 7014 CPUID leaf value for register ebx. 7015 </desc> 7016 </param> 7017 <param name="valEcx" type="unsigned long" dir="out"> 7018 <desc> 7019 CPUID leaf value for register ecx. 7020 </desc> 7021 </param> 7022 <param name="valEdx" type="unsigned long" dir="out"> 7023 <desc> 7024 CPUID leaf value for register edx. 7025 </desc> 7026 </param> 7027 </method> 7028 7029 <method name="setCPUIDLeaf"> 7030 <desc> 7031 Sets the virtual CPU cpuid information for the specified leaf. Note that these values 7032 are not passed unmodified. VirtualBox clears features that it doesn't support. 7033 7034 Currently supported index values for cpuid: 7035 Standard CPUID leaves: 0 - 0x1f 7036 Extended CPUID leaves: 0x80000000 - 0x8000001f 7037 VIA CPUID leaves: 0xc0000000 - 0xc000000f 7038 7039 The subleaf index is only applicable to certain leaves (see manuals as this is 7040 subject to change). 7041 7042 See the Intel, AMD and VIA programmer's manuals for detailed information 7043 about the cpuid instruction and its leaves. 7044 7045 Do not use this method unless you know exactly what you're doing. Misuse can lead to 7046 random crashes inside VMs. 7047 <result name="E_INVALIDARG"> 7048 Invalid index. 7049 </result> 7050 7051 </desc> 7052 <param name="idx" type="unsigned long" dir="in"> 7053 <desc> 7054 CPUID leaf index. 7055 </desc> 7056 </param> 7057 <param name="idxSub" type="unsigned long" dir="in"> 7058 <desc> 7059 CPUID leaf sub-index (ECX). Set to 0xffffffff (or 0) if not applicable. 7060 The 0xffffffff causes it to remove all other subleaves before adding one 7061 with sub-index 0. 7062 </desc> 7063 </param> 7064 <param name="valEax" type="unsigned long" dir="in"> 7065 <desc> 7066 CPUID leaf value for register eax. 7067 </desc> 7068 </param> 7069 <param name="valEbx" type="unsigned long" dir="in"> 7070 <desc> 7071 CPUID leaf value for register ebx. 7072 </desc> 7073 </param> 7074 <param name="valEcx" type="unsigned long" dir="in"> 7075 <desc> 7076 CPUID leaf value for register ecx. 7077 </desc> 7078 </param> 7079 <param name="valEdx" type="unsigned long" dir="in"> 7080 <desc> 7081 CPUID leaf value for register edx. 7082 </desc> 7083 </param> 7084 </method> 7085 7086 <method name="removeCPUIDLeaf"> 7087 <desc> 7088 Removes the virtual CPU cpuid leaf for the specified index 7089 7090 <result name="E_INVALIDARG"> 7091 Invalid index. 7092 </result> 7093 7094 </desc> 7095 <param name="idx" type="unsigned long" dir="in"> 7096 <desc> 7097 CPUID leaf index. 7098 </desc> 7099 </param> 7100 <param name="idxSub" type="unsigned long" dir="in"> 7101 <desc> 7102 CPUID leaf sub-index (ECX). Set to 0xffffffff (or 0) if not applicable. 7103 The 0xffffffff value works like a wildcard. 7104 </desc> 7105 </param> 7106 </method> 7107 7108 <method name="removeAllCPUIDLeaves"> 7109 <desc> 7110 Removes all the virtual CPU cpuid leaves 7111 </desc> 7112 </method> 7113 7114 <method name="getHWVirtExProperty" const="yes"> 7115 <rest request="get" path="/vms/{vmid}/configuration/"/> 7116 <desc> 7117 Returns the value of the specified hardware virtualization boolean property. 7118 7119 <result name="E_INVALIDARG"> 7120 Invalid property. 7121 </result> 7122 7123 </desc> 7124 <param name="property" type="HWVirtExPropertyType" dir="in"> 7125 <desc> 7126 Property type to query. 7127 </desc> 7128 </param> 7129 <param name="value" type="boolean" dir="return"> 7130 <desc> 7131 Property value. 7132 </desc> 7133 </param> 7134 </method> 7135 7136 <method name="setHWVirtExProperty"> 7137 <rest request="post" path="/vms/{vmid}/configuration/"/> 7138 <desc> 7139 Sets a new value for the specified hardware virtualization boolean property. 7140 7141 <result name="E_INVALIDARG"> 7142 Invalid property. 7143 </result> 7144 7145 </desc> 7146 <param name="property" type="HWVirtExPropertyType" dir="in"> 7147 <desc> 7148 Property type to set. 7149 </desc> 7150 </param> 7151 <param name="value" type="boolean" dir="in"> 7152 <desc> 7153 New property value. 7154 </desc> 7155 </param> 7156 </method> 7157 7158 </interface> 7159 7160 <interface 7161 name="IPlatformARM" extends="$unknown" 7162 uuid="75dff9be-6cb3-4857-bde6-2faf82ed9a8d" 7163 wsmap="managed" 7164 rest="managed" 7165 reservedMethods="8" reservedAttributes="16"> 7166 7167 <desc> 7168 The x86 specific platform properties for a virtual machine. 7169 7170 Accessed via <link to="IMachine::platform"/> and <link to="IPlatform::ARM"/>. 7171 </desc> 7172 7173 <!-- Currently empty, but that should change before long... --> 7174 <attribute name="midlDoesNotLikeEmptyInterfaces" readonly="yes" type="boolean"/> 7175 7176 </interface> 7177 7178 <interface 6717 7179 name="IMachine" extends="$unknown" 6718 uuid=" 300763af-5d6b-46e6-aa96-273eac15538a"7180 uuid="8161d51b-17b4-4598-add2-eb1fe1de6230" 6719 7181 wsmap="managed" 6720 7182 rest="managed" … … 6972 7434 </attribute> 6973 7435 6974 <attribute name="BIOSSettings" type="IBIOSSettings" readonly="yes"> 6975 <desc>Object containing all BIOS settings.</desc> 7436 <attribute name="platform" type="IPlatform" readonly="yes"> 7437 <desc>Associated platform object.</desc> 7438 </attribute> 7439 7440 <attribute name="firmwareSettings" type="IFirmwareSettings" readonly="yes"> 7441 <desc>Object containing all firmware settings.</desc> 6976 7442 </attribute> 6977 7443 … … 6986 7452 <attribute name="recordingSettings" type="IRecordingSettings" readonly="yes"> 6987 7453 <desc>Object containing all recording settings.</desc> 6988 </attribute>6989 6990 <attribute name="firmwareType" type="FirmwareType">6991 <desc>Type of firmware (such as legacy BIOS or EFI), used for initial6992 bootstrap in this VM.</desc>6993 7454 </attribute> 6994 7455 … … 7003 7464 The default is typically "PS2Keyboard" but can vary depending on the 7004 7465 requirements of the guest operating system.</desc> 7005 </attribute>7006 7007 <attribute name="HPETEnabled" type="boolean">7008 <desc>This attribute controls if High Precision Event Timer (HPET) is7009 enabled in this VM. Use this property if you want to provide guests7010 with additional time source, or if guest requires HPET to function correctly.7011 Default is false.</desc>7012 </attribute>7013 7014 <attribute name="chipsetType" type="ChipsetType">7015 <desc>Chipset type used in this VM.</desc>7016 </attribute>7017 7018 <attribute name="iommuType" type="IommuType">7019 <desc>IOMMU type used in this VM.</desc>7020 7466 </attribute> 7021 7467 … … 7321 7767 </attribute> 7322 7768 7323 <attribute name="RTCUseUTC" type="boolean">7324 <desc>7325 When set to @a true, the RTC device of the virtual machine will run7326 in UTC time, otherwise in local time. Especially Unix guests prefer7327 the time in UTC.7328 </desc>7329 </attribute>7330 7331 7769 <attribute name="IOCacheEnabled" type="boolean"> 7332 7770 <desc> … … 7732 8170 Position in the boot order (@c 1 to the total number of 7733 8171 devices the machine can boot from, as returned by 7734 <link to="I SystemProperties::maxBootPosition"/>).8172 <link to="IPlatformProperties::maxBootPosition"/>). 7735 8173 </desc> 7736 8174 </param> … … 7767 8205 Position in the boot order (@c 1 to the total number of 7768 8206 devices the machine can boot from, as returned by 7769 <link to="I SystemProperties::maxBootPosition"/>).8207 <link to="IPlatformProperties::maxBootPosition"/>). 7770 8208 </desc> 7771 8209 </param> … … 8500 8938 Slots are numbered sequentially, starting with zero. The total 8501 8939 number of adapters per machine is defined by the 8502 <link to="I SystemProperties::getMaxNetworkAdapters"/> property,8940 <link to="IPlatformProperties::getMaxNetworkAdapters"/> property, 8503 8941 so the maximum slot number is one less than that property's value. 8504 8942 … … 8658 9096 Slots are numbered sequentially, starting with zero. The total 8659 9097 number of serial ports per machine is defined by the 8660 <link to="I SystemProperties::serialPortCount"/> property,9098 <link to="IPlatformProperties::serialPortCount"/> property, 8661 9099 so the maximum slot number is one less than that property's value. 8662 9100 … … 8676 9114 Slots are numbered sequentially, starting with zero. The total 8677 9115 number of parallel ports per machine is defined by the 8678 <link to="I SystemProperties::parallelPortCount"/> property,9116 <link to="IPlatformProperties::parallelPortCount"/> property, 8679 9117 so the maximum slot number is one less than that property's value. 8680 9118 … … 8772 9210 </method> 8773 9211 8774 <method name="getCPUProperty" const="yes">8775 <rest request="get" path="/vms/{vmid}/configuration/"/>8776 <desc>8777 Returns the virtual CPU boolean value of the specified property.8778 8779 <result name="E_INVALIDARG">8780 Invalid property.8781 </result>8782 8783 </desc>8784 <param name="property" type="CPUPropertyType" dir="in">8785 <desc>8786 Property type to query.8787 </desc>8788 </param>8789 <param name="value" type="boolean" dir="return">8790 <desc>8791 Property value.8792 </desc>8793 </param>8794 </method>8795 8796 <method name="setCPUProperty">8797 <rest request="post" path="/vms/{vmid}/configuration/"/>8798 <desc>8799 Sets the virtual CPU boolean value of the specified property.8800 8801 <result name="E_INVALIDARG">8802 Invalid property.8803 </result>8804 8805 </desc>8806 <param name="property" type="CPUPropertyType" dir="in">8807 <desc>8808 Property type to query.8809 </desc>8810 </param>8811 <param name="value" type="boolean" dir="in">8812 <desc>8813 Property value.8814 </desc>8815 </param>8816 </method>8817 8818 <method name="getCPUIDLeafByOrdinal" const="yes">8819 <desc>8820 Used to enumerate CPUID information override values.8821 8822 <result name="E_INVALIDARG">8823 Invalid ordinal number is out of range.8824 </result>8825 </desc>8826 <param name="ordinal" type="unsigned long" dir="in">8827 <desc>8828 The ordinal number of the leaf to get.8829 </desc>8830 </param>8831 <param name="idx" type="unsigned long" dir="out">8832 <desc>8833 CPUID leaf index.8834 </desc>8835 </param>8836 <param name="idxSub" type="unsigned long" dir="out">8837 <desc>8838 CPUID leaf sub-index.8839 </desc>8840 </param>8841 <param name="valEax" type="unsigned long" dir="out">8842 <desc>8843 CPUID leaf value for register eax.8844 </desc>8845 </param>8846 <param name="valEbx" type="unsigned long" dir="out">8847 <desc>8848 CPUID leaf value for register ebx.8849 </desc>8850 </param>8851 <param name="valEcx" type="unsigned long" dir="out">8852 <desc>8853 CPUID leaf value for register ecx.8854 </desc>8855 </param>8856 <param name="valEdx" type="unsigned long" dir="out">8857 <desc>8858 CPUID leaf value for register edx.8859 </desc>8860 </param>8861 </method>8862 8863 <method name="getCPUIDLeaf" const="yes">8864 <desc>8865 Returns the virtual CPU cpuid information for the specified leaf.8866 8867 Currently supported index values for cpuid:8868 Standard CPUID leaves: 0 - 0x1f8869 Extended CPUID leaves: 0x80000000 - 0x8000001f8870 VIA CPUID leaves: 0xc0000000 - 0xc000000f8871 8872 See the Intel, AMD and VIA programmer's manuals for detailed information8873 about the CPUID instruction and its leaves.8874 <result name="E_INVALIDARG">8875 Invalid index.8876 </result>8877 8878 </desc>8879 <param name="idx" type="unsigned long" dir="in">8880 <desc>8881 CPUID leaf index.8882 </desc>8883 </param>8884 <param name="idxSub" type="unsigned long" dir="in">8885 <desc>8886 CPUID leaf sub-index (ECX). Set to 0xffffffff (or 0) if not applicable.8887 </desc>8888 </param>8889 <param name="valEax" type="unsigned long" dir="out">8890 <desc>8891 CPUID leaf value for register eax.8892 </desc>8893 </param>8894 <param name="valEbx" type="unsigned long" dir="out">8895 <desc>8896 CPUID leaf value for register ebx.8897 </desc>8898 </param>8899 <param name="valEcx" type="unsigned long" dir="out">8900 <desc>8901 CPUID leaf value for register ecx.8902 </desc>8903 </param>8904 <param name="valEdx" type="unsigned long" dir="out">8905 <desc>8906 CPUID leaf value for register edx.8907 </desc>8908 </param>8909 </method>8910 8911 <method name="setCPUIDLeaf">8912 <desc>8913 Sets the virtual CPU cpuid information for the specified leaf. Note that these values8914 are not passed unmodified. VirtualBox clears features that it doesn't support.8915 8916 Currently supported index values for cpuid:8917 Standard CPUID leaves: 0 - 0x1f8918 Extended CPUID leaves: 0x80000000 - 0x8000001f8919 VIA CPUID leaves: 0xc0000000 - 0xc000000f8920 8921 The subleaf index is only applicable to certain leaves (see manuals as this is8922 subject to change).8923 8924 See the Intel, AMD and VIA programmer's manuals for detailed information8925 about the cpuid instruction and its leaves.8926 8927 Do not use this method unless you know exactly what you're doing. Misuse can lead to8928 random crashes inside VMs.8929 <result name="E_INVALIDARG">8930 Invalid index.8931 </result>8932 8933 </desc>8934 <param name="idx" type="unsigned long" dir="in">8935 <desc>8936 CPUID leaf index.8937 </desc>8938 </param>8939 <param name="idxSub" type="unsigned long" dir="in">8940 <desc>8941 CPUID leaf sub-index (ECX). Set to 0xffffffff (or 0) if not applicable.8942 The 0xffffffff causes it to remove all other subleaves before adding one8943 with sub-index 0.8944 </desc>8945 </param>8946 <param name="valEax" type="unsigned long" dir="in">8947 <desc>8948 CPUID leaf value for register eax.8949 </desc>8950 </param>8951 <param name="valEbx" type="unsigned long" dir="in">8952 <desc>8953 CPUID leaf value for register ebx.8954 </desc>8955 </param>8956 <param name="valEcx" type="unsigned long" dir="in">8957 <desc>8958 CPUID leaf value for register ecx.8959 </desc>8960 </param>8961 <param name="valEdx" type="unsigned long" dir="in">8962 <desc>8963 CPUID leaf value for register edx.8964 </desc>8965 </param>8966 </method>8967 8968 <method name="removeCPUIDLeaf">8969 <desc>8970 Removes the virtual CPU cpuid leaf for the specified index8971 8972 <result name="E_INVALIDARG">8973 Invalid index.8974 </result>8975 8976 </desc>8977 <param name="idx" type="unsigned long" dir="in">8978 <desc>8979 CPUID leaf index.8980 </desc>8981 </param>8982 <param name="idxSub" type="unsigned long" dir="in">8983 <desc>8984 CPUID leaf sub-index (ECX). Set to 0xffffffff (or 0) if not applicable.8985 The 0xffffffff value works like a wildcard.8986 </desc>8987 </param>8988 </method>8989 8990 <method name="removeAllCPUIDLeaves">8991 <desc>8992 Removes all the virtual CPU cpuid leaves8993 </desc>8994 </method>8995 8996 <method name="getHWVirtExProperty" const="yes">8997 <rest request="get" path="/vms/{vmid}/configuration/"/>8998 <desc>8999 Returns the value of the specified hardware virtualization boolean property.9000 9001 <result name="E_INVALIDARG">9002 Invalid property.9003 </result>9004 9005 </desc>9006 <param name="property" type="HWVirtExPropertyType" dir="in">9007 <desc>9008 Property type to query.9009 </desc>9010 </param>9011 <param name="value" type="boolean" dir="return">9012 <desc>9013 Property value.9014 </desc>9015 </param>9016 </method>9017 9018 <method name="setHWVirtExProperty">9019 <rest request="post" path="/vms/{vmid}/configuration/"/>9020 <desc>9021 Sets a new value for the specified hardware virtualization boolean property.9022 9023 <result name="E_INVALIDARG">9024 Invalid property.9025 </result>9026 9027 </desc>9028 <param name="property" type="HWVirtExPropertyType" dir="in">9029 <desc>9030 Property type to set.9031 </desc>9032 </param>9033 <param name="value" type="boolean" dir="in">9034 <desc>9035 New property value.9036 </desc>9037 </param>9038 </method>9039 9040 9212 <method name="setSettingsFilePath"> 9041 9213 <rest request="post" path="/vms/{vmid}/configuration/"/> … … 11872 12044 11873 12045 <interface 12046 name="IHostX86" extends="$unknown" 12047 uuid="50c97996-9cf8-417f-bd79-1e0471367cd3" 12048 wsmap="managed" 12049 rest="managed" 12050 reservedMethods="6" reservedAttributes="12" 12051 > 12052 12053 <desc> 12054 The x86 specific interface for the physical host machine. 12055 </desc> 12056 12057 <method name="getProcessorCPUIDLeaf"> 12058 <desc> 12059 Returns the CPU cpuid information for the specified leaf. 12060 </desc> 12061 <param name="cpuId" type="unsigned long" dir="in"> 12062 <desc> 12063 Identifier of the CPU. The CPU must be online. 12064 <note> 12065 The current implementation might not necessarily return the 12066 description for this exact CPU. 12067 </note> 12068 </desc> 12069 </param> 12070 <param name="leaf" type="unsigned long" dir="in"> 12071 <desc> 12072 CPUID leaf index (eax). 12073 </desc> 12074 </param> 12075 <param name="subLeaf" type="unsigned long" dir="in"> 12076 <desc> 12077 CPUID leaf sub index (ecx). This currently only applies to cache 12078 information on Intel CPUs. Use 0 if retrieving values for 12079 <link to="IPlatformX86::setCPUIDLeaf"/>. 12080 </desc> 12081 </param> 12082 <param name="valEax" type="unsigned long" dir="out"> 12083 <desc> 12084 CPUID leaf value for register eax. 12085 </desc> 12086 </param> 12087 <param name="valEbx" type="unsigned long" dir="out"> 12088 <desc> 12089 CPUID leaf value for register ebx. 12090 </desc> 12091 </param> 12092 <param name="valEcx" type="unsigned long" dir="out"> 12093 <desc> 12094 CPUID leaf value for register ecx. 12095 </desc> 12096 </param> 12097 <param name="valEdx" type="unsigned long" dir="out"> 12098 <desc> 12099 CPUID leaf value for register edx. 12100 </desc> 12101 </param> 12102 </method> 12103 12104 </interface> 12105 12106 <interface 11874 12107 name="IHost" extends="$unknown" 11875 12108 uuid="e54f6256-97a7-4947-8a78-10c013ddf4b8" … … 11890 12123 11891 12124 </desc> 12125 12126 <attribute name="architecture" type="PlatformArchitecture" readonly="yes"> 12127 <desc>Platform architecture type.</desc> 12128 </attribute> 12129 12130 <attribute name="x86" type="IHostX86" readonly="yes"> 12131 <desc>Associated object for x86 host specifics.</desc> 12132 </attribute> 12133 11892 12134 <attribute name="DVDDrives" type="IMedium" readonly="yes" safearray="yes"> 11893 12135 <desc>List of DVD drives available on the host.</desc> … … 12025 12267 Model string. An empty string is returned if value is not known or 12026 12268 @a cpuId is invalid. 12027 </desc>12028 </param>12029 </method>12030 12031 <method name="getProcessorCPUIDLeaf">12032 <desc>12033 Returns the CPU cpuid information for the specified leaf.12034 </desc>12035 <param name="cpuId" type="unsigned long" dir="in">12036 <desc>12037 Identifier of the CPU. The CPU most be online.12038 <note>12039 The current implementation might not necessarily return the12040 description for this exact CPU.12041 </note>12042 </desc>12043 </param>12044 <param name="leaf" type="unsigned long" dir="in">12045 <desc>12046 CPUID leaf index (eax).12047 </desc>12048 </param>12049 <param name="subLeaf" type="unsigned long" dir="in">12050 <desc>12051 CPUID leaf sub index (ecx). This currently only applies to cache12052 information on Intel CPUs. Use 0 if retrieving values for12053 <link to="IMachine::setCPUIDLeaf"/>.12054 </desc>12055 </param>12056 <param name="valEax" type="unsigned long" dir="out">12057 <desc>12058 CPUID leaf value for register eax.12059 </desc>12060 </param>12061 <param name="valEbx" type="unsigned long" dir="out">12062 <desc>12063 CPUID leaf value for register ebx.12064 </desc>12065 </param>12066 <param name="valEcx" type="unsigned long" dir="out">12067 <desc>12068 CPUID leaf value for register ecx.12069 </desc>12070 </param>12071 <param name="valEdx" type="unsigned long" dir="out">12072 <desc>12073 CPUID leaf value for register edx.12074 12269 </desc> 12075 12270 </param> … … 12422 12617 </interface> 12423 12618 12619 <interface 12620 name="IPlatformProperties" 12621 extends="$unknown" 12622 uuid="fb682653-c51d-42d4-bc30-db7c3e8bf75d" 12623 wsmap="managed" 12624 rest="managed" 12625 reservedMethods="4" reservedAttributes="16" 12626 > 12627 <desc> 12628 Properties of a specific virtualization platform. 12629 </desc> 12630 12631 <attribute name="rawModeSupported" type="boolean" readonly="yes"> 12632 <desc> 12633 Indicates whether VirtualBox was built with raw-mode support. 12634 12635 When this reads as False, the <link to="HWVirtExPropertyType_Enabled"/> 12636 setting will be ignored and assumed to be True. 12637 12638 <note>For guest platform properties, this attribute is being 12639 ignored.</note> 12640 </desc> 12641 </attribute> 12642 12643 <attribute name="exclusiveHwVirt" type="boolean"> 12644 <desc> 12645 Exclusive use of hardware virtualization by VirtualBox. When enabled, 12646 VirtualBox assumes it can obtain full and exclusive access to the VT-x 12647 or AMD-V feature of the host. To share hardware virtualization with 12648 other hypervisors, this property must be disabled. 12649 12650 <note>For hosts running on macOS this is being ignored, as the kernel 12651 mediates hardware access there.</note> 12652 <note>For guest platform properties, this attribute is being 12653 ignored.</note> 12654 </desc> 12655 </attribute> 12656 12657 <attribute name="serialPortCount" type="unsigned long" readonly="yes"> 12658 <desc> 12659 Maximum number of serial ports associated with every 12660 <link to="IMachine"/> instance. 12661 </desc> 12662 </attribute> 12663 12664 <attribute name="parallelPortCount" type="unsigned long" readonly="yes"> 12665 <desc> 12666 Maximum number of parallel ports associated with every 12667 <link to="IMachine"/> instance. 12668 </desc> 12669 </attribute> 12670 12671 <attribute name="maxBootPosition" type="unsigned long" readonly="yes"> 12672 <desc> 12673 Maximum device position in the boot order. This value corresponds 12674 to the total number of devices a machine can boot from, to make it 12675 possible to include all possible devices to the boot list. 12676 <see><link to="IMachine::setBootOrder"/></see> 12677 </desc> 12678 </attribute> 12679 12680 <attribute name="supportedParavirtProviders" type="ParavirtProvider" safearray="yes" readonly="yes"> 12681 <desc> 12682 Returns an array of officially supported values for enum <link to="ParavirtProvider"/>, 12683 in the sense of what is e.g. worth offering in the VirtualBox GUI. 12684 </desc> 12685 </attribute> 12686 12687 <attribute name="supportedFirmwareTypes" type="FirmwareType" safearray="yes" readonly="yes"> 12688 <desc> 12689 Returns an array of officially supported values for enum <link to="FirmwareType"/>, 12690 in the sense of what is e.g. worth offering in the VirtualBox GUI. 12691 </desc> 12692 </attribute> 12693 12694 <attribute name="supportedGraphicsControllerTypes" type="GraphicsControllerType" safearray="yes" readonly="yes"> 12695 <desc> 12696 Returns an array of officially supported values for enum <link to="GraphicsControllerType"/>, 12697 in the sense of what is e.g. worth offering in the VirtualBox GUI. 12698 </desc> 12699 </attribute> 12700 12701 <attribute name="supportedNetworkAdapterTypes" type="NetworkAdapterType" safearray="yes" readonly="yes"> 12702 <desc> 12703 Returns an array of officially supported values for enum <link to="NetworkAdapterType"/>, 12704 in the sense of what is e.g. worth offering in the VirtualBox GUI. 12705 </desc> 12706 </attribute> 12707 12708 <attribute name="supportedUartTypes" type="UartType" safearray="yes" readonly="yes"> 12709 <desc> 12710 Returns an array of officially supported values for enum <link to="UartType"/>, 12711 in the sense of what is e.g. worth offering in the VirtualBox GUI. 12712 </desc> 12713 </attribute> 12714 12715 <attribute name="supportedUSBControllerTypes" type="USBControllerType" safearray="yes" readonly="yes"> 12716 <desc> 12717 Returns an array of officially supported values for enum <link to="USBControllerType"/>, 12718 in the sense of what is e.g. worth offering in the VirtualBox GUI. 12719 </desc> 12720 </attribute> 12721 12722 <attribute name="supportedAudioControllerTypes" type="AudioControllerType" safearray="yes" readonly="yes"> 12723 <desc> 12724 Returns an array of officially supported values for enum <link to="AudioControllerType"/>, 12725 in the sense of what is e.g. worth offering in the VirtualBox GUI. 12726 </desc> 12727 </attribute> 12728 12729 <attribute name="supportedStorageBuses" type="StorageBus" safearray="yes" readonly="yes"> 12730 <desc> 12731 Returns an array of officially supported values for enum <link to="StorageBus"/>, 12732 in the sense of what is e.g. worth offering in the VirtualBox GUI. 12733 </desc> 12734 </attribute> 12735 12736 <attribute name="supportedStorageControllerTypes" type="StorageControllerType" safearray="yes" readonly="yes"> 12737 <desc> 12738 Returns an array of officially supported values for enum <link to="StorageControllerType"/>, 12739 in the sense of what is e.g. worth offering in the VirtualBox GUI. 12740 </desc> 12741 </attribute> 12742 12743 <attribute name="supportedChipsetTypes" type="ChipsetType" safearray="yes" readonly="yes"> 12744 <desc> 12745 Returns an array of officially supported values for enum <link to="ChipsetType"/>, 12746 in the sense of what is e.g. worth offering in the VirtualBox GUI. 12747 </desc> 12748 </attribute> 12749 12750 <attribute name="supportedIommuTypes" type="IommuType" safearray="yes" readonly="yes"> 12751 <desc> 12752 Returns an array of officially supported values for enum <link to="IommuType"/>, 12753 in the sense of what is e.g. worth offering in the VirtualBox GUI. 12754 </desc> 12755 </attribute> 12756 12757 <attribute name="supportedTpmTypes" type="TpmType" safearray="yes" readonly="yes"> 12758 <desc> 12759 Returns an array of officially supported values for enum <link to="TpmType"/>, 12760 in the sense of what is e.g. worth offering in the VirtualBox GUI. 12761 </desc> 12762 </attribute> 12763 12764 <method name="getMaxNetworkAdapters"> 12765 <desc> 12766 Maximum total number of network adapters associated with every 12767 <link to="IMachine"/> instance. 12768 </desc> 12769 12770 <param name="chipset" type="ChipsetType" dir="in"> 12771 <desc>The chipset type to get the value for.</desc> 12772 </param> 12773 12774 12775 <param name="maxNetworkAdapters" type="unsigned long" dir="return"> 12776 <desc>The maximum total number of network adapters allowed.</desc> 12777 </param> 12778 12779 </method> 12780 12781 <method name="getMaxNetworkAdaptersOfType"> 12782 <desc> 12783 Maximum number of network adapters of a given attachment type, 12784 associated with every <link to="IMachine"/> instance. 12785 </desc> 12786 12787 <param name="chipset" type="ChipsetType" dir="in"> 12788 <desc>The chipset type to get the value for.</desc> 12789 </param> 12790 12791 <param name="type" type="NetworkAttachmentType" dir="in"> 12792 <desc>Type of attachment.</desc> 12793 </param> 12794 12795 <param name="maxNetworkAdapters" type="unsigned long" dir="return"> 12796 <desc>The maximum number of network adapters allowed for 12797 particular chipset and attachment type.</desc> 12798 </param> 12799 12800 </method> 12801 12802 <method name="getMaxDevicesPerPortForStorageBus"> 12803 <desc>Returns the maximum number of devices which can be attached to a port 12804 for the given storage bus.</desc> 12805 12806 <param name="bus" type="StorageBus" dir="in"> 12807 <desc>The storage bus type to get the value for.</desc> 12808 </param> 12809 12810 <param name="maxDevicesPerPort" type="unsigned long" dir="return"> 12811 <desc>The maximum number of devices which can be attached to the port for the given 12812 storage bus.</desc> 12813 </param> 12814 </method> 12815 12816 <method name="getMinPortCountForStorageBus"> 12817 <desc>Returns the minimum number of ports the given storage bus supports.</desc> 12818 12819 <param name="bus" type="StorageBus" dir="in"> 12820 <desc>The storage bus type to get the value for.</desc> 12821 </param> 12822 12823 <param name="minPortCount" type="unsigned long" dir="return"> 12824 <desc>The minimum number of ports for the given storage bus.</desc> 12825 </param> 12826 </method> 12827 12828 <method name="getMaxPortCountForStorageBus"> 12829 <desc>Returns the maximum number of ports the given storage bus supports.</desc> 12830 12831 <param name="bus" type="StorageBus" dir="in"> 12832 <desc>The storage bus type to get the value for.</desc> 12833 </param> 12834 12835 <param name="maxPortCount" type="unsigned long" dir="return"> 12836 <desc>The maximum number of ports for the given storage bus.</desc> 12837 </param> 12838 </method> 12839 12840 <method name="getMaxInstancesOfStorageBus"> 12841 <desc>Returns the maximum number of storage bus instances which 12842 can be configured for each VM. This corresponds to the number of 12843 storage controllers one can have. Value may depend on chipset type 12844 used.</desc> 12845 12846 <param name="chipset" type="ChipsetType" dir="in"> 12847 <desc>The chipset type to get the value for.</desc> 12848 </param> 12849 12850 <param name="bus" type="StorageBus" dir="in"> 12851 <desc>The storage bus type to get the value for.</desc> 12852 </param> 12853 12854 <param name="maxInstances" type="unsigned long" dir="return"> 12855 <desc>The maximum number of instances for the given storage bus.</desc> 12856 </param> 12857 </method> 12858 12859 <method name="getDeviceTypesForStorageBus"> 12860 <desc>Returns list of all the supported device types 12861 (<link to="DeviceType"/>) for the given type of storage 12862 bus.</desc> 12863 12864 <param name="bus" type="StorageBus" dir="in"> 12865 <desc>The storage bus type to get the value for.</desc> 12866 </param> 12867 12868 <param name="deviceTypes" type="DeviceType" safearray="yes" dir="return"> 12869 <desc>The list of all supported device types for the given storage bus.</desc> 12870 </param> 12871 </method> 12872 12873 <method name="getStorageBusForStorageControllerType"> 12874 <desc>Returns the <link to="StorageBus"/> enum value 12875 for a given storage controller type.</desc> 12876 12877 <param name="storageControllerType" type="StorageControllerType" dir="in"> 12878 <desc>The storage controller type to get the value for.</desc> 12879 </param> 12880 12881 <param name="storageBus" type="StorageBus" dir="return"> 12882 <desc>The storage bus which is applicable.</desc> 12883 </param> 12884 </method> 12885 12886 <method name="getStorageControllerTypesForStorageBus"> 12887 <desc>Returns the possible <link to="StorageControllerType"/> enum values 12888 for a given storage bus.</desc> 12889 12890 <param name="storageBus" type="StorageBus" dir="in"> 12891 <desc>The storage bus type to get the values for.</desc> 12892 </param> 12893 12894 <param name="storageControllerType" type="StorageControllerType" safearray="yes" dir="return"> 12895 <desc>The enum values (sorted by what should be a sensible decreasing 12896 importance of the type) which are valid.</desc> 12897 </param> 12898 </method> 12899 12900 <method name="getStorageControllerHotplugCapable"> 12901 <desc>Returns whether the given storage controller supports 12902 hot-plugging devices.</desc> 12903 12904 <param name="controllerType" type="StorageControllerType" dir="in"> 12905 <desc>The storage controller to check the setting for.</desc> 12906 </param> 12907 12908 <param name="hotplugCapable" type="boolean" dir="return"> 12909 <desc>Returned flag indicating whether the controller is hotplug capable</desc> 12910 </param> 12911 </method> 12912 12913 <method name="getMaxInstancesOfUSBControllerType"> 12914 <desc>Returns the maximum number of USB controller instances which 12915 can be configured for each VM. This corresponds to the number of 12916 USB controllers one can have. Value may depend on chipset type 12917 used.</desc> 12918 12919 <param name="chipset" type="ChipsetType" dir="in"> 12920 <desc>The chipset type to get the value for.</desc> 12921 </param> 12922 12923 <param name="type" type="USBControllerType" dir="in"> 12924 <desc>The USB controller type to get the value for.</desc> 12925 </param> 12926 12927 <param name="maxInstances" type="unsigned long" dir="return"> 12928 <desc>The maximum number of instances for the given USB controller type.</desc> 12929 </param> 12930 </method> 12931 12932 </interface> 12933 12424 12934 <!-- 12425 12935 // ISystemProperties … … 12443 12953 name="ISystemProperties" 12444 12954 extends="$unknown" 12445 uuid=" aac6c7cb-a371-4c58-ab51-0616896b2f2c"12955 uuid="584dad7d-120f-40fa-91c2-fc520f60fdf2" 12446 12956 wsmap="managed" 12447 12957 rest="managed" … … 12457 12967 </desc> 12458 12968 12969 <attribute name="platform" type="IPlatformProperties" readonly="yes"> 12970 <desc>Platform properties of the VirtualBox installation.</desc> 12971 </attribute> 12972 12459 12973 <attribute name="minGuestRAM" type="unsigned long" readonly="yes"> 12460 12974 <desc>Minimum guest system memory in Megabytes.</desc> … … 12488 13002 <desc>Maximum size of a virtual disk image in bytes. Informational value, 12489 13003 does not reflect the limits of any virtual disk image format.</desc> 12490 </attribute>12491 12492 <attribute name="serialPortCount" type="unsigned long" readonly="yes">12493 <desc>12494 Maximum number of serial ports associated with every12495 <link to="IMachine"/> instance.12496 </desc>12497 </attribute>12498 12499 <attribute name="parallelPortCount" type="unsigned long" readonly="yes">12500 <desc>12501 Maximum number of parallel ports associated with every12502 <link to="IMachine"/> instance.12503 </desc>12504 </attribute>12505 12506 <attribute name="maxBootPosition" type="unsigned long" readonly="yes">12507 <desc>12508 Maximum device position in the boot order. This value corresponds12509 to the total number of devices a machine can boot from, to make it12510 possible to include all possible devices to the boot list.12511 <see><link to="IMachine::setBootOrder"/></see>12512 </desc>12513 </attribute>12514 12515 <attribute name="rawModeSupported" type="boolean" readonly="yes">12516 <desc>12517 Indicates whether VirtualBox was built with raw-mode support.12518 12519 When this reads as False, the <link to="HWVirtExPropertyType_Enabled"/>12520 setting will be ignored and assumed to be True.12521 </desc>12522 </attribute>12523 12524 <attribute name="exclusiveHwVirt" type="boolean">12525 <desc>12526 Exclusive use of hardware virtualization by VirtualBox. When enabled,12527 VirtualBox assumes it can obtain full and exclusive access to the VT-x12528 or AMD-V feature of the host. To share hardware virtualization with12529 other hypervisors, this property must be disabled.12530 12531 <note>This is ignored on OS X, the kernel mediates hardware12532 access there.</note>12533 </desc>12534 13004 </attribute> 12535 13005 … … 12796 13266 </attribute> 12797 13267 12798 <attribute name="supportedParavirtProviders" type="ParavirtProvider" safearray="yes" readonly="yes">12799 <desc>12800 Returns an array of officially supported values for enum <link to="ParavirtProvider"/>,12801 in the sense of what is e.g. worth offering in the VirtualBox GUI.12802 </desc>12803 </attribute>12804 12805 13268 <attribute name="supportedClipboardModes" type="ClipboardMode" safearray="yes" readonly="yes"> 12806 13269 <desc> … … 12817 13280 </attribute> 12818 13281 12819 <attribute name="supportedFirmwareTypes" type="FirmwareType" safearray="yes" readonly="yes">12820 <desc>12821 Returns an array of officially supported values for enum <link to="FirmwareType"/>,12822 in the sense of what is e.g. worth offering in the VirtualBox GUI.12823 </desc>12824 </attribute>12825 12826 13282 <attribute name="supportedPointingHIDTypes" type="PointingHIDType" safearray="yes" readonly="yes"> 12827 13283 <desc> … … 12901 13357 </attribute> 12902 13358 12903 <attribute name="supportedGraphicsControllerTypes" type="GraphicsControllerType" safearray="yes" readonly="yes">12904 <desc>12905 Returns an array of officially supported values for enum <link to="GraphicsControllerType"/>,12906 in the sense of what is e.g. worth offering in the VirtualBox GUI.12907 </desc>12908 </attribute>12909 12910 13359 <attribute name="supportedCloneOptions" type="CloneOptions" safearray="yes" readonly="yes"> 12911 13360 <desc> … … 12936 13385 </attribute> 12937 13386 12938 <attribute name="supportedNetworkAdapterTypes" type="NetworkAdapterType" safearray="yes" readonly="yes">12939 <desc>12940 Returns an array of officially supported values for enum <link to="NetworkAdapterType"/>,12941 in the sense of what is e.g. worth offering in the VirtualBox GUI.12942 </desc>12943 </attribute>12944 12945 13387 <attribute name="supportedPortModes" type="PortMode" safearray="yes" readonly="yes"> 12946 13388 <desc> … … 12950 13392 </attribute> 12951 13393 12952 <attribute name="supportedUartTypes" type="UartType" safearray="yes" readonly="yes">12953 <desc>12954 Returns an array of officially supported values for enum <link to="UartType"/>,12955 in the sense of what is e.g. worth offering in the VirtualBox GUI.12956 </desc>12957 </attribute>12958 12959 <attribute name="supportedUSBControllerTypes" type="USBControllerType" safearray="yes" readonly="yes">12960 <desc>12961 Returns an array of officially supported values for enum <link to="USBControllerType"/>,12962 in the sense of what is e.g. worth offering in the VirtualBox GUI.12963 </desc>12964 </attribute>12965 12966 13394 <attribute name="supportedAudioDriverTypes" type="AudioDriverType" safearray="yes" readonly="yes"> 12967 13395 <desc> … … 12971 13399 </attribute> 12972 13400 12973 <attribute name="supportedAudioControllerTypes" type="AudioControllerType" safearray="yes" readonly="yes">12974 <desc>12975 Returns an array of officially supported values for enum <link to="AudioControllerType"/>,12976 in the sense of what is e.g. worth offering in the VirtualBox GUI.12977 </desc>12978 </attribute>12979 12980 <attribute name="supportedStorageBuses" type="StorageBus" safearray="yes" readonly="yes">12981 <desc>12982 Returns an array of officially supported values for enum <link to="StorageBus"/>,12983 in the sense of what is e.g. worth offering in the VirtualBox GUI.12984 </desc>12985 </attribute>12986 12987 <attribute name="supportedStorageControllerTypes" type="StorageControllerType" safearray="yes" readonly="yes">12988 <desc>12989 Returns an array of officially supported values for enum <link to="StorageControllerType"/>,12990 in the sense of what is e.g. worth offering in the VirtualBox GUI.12991 </desc>12992 </attribute>12993 12994 <attribute name="supportedChipsetTypes" type="ChipsetType" safearray="yes" readonly="yes">12995 <desc>12996 Returns an array of officially supported values for enum <link to="ChipsetType"/>,12997 in the sense of what is e.g. worth offering in the VirtualBox GUI.12998 </desc>12999 </attribute>13000 13001 <attribute name="supportedIommuTypes" type="IommuType" safearray="yes" readonly="yes">13002 <desc>13003 Returns an array of officially supported values for enum <link to="IommuType"/>,13004 in the sense of what is e.g. worth offering in the VirtualBox GUI.13005 </desc>13006 </attribute>13007 13008 <attribute name="supportedTpmTypes" type="TpmType" safearray="yes" readonly="yes">13009 <desc>13010 Returns an array of officially supported values for enum <link to="TpmType"/>,13011 in the sense of what is e.g. worth offering in the VirtualBox GUI.13012 </desc>13013 </attribute>13014 13015 13401 <attribute name="languageId" type="wstring"> 13016 13402 <desc> … … 13018 13404 </desc> 13019 13405 </attribute> 13020 13021 <method name="getMaxNetworkAdapters">13022 <desc>13023 Maximum total number of network adapters associated with every13024 <link to="IMachine"/> instance.13025 </desc>13026 13027 <param name="chipset" type="ChipsetType" dir="in">13028 <desc>The chipset type to get the value for.</desc>13029 </param>13030 13031 13032 <param name="maxNetworkAdapters" type="unsigned long" dir="return">13033 <desc>The maximum total number of network adapters allowed.</desc>13034 </param>13035 13036 </method>13037 13038 <method name="getMaxNetworkAdaptersOfType">13039 <desc>13040 Maximum number of network adapters of a given attachment type,13041 associated with every <link to="IMachine"/> instance.13042 </desc>13043 13044 <param name="chipset" type="ChipsetType" dir="in">13045 <desc>The chipset type to get the value for.</desc>13046 </param>13047 13048 <param name="type" type="NetworkAttachmentType" dir="in">13049 <desc>Type of attachment.</desc>13050 </param>13051 13052 <param name="maxNetworkAdapters" type="unsigned long" dir="return">13053 <desc>The maximum number of network adapters allowed for13054 particular chipset and attachment type.</desc>13055 </param>13056 13057 </method>13058 13059 13060 <method name="getMaxDevicesPerPortForStorageBus">13061 <desc>Returns the maximum number of devices which can be attached to a port13062 for the given storage bus.</desc>13063 13064 <param name="bus" type="StorageBus" dir="in">13065 <desc>The storage bus type to get the value for.</desc>13066 </param>13067 13068 <param name="maxDevicesPerPort" type="unsigned long" dir="return">13069 <desc>The maximum number of devices which can be attached to the port for the given13070 storage bus.</desc>13071 </param>13072 </method>13073 13074 <method name="getMinPortCountForStorageBus">13075 <desc>Returns the minimum number of ports the given storage bus supports.</desc>13076 13077 <param name="bus" type="StorageBus" dir="in">13078 <desc>The storage bus type to get the value for.</desc>13079 </param>13080 13081 <param name="minPortCount" type="unsigned long" dir="return">13082 <desc>The minimum number of ports for the given storage bus.</desc>13083 </param>13084 </method>13085 13086 <method name="getMaxPortCountForStorageBus">13087 <desc>Returns the maximum number of ports the given storage bus supports.</desc>13088 13089 <param name="bus" type="StorageBus" dir="in">13090 <desc>The storage bus type to get the value for.</desc>13091 </param>13092 13093 <param name="maxPortCount" type="unsigned long" dir="return">13094 <desc>The maximum number of ports for the given storage bus.</desc>13095 </param>13096 </method>13097 13098 <method name="getMaxInstancesOfStorageBus">13099 <desc>Returns the maximum number of storage bus instances which13100 can be configured for each VM. This corresponds to the number of13101 storage controllers one can have. Value may depend on chipset type13102 used.</desc>13103 13104 <param name="chipset" type="ChipsetType" dir="in">13105 <desc>The chipset type to get the value for.</desc>13106 </param>13107 13108 <param name="bus" type="StorageBus" dir="in">13109 <desc>The storage bus type to get the value for.</desc>13110 </param>13111 13112 <param name="maxInstances" type="unsigned long" dir="return">13113 <desc>The maximum number of instances for the given storage bus.</desc>13114 </param>13115 </method>13116 13117 <method name="getDeviceTypesForStorageBus">13118 <desc>Returns list of all the supported device types13119 (<link to="DeviceType"/>) for the given type of storage13120 bus.</desc>13121 13122 <param name="bus" type="StorageBus" dir="in">13123 <desc>The storage bus type to get the value for.</desc>13124 </param>13125 13126 <param name="deviceTypes" type="DeviceType" safearray="yes" dir="return">13127 <desc>The list of all supported device types for the given storage bus.</desc>13128 </param>13129 </method>13130 13131 <method name="getStorageBusForStorageControllerType">13132 <desc>Returns the <link to="StorageBus"/> enum value13133 for a given storage controller type.</desc>13134 13135 <param name="storageControllerType" type="StorageControllerType" dir="in">13136 <desc>The storage controller type to get the value for.</desc>13137 </param>13138 13139 <param name="storageBus" type="StorageBus" dir="return">13140 <desc>The storage bus which is applicable.</desc>13141 </param>13142 </method>13143 13144 <method name="getStorageControllerTypesForStorageBus">13145 <desc>Returns the possible <link to="StorageControllerType"/> enum values13146 for a given storage bus.</desc>13147 13148 <param name="storageBus" type="StorageBus" dir="in">13149 <desc>The storage bus type to get the values for.</desc>13150 </param>13151 13152 <param name="storageControllerType" type="StorageControllerType" safearray="yes" dir="return">13153 <desc>The enum values (sorted by what should be a sensible decreasing13154 importance of the type) which are valid.</desc>13155 </param>13156 </method>13157 13406 13158 13407 <method name="getDefaultIoCacheSettingForStorageController" dtracename="getDefaultStorageCtrlCacheSetting"> … … 13166 13415 <param name="enabled" type="boolean" dir="return"> 13167 13416 <desc>Returned flag indicating the default value</desc> 13168 </param>13169 </method>13170 13171 <method name="getStorageControllerHotplugCapable">13172 <desc>Returns whether the given storage controller supports13173 hot-plugging devices.</desc>13174 13175 <param name="controllerType" type="StorageControllerType" dir="in">13176 <desc>The storage controller to check the setting for.</desc>13177 </param>13178 13179 <param name="hotplugCapable" type="boolean" dir="return">13180 <desc>Returned flag indicating whether the controller is hotplug capable</desc>13181 </param>13182 </method>13183 13184 <method name="getMaxInstancesOfUSBControllerType">13185 <desc>Returns the maximum number of USB controller instances which13186 can be configured for each VM. This corresponds to the number of13187 USB controllers one can have. Value may depend on chipset type13188 used.</desc>13189 13190 <param name="chipset" type="ChipsetType" dir="in">13191 <desc>The chipset type to get the value for.</desc>13192 </param>13193 13194 <param name="type" type="USBControllerType" dir="in">13195 <desc>The USB controller type to get the value for.</desc>13196 </param>13197 13198 <param name="maxInstances" type="unsigned long" dir="return">13199 <desc>The maximum number of instances for the given USB controller type.</desc>13200 13417 </param> 13201 13418 </method> … … 13230 13447 > 13231 13448 <desc> 13449 Specifies a guest OS type and its recommendations. 13232 13450 </desc> 13233 13451 … … 13253 13471 13254 13472 <attribute name="recommendedIOAPIC" type="boolean" readonly="yes"> 13255 <desc>Returns @c true if I/O-APIC recommended for this OS type. </desc>13473 <desc>Returns @c true if I/O-APIC recommended for this OS type. Only applies to x86-based platforms.</desc> 13256 13474 </attribute> 13257 13475 13258 13476 <attribute name="recommendedVirtEx" type="boolean" readonly="yes"> 13259 <desc>Returns @c true if VT-x or AMD-V recommended for this OS type. </desc>13477 <desc>Returns @c true if VT-x or AMD-V recommended for this OS type. Only applies to x86-based platforms.</desc> 13260 13478 </attribute> 13261 13479 … … 13289 13507 13290 13508 <attribute name="recommendedPAE" type="boolean" readonly="yes"> 13291 <desc>Returns @c true if using PAE is recommended for this OS type. </desc>13509 <desc>Returns @c true if using PAE is recommended for this OS type. Only applies to x86-based platforms.</desc> 13292 13510 </attribute> 13293 13511 … … 13317 13535 13318 13536 <attribute name="recommendedHPET" type="boolean" readonly="yes"> 13319 <desc>Returns @c true if using HPET is recommended for this OS type. </desc>13537 <desc>Returns @c true if using HPET is recommended for this OS type. Only applies to x86-based platforms.</desc> 13320 13538 </attribute> 13321 13539 … … 13325 13543 13326 13544 <attribute name="recommendedRTCUseUTC" type="boolean" readonly="yes"> 13327 <desc>Returns @c true if the RTC of this VM should be set to UTC </desc>13545 <desc>Returns @c true if the RTC of this VM should be set to UTC.</desc> 13328 13546 </attribute> 13329 13547 … … 13356 13574 </attribute> 13357 13575 13576 <!-- @todo r=bird: Rename this to some more generic term that can be applied to ARM? --> 13358 13577 <attribute name="recommendedTFReset" type="boolean" readonly="yes"> 13359 13578 <desc>Returns @c true if using VCPU reset on triple fault is recommended for this OS type.</desc> … … 13361 13580 13362 13581 <attribute name="recommendedX2APIC" type="boolean" readonly="yes"> 13363 <desc>Returns @c true if X2APIC is recommended for this OS type. </desc>13582 <desc>Returns @c true if X2APIC is recommended for this OS type. Only applies to x86-based platforms.</desc> 13364 13583 </attribute> 13365 13584 … … 22048 22267 </attribute> 22049 22268 22050 <attribute name="IO Base" type="unsigned long">22051 <desc>Base I/O address of the serial port. </desc>22269 <attribute name="IOAddress" type="unsigned long"> 22270 <desc>Base I/O address of the serial port. For x86, this is an I/O port, for ARM this is an MMIO address.</desc> 22052 22271 </attribute> 22053 22272 … … 22136 22355 22137 22356 <attribute name="IOBase" type="unsigned long"> 22138 <desc>Base I/O address of the parallel port. </desc>22357 <desc>Base I/O address of the parallel port. Only for X86-based platforms.</desc> 22139 22358 </attribute> 22140 22359 22141 22360 <attribute name="IRQ" type="unsigned long"> 22142 <desc>IRQ number of the parallel port. </desc>22361 <desc>IRQ number of the parallel port. Only for X86-based platforms.</desc> 22143 22362 </attribute> 22144 22363 … … 22173 22392 </const> 22174 22393 <const name="HwVirt" value="2"> 22175 <desc>Hardware assisted virtualization thru HM. </desc>22394 <desc>Hardware assisted virtualization thru HM. Only for x86-based hosts.</desc> 22176 22395 </const> 22177 22396 <const name="NativeApi" value="3"> … … 23497 23716 <enum 23498 23717 name="AudioControllerType" 23499 uuid=" 7afd395c-42c3-444e-8788-3ce80292f36c"23718 uuid="6389dcc9-4e60-4983-9418-299e602efafc" 23500 23719 > 23501 23720 <desc> … … 23503 23722 </desc> 23504 23723 23505 <const name="AC97" value="0"/> 23506 <const name="SB16" value="1"/> 23507 <const name="HDA" value="2"/> 23724 <const name="AC97" value="0"/> 23725 <const name="SB16" value="1"/> 23726 <const name="HDA" value="2"/> 23727 <const name="VirtioSound" value="3"/> 23508 23728 </enum> 23509 23729 … … 25005 25225 <enum 25006 25226 name="ChipsetType" 25007 uuid=" 8b4096a8-a7c3-4d3b-bbb1-05a0a51ec394"25008 > 25009 <desc> 25010 Type of emulated chipset ( mostly southbridge).25227 uuid="733d5f16-1f47-4e25-b272-d7c138bc2e3d" 25228 > 25229 <desc> 25230 Type of emulated chipset (think x86 southbridge or ARM SoC/board). 25011 25231 </desc> 25012 25232 … … 25015 25235 </const> 25016 25236 <const name="PIIX3" value="1"> 25017 <desc> A PIIX3 (PCI IDE ISA Xcelerator) chipset.</desc>25237 <desc>x86: A PIIX3 (PCI IDE ISA Xcelerator) chipset.</desc> 25018 25238 </const> 25019 25239 <const name="ICH9" value="2"> 25020 <desc>A ICH9 (I/O Controller Hub) chipset.</desc> 25240 <desc>x86: A ICH9 (I/O Controller Hub) chipset.</desc> 25241 </const> 25242 <const name="ARMv8Virtual" value="3"> 25243 <desc>ARM: Virtual ARMv8 base platform (board).</desc> 25021 25244 </const> 25022 25245 </enum> -
trunk/src/VBox/Main/include/ConsoleImpl.h
r100609 r101035 739 739 const ComPtr<IMachine> &ptrMachine, 740 740 const ComPtr<IGraphicsAdapter> &ptrGraphicsAdapter, 741 const ComPtr<I BIOSSettings> &ptrBiosSettings,741 const ComPtr<IFirmwareSettings> &ptrFirmwareSettings, 742 742 bool fHMEnabled); 743 743 int i_checkMediumLocation(IMedium *pMedium, bool *pfUseHostIOCache); -
trunk/src/VBox/Main/include/Global.h
r98103 r101035 124 124 125 125 /** 126 * Get the network adapter limit for each chipset type.127 */128 static uint32_t getMaxNetworkAdapters(ChipsetType_T aChipsetType);129 130 /**131 126 * Returns @c true if the given machine state is an online state. This is a 132 127 * recommended way to detect if the VM is online (being executed in a -
trunk/src/VBox/Main/include/HostImpl.h
r98103 r101035 109 109 110 110 // wrapped IHost properties 111 HRESULT getArchitecture(PlatformArchitecture_T *platformArchitecture); 111 112 HRESULT getDVDDrives(std::vector<ComPtr<IMedium> > &aDVDDrives); 112 113 HRESULT getFloppyDrives(std::vector<ComPtr<IMedium> > &aFloppyDrives); … … 137 138 HRESULT getUpdateURL(com::Utf8Str &aUpdateURL); 138 139 HRESULT getUpdateCheckNeeded(BOOL *aUpdateCheckNeeded); 140 HRESULT getX86(ComPtr<IHostX86> &aHostX86); 139 141 140 142 // wrapped IHost methods … … 145 147 HRESULT getProcessorDescription(ULONG aCpuId, 146 148 com::Utf8Str &aDescription); 147 HRESULT getProcessorCPUIDLeaf(ULONG aCpuId,148 ULONG aLeaf,149 ULONG aSubLeaf,150 ULONG *aValEax,151 ULONG *aValEbx,152 ULONG *aValEcx,153 ULONG *aValEdx);154 149 HRESULT createHostOnlyNetworkInterface(ComPtr<IHostNetworkInterface> &aHostInterface, 155 150 ComPtr<IProgress> &aProgress); -
trunk/src/VBox/Main/include/MachineImpl.h
r98288 r101035 43 43 #include "SerialPortImpl.h" 44 44 #include "ParallelPortImpl.h" 45 #include " BIOSSettingsImpl.h"45 #include "FirmwareSettingsImpl.h" 46 46 #include "RecordingSettingsImpl.h" 47 47 #include "GraphicsAdapterImpl.h" … … 57 57 # include "PerformanceImpl.h" 58 58 #endif 59 #include "PlatformImpl.h" 60 #include "PlatformPropertiesImpl.h" 59 61 #include "ThreadTask.h" 60 62 … … 304 306 BOOL mPageFusionEnabled; 305 307 settings::RecordingSettings mRecordSettings; 306 BOOL mHWVirtExEnabled;307 BOOL mHWVirtExNestedPagingEnabled;308 BOOL mHWVirtExLargePagesEnabled;309 BOOL mHWVirtExVPIDEnabled;310 BOOL mHWVirtExUXEnabled;311 BOOL mHWVirtExForceEnabled;312 BOOL mHWVirtExUseNativeApi;313 BOOL mHWVirtExVirtVmsaveVmload;314 BOOL mPAEEnabled;315 settings::Hardware::LongModeType mLongMode;316 BOOL mTripleFaultReset;317 BOOL mAPIC;318 BOOL mX2APIC;319 BOOL mIBPBOnVMExit;320 BOOL mIBPBOnVMEntry;321 BOOL mSpecCtrl;322 BOOL mSpecCtrlByHost;323 BOOL mL1DFlushOnSched;324 BOOL mL1DFlushOnVMEntry;325 BOOL mMDSClearOnSched;326 BOOL mMDSClearOnVMEntry;327 BOOL mNestedHWVirt;328 308 ULONG mCPUCount; 329 309 BOOL mCPUHotPlugEnabled; … … 331 311 uint32_t mCpuIdPortabilityLevel; 332 312 Utf8Str mCpuProfile; 333 BOOL mHPETEnabled;334 313 335 314 BOOL mCPUAttached[SchemaDefs::MaxCPUCount]; 336 337 std::list<settings::CpuIdLeaf> mCpuIdLeafList;338 315 339 316 DeviceType_T mBootOrder[SchemaDefs::MaxBootPosition]; … … 350 327 GuestPropertyMap mGuestProperties; 351 328 352 FirmwareType_T mFirmwareType;353 329 KeyboardHIDType_T mKeyboardHIDType; 354 330 PointingHIDType_T mPointingHIDType; 355 ChipsetType_T mChipsetType;356 IommuType_T mIommuType;357 331 ParavirtProvider_T mParavirtProvider; 358 332 Utf8Str mParavirtDebug; … … 384 358 const Utf8Str &strConfigFile, 385 359 const Utf8Str &strName, 360 PlatformArchitecture_T aArchitecture, 386 361 const StringsList &llGroups, 387 362 const Utf8Str &strOsTypeId, … … 463 438 464 439 /** 440 * Returns the machine's platform object. 441 * 442 * @returns Platform object. 443 */ 444 Platform *i_getPlatform() const { return mPlatform; } 445 446 /** 447 * Returns the machine's platform properties object. 448 * 449 * @returns Platform properties object. 450 */ 451 PlatformProperties *i_getPlatformProperties() const { return mPlatformProperties; } 452 453 /** 465 454 * Checks if this machine is accessible, without attempting to load the 466 455 * config file. … … 519 508 IsModified_AudioSettings = 0x000080, 520 509 IsModified_USB = 0x000100, 521 IsModified_ BIOS= 0x000200,510 IsModified_Firmware = 0x000200, 522 511 IsModified_SharedFolders = 0x000400, 523 512 IsModified_Snapshots = 0x000800, … … 528 517 IsModified_NvramStore = 0x010000, 529 518 IsModified_GuestDebugControl = 0x020000, 519 IsModified_Platform = 0x040000, 530 520 }; 531 521 … … 538 528 */ 539 529 Utf8Str i_getOSTypeId() const { return mUserData->s.strOsType; } 540 ChipsetType_T i_getChipsetType() const { return mHWData->mChipsetType; } 541 FirmwareType_T i_getFirmwareType() const { return mHWData->mFirmwareType; } 530 FirmwareType_T i_getFirmwareType() const; 542 531 ParavirtProvider_T i_getParavirtProvider() const { return mHWData->mParavirtProvider; } 543 532 Utf8Str i_getParavirtDebug() const { return mHWData->mParavirtDebug; } … … 591 580 Utf8Str i_getDefaultNVRAMFilename(); 592 581 Utf8Str i_getSnapshotNVRAMFilename(); 582 NvramStore *i_getNVRAMStore() const { return mNvramStore; }; 593 583 SettingsVersion_T i_getSettingsVersion(void); 594 584 … … 809 799 #endif /* VBOX_WITH_RESOURCE_USAGE_API */ 810 800 801 void i_platformPropertiesUpdate(); 802 811 803 Machine * const mPeer; 812 804 … … 818 810 Backupable<UserData> mUserData; 819 811 Backupable<HWData> mHWData; 812 813 // const objectsf not requiring locking 814 /** The machine's platform properties. 815 * We keep a (const) object around for performance reasons. */ 816 const ComObjPtr<PlatformProperties> mPlatformProperties; 820 817 821 818 /** … … 840 837 const ComObjPtr<AudioSettings> mAudioSettings; 841 838 const ComObjPtr<USBDeviceFilters> mUSBDeviceFilters; 842 const ComObjPtr<BIOSSettings> mBIOSSettings; 839 const ComObjPtr<Platform> mPlatform; 840 const ComObjPtr<FirmwareSettings> mFirmwareSettings; 843 841 const ComObjPtr<RecordingSettings> mRecordingSettings; 844 842 const ComObjPtr<GraphicsAdapter> mGraphicsAdapter; … … 907 905 908 906 friend class Appliance; 907 friend class Platform; 908 friend class PlatformX86; 909 909 friend class RecordingSettings; 910 910 friend class RecordingScreenSettings; … … 918 918 // wrapped IMachine properties 919 919 HRESULT getParent(ComPtr<IVirtualBox> &aParent); 920 HRESULT getPlatform(ComPtr<IPlatform> &aPlatform); 920 921 HRESULT getIcon(std::vector<BYTE> &aIcon); 921 922 HRESULT setIcon(const std::vector<BYTE> &aIcon); … … 952 953 HRESULT setPageFusionEnabled(BOOL aPageFusionEnabled); 953 954 HRESULT getGraphicsAdapter(ComPtr<IGraphicsAdapter> &aGraphicsAdapter); 954 HRESULT get BIOSSettings(ComPtr<IBIOSSettings> &aBIOSSettings);955 HRESULT getFirmwareSettings(ComPtr<IFirmwareSettings> &aFirmwareSettings); 955 956 HRESULT getTrustedPlatformModule(ComPtr<ITrustedPlatformModule> &aTrustedPlatformModule); 956 957 HRESULT getNonVolatileStore(ComPtr<INvramStore> &aNvramStore); 957 958 HRESULT getRecordingSettings(ComPtr<IRecordingSettings> &aRecordingSettings); 958 HRESULT getFirmwareType(FirmwareType_T *aFirmwareType);959 HRESULT setFirmwareType(FirmwareType_T aFirmwareType);960 959 HRESULT getPointingHIDType(PointingHIDType_T *aPointingHIDType); 961 960 HRESULT setPointingHIDType(PointingHIDType_T aPointingHIDType); 962 961 HRESULT getKeyboardHIDType(KeyboardHIDType_T *aKeyboardHIDType); 963 962 HRESULT setKeyboardHIDType(KeyboardHIDType_T aKeyboardHIDType); 964 HRESULT getHPETEnabled(BOOL *aHPETEnabled);965 HRESULT setHPETEnabled(BOOL aHPETEnabled);966 HRESULT getChipsetType(ChipsetType_T *aChipsetType);967 HRESULT setChipsetType(ChipsetType_T aChipsetType);968 HRESULT getIommuType(IommuType_T *aIommuType);969 HRESULT setIommuType(IommuType_T aIommuType);970 963 HRESULT getSnapshotFolder(com::Utf8Str &aSnapshotFolder); 971 964 HRESULT setSnapshotFolder(const com::Utf8Str &aSnapshotFolder); … … 1011 1004 HRESULT getParavirtDebug(com::Utf8Str &aParavirtDebug); 1012 1005 HRESULT setParavirtDebug(const com::Utf8Str &aParavirtDebug); 1013 HRESULT getRTCUseUTC(BOOL *aRTCUseUTC);1014 HRESULT setRTCUseUTC(BOOL aRTCUseUTC);1015 1006 HRESULT getIOCacheEnabled(BOOL *aIOCacheEnabled); 1016 1007 HRESULT setIOCacheEnabled(BOOL aIOCacheEnabled); … … 1145 1136 HRESULT setExtraData(const com::Utf8Str &aKey, 1146 1137 const com::Utf8Str &aValue); 1147 HRESULT getCPUProperty(CPUPropertyType_T aProperty,1148 BOOL *aValue);1149 HRESULT setCPUProperty(CPUPropertyType_T aProperty,1150 BOOL aValue);1151 HRESULT getCPUIDLeafByOrdinal(ULONG aOrdinal,1152 ULONG *aIdx,1153 ULONG *aSubIdx,1154 ULONG *aValEax,1155 ULONG *aValEbx,1156 ULONG *aValEcx,1157 ULONG *aValEdx);1158 HRESULT getCPUIDLeaf(ULONG aIdx, ULONG aSubIdx,1159 ULONG *aValEax,1160 ULONG *aValEbx,1161 ULONG *aValEcx,1162 ULONG *aValEdx);1163 HRESULT setCPUIDLeaf(ULONG aIdx, ULONG aSubIdx,1164 ULONG aValEax,1165 ULONG aValEbx,1166 ULONG aValEcx,1167 ULONG aValEdx);1168 HRESULT removeCPUIDLeaf(ULONG aIdx, ULONG aSubIdx);1169 HRESULT removeAllCPUIDLeaves();1170 HRESULT getHWVirtExProperty(HWVirtExPropertyType_T aProperty,1171 BOOL *aValue);1172 HRESULT setHWVirtExProperty(HWVirtExPropertyType_T aProperty,1173 BOOL aValue);1174 1138 HRESULT setSettingsFilePath(const com::Utf8Str &aSettingsFilePath, 1175 1139 ComPtr<IProgress> &aProgress); -
trunk/src/VBox/Main/include/SerialPortImpl.h
r98103 r101035 86 86 HRESULT getIRQ(ULONG *aIRQ); 87 87 HRESULT setIRQ(ULONG aIRQ); 88 HRESULT getIO Base(ULONG *aIOBase);89 HRESULT setIO Base(ULONG aIOBase);88 HRESULT getIOAddress(ULONG *aIOAddress); 89 HRESULT setIOAddress(ULONG aIOAddress); 90 90 HRESULT getServer(BOOL *aServer); 91 91 HRESULT setServer(BOOL aServer); -
trunk/src/VBox/Main/include/SystemPropertiesImpl.h
r98103 r101035 38 38 39 39 class CPUProfile; 40 class PlatformProperties; 40 41 41 42 namespace settings … … 84 85 HRESULT getMaxGuestMonitors(ULONG *aMaxGuestMonitors) RT_OVERRIDE; 85 86 HRESULT getInfoVDSize(LONG64 *aInfoVDSize) RT_OVERRIDE; 86 HRESULT getSerialPortCount(ULONG *aSerialPortCount) RT_OVERRIDE;87 HRESULT getParallelPortCount(ULONG *aParallelPortCount) RT_OVERRIDE;88 HRESULT getMaxBootPosition(ULONG *aMaxBootPosition) RT_OVERRIDE;89 HRESULT getRawModeSupported(BOOL *aRawModeSupported) RT_OVERRIDE;90 HRESULT getExclusiveHwVirt(BOOL *aExclusiveHwVirt) RT_OVERRIDE;91 HRESULT setExclusiveHwVirt(BOOL aExclusiveHwVirt) RT_OVERRIDE;92 87 HRESULT getDefaultMachineFolder(com::Utf8Str &aDefaultMachineFolder) RT_OVERRIDE; 93 88 HRESULT setDefaultMachineFolder(const com::Utf8Str &aDefaultMachineFolder) RT_OVERRIDE; … … 123 118 HRESULT setDefaultFrontend(const com::Utf8Str &aDefaultFrontend) RT_OVERRIDE; 124 119 HRESULT getScreenShotFormats(std::vector<BitmapFormat_T> &aScreenShotFormats) RT_OVERRIDE; 120 HRESULT getPlatform(ComPtr<IPlatformProperties> &aPlatformProperties) RT_OVERRIDE; 125 121 HRESULT getProxyMode(ProxyMode_T *pProxyMode) RT_OVERRIDE; 126 122 HRESULT setProxyMode(ProxyMode_T aProxyMode) RT_OVERRIDE; 127 123 HRESULT getProxyURL(com::Utf8Str &aProxyURL) RT_OVERRIDE; 128 124 HRESULT setProxyURL(const com::Utf8Str &aProxyURL) RT_OVERRIDE; 129 HRESULT getSupportedParavirtProviders(std::vector<ParavirtProvider_T> &aSupportedParavirtProviders) RT_OVERRIDE;130 125 HRESULT getSupportedClipboardModes(std::vector<ClipboardMode_T> &aSupportedClipboardModes) RT_OVERRIDE; 131 126 HRESULT getSupportedDnDModes(std::vector<DnDMode_T> &aSupportedDnDModes) RT_OVERRIDE; 132 HRESULT getSupportedFirmwareTypes(std::vector<FirmwareType_T> &aSupportedFirmwareTypes) RT_OVERRIDE;133 127 HRESULT getSupportedPointingHIDTypes(std::vector<PointingHIDType_T> &aSupportedPointingHIDTypes) RT_OVERRIDE; 134 128 HRESULT getSupportedKeyboardHIDTypes(std::vector<KeyboardHIDType_T> &aSupportedKeyboardHIDTypes) RT_OVERRIDE; … … 142 136 HRESULT getSupportedRecordingARCModes(std::vector<RecordingRateControlMode_T> &aSupportedRecordingAudioRateControlModes) RT_OVERRIDE; 143 137 HRESULT getSupportedRecordingVRCModes(std::vector<RecordingRateControlMode_T> &aSupportedRecordingVideoRateControlModes) RT_OVERRIDE; 144 HRESULT getSupportedGraphicsControllerTypes(std::vector<GraphicsControllerType_T> &aSupportedGraphicsControllerTypes) RT_OVERRIDE;145 138 HRESULT getSupportedCloneOptions(std::vector<CloneOptions_T> &aSupportedCloneOptions) RT_OVERRIDE; 146 139 HRESULT getSupportedAutostopTypes(std::vector<AutostopType_T> &aSupportedAutostopTypes) RT_OVERRIDE; 147 140 HRESULT getSupportedVMProcPriorities(std::vector<VMProcPriority_T> &aSupportedVMProcPriorities) RT_OVERRIDE; 148 141 HRESULT getSupportedNetworkAttachmentTypes(std::vector<NetworkAttachmentType_T> &aSupportedNetworkAttachmentTypes) RT_OVERRIDE; 149 HRESULT getSupportedNetworkAdapterTypes(std::vector<NetworkAdapterType_T> &aSupportedNetworkAdapterTypes) RT_OVERRIDE;150 142 HRESULT getSupportedPortModes(std::vector<PortMode_T> &aSupportedPortModes) RT_OVERRIDE; 151 HRESULT getSupportedUartTypes(std::vector<UartType_T> &aSupportedUartTypes) RT_OVERRIDE;152 HRESULT getSupportedUSBControllerTypes(std::vector<USBControllerType_T> &aSupportedUSBControllerTypes) RT_OVERRIDE;153 143 HRESULT getSupportedAudioDriverTypes(std::vector<AudioDriverType_T> &aSupportedAudioDriverTypes) RT_OVERRIDE; 154 HRESULT getSupportedAudioControllerTypes(std::vector<AudioControllerType_T> &aSupportedAudioControllerTypes) RT_OVERRIDE;155 HRESULT getSupportedStorageBuses(std::vector<StorageBus_T> &aSupportedStorageBuses) RT_OVERRIDE;156 HRESULT getSupportedStorageControllerTypes(std::vector<StorageControllerType_T> &aSupportedStorageControllerTypes) RT_OVERRIDE;157 HRESULT getSupportedChipsetTypes(std::vector<ChipsetType_T> &aSupportedChipsetTypes) RT_OVERRIDE;158 HRESULT getSupportedIommuTypes(std::vector<IommuType_T> &aSupportedIommuTypes) RT_OVERRIDE;159 HRESULT getSupportedTpmTypes(std::vector<TpmType_T> &aSupportedTpmTypes) RT_OVERRIDE;160 144 HRESULT getLanguageId(com::Utf8Str &aLanguageId) RT_OVERRIDE; 161 145 HRESULT setLanguageId(const com::Utf8Str &aLanguageId) RT_OVERRIDE; 162 146 163 147 // wrapped ISystemProperties methods 164 HRESULT getMaxNetworkAdapters(ChipsetType_T aChipset,165 ULONG *aMaxNetworkAdapters) RT_OVERRIDE;166 HRESULT getMaxNetworkAdaptersOfType(ChipsetType_T aChipset,167 NetworkAttachmentType_T aType,168 ULONG *aMaxNetworkAdapters) RT_OVERRIDE;169 HRESULT getMaxDevicesPerPortForStorageBus(StorageBus_T aBus,170 ULONG *aMaxDevicesPerPort) RT_OVERRIDE;171 HRESULT getMinPortCountForStorageBus(StorageBus_T aBus,172 ULONG *aMinPortCount) RT_OVERRIDE;173 HRESULT getMaxPortCountForStorageBus(StorageBus_T aBus,174 ULONG *aMaxPortCount) RT_OVERRIDE;175 HRESULT getMaxInstancesOfStorageBus(ChipsetType_T aChipset,176 StorageBus_T aBus,177 ULONG *aMaxInstances) RT_OVERRIDE;178 HRESULT getDeviceTypesForStorageBus(StorageBus_T aBus,179 std::vector<DeviceType_T> &aDeviceTypes) RT_OVERRIDE;180 HRESULT getStorageBusForStorageControllerType(StorageControllerType_T aStorageControllerType,181 StorageBus_T *aStorageBus) RT_OVERRIDE;182 HRESULT getStorageControllerTypesForStorageBus(StorageBus_T aStorageBus,183 std::vector<StorageControllerType_T> &aStorageControllerTypes) RT_OVERRIDE;184 148 HRESULT getDefaultIoCacheSettingForStorageController(StorageControllerType_T aControllerType, 185 149 BOOL *aEnabled) RT_OVERRIDE; 186 HRESULT getStorageControllerHotplugCapable(StorageControllerType_T aControllerType,187 BOOL *aHotplugCapable) RT_OVERRIDE;188 HRESULT getMaxInstancesOfUSBControllerType(ChipsetType_T aChipset,189 USBControllerType_T aType,190 ULONG *aMaxInstances) RT_OVERRIDE;191 150 HRESULT getCPUProfiles(CPUArchitecture_T aArchitecture, const com::Utf8Str &aNamePattern, 192 151 std::vector<ComPtr<ICPUProfile> > &aProfiles) RT_OVERRIDE; … … 211 170 MediumFormatList m_llMediumFormats; 212 171 213 bool m_fLoadedX86CPUProfiles; /**< Set if we've loaded the x86 and AMD64 CPU profiles. */ 214 CPUProfileList_T m_llCPUProfiles; /**< List of loaded CPU profiles. */ 172 ComObjPtr<PlatformProperties> const m_platformProperties; /**< The host's platform properties. */ 173 bool m_fLoadedX86CPUProfiles; /**< Set if we've loaded the x86 and AMD64 CPU profiles. */ 174 CPUProfileList_T m_llCPUProfiles; /**< List of loaded CPU profiles. */ 215 175 216 176 friend class VirtualBox; -
trunk/src/VBox/Main/include/VirtualBoxImpl.h
r100737 r101035 338 338 HRESULT getSettingsFilePath(com::Utf8Str &aSettingsFilePath); 339 339 HRESULT getHost(ComPtr<IHost> &aHost); 340 HRESULT getPlatformProperties(PlatformArchitecture_T platformArchitecture, ComPtr<IPlatformProperties> &aPlatformProperties); 340 341 HRESULT getSystemProperties(ComPtr<ISystemProperties> &aSystemProperties); 341 342 HRESULT getMachines(std::vector<ComPtr<IMachine> > &aMachines); … … 366 367 HRESULT createMachine(const com::Utf8Str &aSettingsFile, 367 368 const com::Utf8Str &aName, 369 PlatformArchitecture_T aArchitecture, 368 370 const std::vector<com::Utf8Str> &aGroups, 369 371 const com::Utf8Str &aOsTypeId, -
trunk/src/VBox/Main/src-all/Global.cpp
r100827 r101035 651 651 } 652 652 653 /*static*/ uint32_t Global::getMaxNetworkAdapters(ChipsetType_T aChipsetType)654 {655 switch (aChipsetType)656 {657 case ChipsetType_PIIX3:658 return 8;659 case ChipsetType_ICH9:660 return 36;661 default:662 return 0;663 }664 }665 666 653 /*static*/ const char * 667 654 Global::stringifyMachineState(MachineState_T aState) -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r100606 r101035 78 78 # include "UsbCardReader.h" 79 79 #endif 80 #include "PlatformPropertiesImpl.h" 80 81 #include "ProgressImpl.h" 81 82 #include "ConsoleVRDPServer.h" … … 545 546 mcGuestCredentialsProvided = false; 546 547 548 ComPtr<IPlatform> pPlatform; 549 hrc = mMachine->COMGETTER(Platform)(pPlatform.asOutParam()); 550 AssertComRCReturnRC(hrc); 551 552 PlatformArchitecture_T platformArch; 553 hrc = pPlatform->COMGETTER(Architecture)(&platformArch); 554 AssertComRCReturnRC(hrc); 555 547 556 /* Now the VM specific parts */ 548 557 /** @todo r=bird: aLockType is always LockType_VM. */ 549 558 if (aLockType == LockType_VM) 550 559 { 551 const char *pszVMM = "VBoxVMM"; 552 560 const char *pszVMM = NULL; /* Shut up MSVC. */ 561 562 switch (platformArch) 563 { 564 case PlatformArchitecture_x86: 565 pszVMM = "VBoxVMM"; 566 break; 553 567 #ifdef VBOX_WITH_VIRT_ARMV8 554 Bstr value; 555 hrc = mMachine->GetExtraData(Bstr("VBoxInternal2/ArmV8Virt").raw(), 556 value.asOutParam()); 557 if ( hrc == S_OK 558 && value == "1") 559 pszVMM = "VBoxVMMArm"; 568 case PlatformArchitecture_ARM: 569 pszVMM = "VBoxVMMArm"; 570 break; 560 571 #endif 572 default: 573 hrc = VBOX_E_PLATFORM_ARCH_NOT_SUPPORTED; 574 break; 575 } 576 577 if (FAILED(hrc)) 578 return hrc; 561 579 562 580 /* Load the VMM. We won't continue without it being successfully loaded here. */ … … 569 587 AssertComRCReturnRC(hrc); 570 588 #endif 571 572 589 hrc = mMachine->COMGETTER(VRDEServer)(unconst(mVRDEServer).asOutParam()); 573 590 AssertComRCReturnRC(hrc); … … 641 658 hrc = aMachine->COMGETTER(Parent)(pVirtualBox.asOutParam()); 642 659 AssertComRC(hrc); 660 643 661 ComPtr<ISystemProperties> pSystemProperties; 662 ComPtr<IPlatformProperties> pPlatformProperties; 644 663 if (pVirtualBox) 645 pVirtualBox->COMGETTER(SystemProperties)(pSystemProperties.asOutParam()); 664 { 665 hrc = pVirtualBox->COMGETTER(SystemProperties)(pSystemProperties.asOutParam()); 666 AssertComRC(hrc); 667 hrc = pVirtualBox->GetPlatformProperties(platformArch, pPlatformProperties.asOutParam()); 668 AssertComRC(hrc); 669 } 670 646 671 ChipsetType_T chipsetType = ChipsetType_PIIX3; 647 aMachine->COMGETTER(ChipsetType)(&chipsetType);672 pPlatform->COMGETTER(ChipsetType)(&chipsetType); 648 673 ULONG maxNetworkAdapters = 0; 649 if (p SystemProperties)650 p SystemProperties->GetMaxNetworkAdapters(chipsetType, &maxNetworkAdapters);674 if (pPlatformProperties) 675 pPlatformProperties->GetMaxNetworkAdapters(chipsetType, &maxNetworkAdapters); 651 676 meAttachmentType.resize(maxNetworkAdapters); 652 677 for (ULONG slot = 0; slot < maxNetworkAdapters; ++slot) … … 4488 4513 #endif /* 0 */ 4489 4514 4515 ComPtr<IPlatform> pPlatform; 4516 hrc = mMachine->COMGETTER(Platform)(pPlatform.asOutParam()); 4517 AssertComRCReturn(hrc, hrc); 4518 4490 4519 ChipsetType_T enmChipsetType; 4491 hrc = mMachine->COMGETTER(ChipsetType)(&enmChipsetType); 4492 if (!FAILED(hrc)) 4493 { 4494 SafeVMPtrQuiet ptrVM(this); 4495 if (ptrVM.isOk()) 4496 { 4497 ULONG ulInstanceMax = (ULONG)Global::getMaxNetworkAdapters(enmChipsetType); 4498 4499 notifyNatDnsChange(ptrVM.rawUVM(), ptrVM.vtable(), "pcnet", ulInstanceMax); 4500 notifyNatDnsChange(ptrVM.rawUVM(), ptrVM.vtable(), "e1000", ulInstanceMax); 4501 notifyNatDnsChange(ptrVM.rawUVM(), ptrVM.vtable(), "virtio-net", ulInstanceMax); 4502 } 4520 hrc = pPlatform->COMGETTER(ChipsetType)(&enmChipsetType); 4521 AssertComRCReturn(hrc, hrc); 4522 4523 SafeVMPtrQuiet ptrVM(this); 4524 if (ptrVM.isOk()) 4525 { 4526 ULONG const ulInstanceMax = PlatformProperties::s_getMaxNetworkAdapters(enmChipsetType); 4527 4528 notifyNatDnsChange(ptrVM.rawUVM(), ptrVM.vtable(), "pcnet", ulInstanceMax); 4529 notifyNatDnsChange(ptrVM.rawUVM(), ptrVM.vtable(), "e1000", ulInstanceMax); 4530 notifyNatDnsChange(ptrVM.rawUVM(), ptrVM.vtable(), "virtio-net", ulInstanceMax); 4503 4531 } 4504 4532 … … 5201 5229 AssertComRCReturn(autoCaller.hrc(), VERR_ACCESS_DENIED); 5202 5230 5231 ComPtr<IPlatform> pPlatform; 5232 HRESULT hrc = pThis->mMachine->COMGETTER(Platform)(pPlatform.asOutParam()); 5233 AssertComRC(hrc); 5234 5235 PlatformArchitecture_T platformArch; 5236 hrc = pPlatform->COMGETTER(Architecture)(&platformArch); 5237 AssertComRC(hrc); 5238 5203 5239 ComPtr<IVirtualBox> pVirtualBox; 5204 5240 pThis->mMachine->COMGETTER(Parent)(pVirtualBox.asOutParam()); 5205 ComPtr<ISystemProperties> pSystemProperties; 5206 if (pVirtualBox) 5207 pVirtualBox->COMGETTER(SystemProperties)(pSystemProperties.asOutParam()); 5208 ChipsetType_T chipsetType = ChipsetType_PIIX3; 5209 pThis->mMachine->COMGETTER(ChipsetType)(&chipsetType); 5241 5242 ComPtr<IPlatformProperties> pPlatformProperties; 5243 hrc = pVirtualBox->GetPlatformProperties(platformArch, pPlatformProperties.asOutParam()); 5244 AssertComRC(hrc); 5245 5246 ChipsetType_T chipsetType = ChipsetType_PIIX3; /*** @todo BUGBUG ASSUMES x86! */ 5247 pPlatform->COMGETTER(ChipsetType)(&chipsetType); 5248 AssertComRC(hrc); 5249 5210 5250 ULONG maxNetworkAdapters = 0; 5211 if (pSystemProperties)5212 pSystemProperties->GetMaxNetworkAdapters(chipsetType, &maxNetworkAdapters);5251 hrc = pPlatformProperties->GetMaxNetworkAdapters(chipsetType, &maxNetworkAdapters); 5252 AssertComRC(hrc); 5213 5253 AssertMsg( ( !strcmp(pszDevice, "pcnet") 5214 5254 || !strcmp(pszDevice, "e1000") … … 10627 10667 ComPtr<IVirtualBox> pVirtualBox; 10628 10668 mMachine->COMGETTER(Parent)(pVirtualBox.asOutParam()); 10629 ComPtr<ISystemProperties> pSystemProperties; 10630 if (pVirtualBox) 10631 pVirtualBox->COMGETTER(SystemProperties)(pSystemProperties.asOutParam()); 10632 ChipsetType_T chipsetType = ChipsetType_PIIX3; 10633 mMachine->COMGETTER(ChipsetType)(&chipsetType); 10669 10670 ComPtr<IPlatform> pPlatform; 10671 HRESULT hrc = mMachine->COMGETTER(Platform)(pPlatform.asOutParam()); 10672 AssertComRC(hrc); 10673 10674 PlatformArchitecture_T platformArch; 10675 hrc = pPlatform->COMGETTER(Architecture)(&platformArch); 10676 AssertComRC(hrc); 10677 10678 ComPtr<IPlatformProperties> pPlatformProperties; 10679 hrc = pVirtualBox->GetPlatformProperties(platformArch, pPlatformProperties.asOutParam()); 10680 AssertComRC(hrc); 10681 10682 ChipsetType_T chipsetType = ChipsetType_PIIX3; /*** @todo BUGBUG ASSUMES x86! */ 10683 pPlatform->COMGETTER(ChipsetType)(&chipsetType); 10684 AssertComRC(hrc); 10685 10634 10686 ULONG maxNetworkAdapters = 0; 10635 if (pSystemProperties) 10636 pSystemProperties->GetMaxNetworkAdapters(chipsetType, &maxNetworkAdapters); 10637 10638 HRESULT hrc = S_OK; 10687 hrc = pPlatformProperties->GetMaxNetworkAdapters(chipsetType, &maxNetworkAdapters); 10688 AssertComRC(hrc); 10689 10639 10690 for (ULONG slot = 0; slot < maxNetworkAdapters; slot++) 10640 10691 { -
trunk/src/VBox/Main/src-client/ConsoleImplConfigArmV8.cpp
r101014 r101035 130 130 hrc = virtualBox->COMGETTER(SystemProperties)(systemProperties.asOutParam()); H(); 131 131 132 ComPtr<I BIOSSettings> biosSettings;133 hrc = pMachine->COMGETTER( BIOSSettings)(biosSettings.asOutParam());H();132 ComPtr<IFirmwareSettings> firmwareSettings; 133 hrc = pMachine->COMGETTER(FirmwareSettings)(firmwareSettings.asOutParam()); H(); 134 134 135 135 ComPtr<INvramStore> nvramStore; … … 145 145 uint64_t const cbRam = cRamMBs * (uint64_t)_1M; 146 146 147 /** @todo This will be 100% wrong but is required for getting the maximum number of network adapters. */ 147 ComPtr<IPlatform> pPlatform; 148 hrc = pMachine->COMGETTER(Platform)(pPlatform.asOutParam()); H(); 149 150 ComPtr<IPlatformProperties> pPlatformProperties; 151 hrc = pPlatform->COMGETTER(Properties)(pPlatformProperties.asOutParam()); H(); 152 148 153 ChipsetType_T chipsetType; 149 hrc = p Machine->COMGETTER(ChipsetType)(&chipsetType);H();154 hrc = pPlatform->COMGETTER(ChipsetType)(&chipsetType); H(); 150 155 151 156 ULONG cCpus = 1; 152 157 hrc = pMachine->COMGETTER(CPUCount)(&cCpus); H(); 158 Assert(cCpus); 153 159 154 160 ULONG ulCpuExecutionCap = 100; … … 160 166 161 167 ULONG maxNetworkAdapters; 162 hrc = systemProperties->GetMaxNetworkAdapters(chipsetType, &maxNetworkAdapters);H();168 hrc = pPlatformProperties->GetMaxNetworkAdapters(chipsetType, &maxNetworkAdapters); H(); 163 169 164 170 /* -
trunk/src/VBox/Main/src-client/ConsoleImplConfigCommon.cpp
r99913 r101035 497 497 * 498 498 * @return VBox status code. 499 * @return VERR_PLATFORM_ARCH_NOT_SUPPORTED if the machine's platform architecture is not supported. 499 500 * @param pUVM The user mode VM handle. 500 501 * @param pVM The cross context VM handle. … … 506 507 int Console::i_configConstructorInner(PUVM pUVM, PVM pVM, PCVMMR3VTABLE pVMM, AutoWriteLock *pAlock) 507 508 { 509 ComPtr<IMachine> const pMachine = i_machine(); 510 511 ComPtr<IPlatform> pPlatform; 512 HRESULT hrc = pMachine->COMGETTER(Platform)(pPlatform.asOutParam()); 513 AssertComRCReturn(hrc, VERR_COM_VM_ERROR); 514 515 PlatformArchitecture_T platformArch; 516 hrc = pPlatform->COMGETTER(Architecture)(&platformArch); 517 AssertComRCReturn(hrc, VERR_COM_VM_ERROR); 518 519 int rc; 520 521 switch (platformArch) 522 { 523 case PlatformArchitecture_x86: 524 return i_configConstructorX86(pUVM, pVM, pVMM, pAlock); 525 508 526 #ifdef VBOX_WITH_VIRT_ARMV8 509 ComPtr<IMachine> pMachine = i_machine(); 510 511 Bstr strArmV8VirtFlag; 512 HRESULT hrc = pMachine->GetExtraData(Bstr("VBoxInternal2/ArmV8Virt").raw(), 513 strArmV8VirtFlag.asOutParam()); 514 if ( hrc == S_OK 515 && strArmV8VirtFlag == "1") 527 case PlatformArchitecture_ARM: 516 528 return i_configConstructorArmV8(pUVM, pVM, pVMM, pAlock); 517 529 #endif 518 return i_configConstructorX86(pUVM, pVM, pVMM, pAlock); 530 default: 531 rc = VERR_PLATFORM_ARCH_NOT_SUPPORTED; 532 break; 533 } 534 535 return rc; 519 536 } 520 537 -
trunk/src/VBox/Main/src-client/ConsoleImplConfigX86.cpp
r101014 r101035 54 54 # include "GuestDnDPrivate.h" 55 55 #endif 56 #include "PlatformImpl.h" 56 57 #include "VMMDev.h" 57 58 #include "Global.h" … … 514 515 hrc = virtualBox->COMGETTER(SystemProperties)(systemProperties.asOutParam()); H(); 515 516 516 ComPtr<I BIOSSettings> biosSettings;517 hrc = pMachine->COMGETTER( BIOSSettings)(biosSettings.asOutParam());H();517 ComPtr<IFirmwareSettings> firmwareSettings; 518 hrc = pMachine->COMGETTER(FirmwareSettings)(firmwareSettings.asOutParam()); H(); 518 519 519 520 ComPtr<INvramStore> nvramStore; … … 544 545 BOOL fIOAPIC; 545 546 uint32_t uIoApicPciAddress = NIL_PCIBDF; 546 hrc = biosSettings->COMGETTER(IOAPICEnabled)(&fIOAPIC); H(); 547 hrc = firmwareSettings->COMGETTER(IOAPICEnabled)(&fIOAPIC); H(); 548 549 ComPtr<IPlatform> platform; 550 pMachine->COMGETTER(Platform)(platform.asOutParam()); H(); 547 551 548 552 ChipsetType_T chipsetType; 549 hrc = p Machine->COMGETTER(ChipsetType)(&chipsetType); H();553 hrc = platform->COMGETTER(ChipsetType)(&chipsetType); H(); 550 554 if (chipsetType == ChipsetType_ICH9) 551 555 { … … 563 567 hrc = pMachine->COMGETTER(CPUProfile)(bstrCpuProfile.asOutParam()); H(); 564 568 569 /* Get the X86 platform object. */ 570 ComPtr<IPlatformX86> platformX86; 571 hrc = platform->COMGETTER(X86)(platformX86.asOutParam()); H(); 572 565 573 /* Check if long mode is enabled. */ 566 574 BOOL fIsGuest64Bit; 567 hrc = p Machine->GetCPUProperty(CPUPropertyType_LongMode, &fIsGuest64Bit);H();575 hrc = platformX86->GetCPUProperty(CPUPropertyTypeX86_LongMode, &fIsGuest64Bit); H(); 568 576 569 577 /* … … 572 580 #if defined(VBOX_WITH_IOMMU_AMD) || defined(VBOX_WITH_IOMMU_INTEL) 573 581 IommuType_T enmIommuType; 574 hrc = p Machine->COMGETTER(IommuType)(&enmIommuType); H();582 hrc = platform->COMGETTER(IommuType)(&enmIommuType); H(); 575 583 576 584 /* Resolve 'automatic' type to an Intel or AMD IOMMU based on the host CPU. */ … … 664 672 665 673 APICMode_T apicMode; 666 hrc = biosSettings->COMGETTER(APICMode)(&apicMode);H();674 hrc = firmwareSettings->COMGETTER(APICMode)(&apicMode); H(); 667 675 uint32_t uFwAPIC; 668 676 switch (apicMode) … … 702 710 } 703 711 712 ComPtr<IPlatformProperties> platformProperties; 713 virtualBox->GetPlatformProperties(PlatformArchitecture_x86, platformProperties.asOutParam()); 714 704 715 ULONG maxNetworkAdapters; 705 hrc = systemProperties->GetMaxNetworkAdapters(chipsetType, &maxNetworkAdapters);H();716 hrc = platformProperties->GetMaxNetworkAdapters(chipsetType, &maxNetworkAdapters); H(); 706 717 707 718 /* … … 745 756 /* Triple fault behavior. */ 746 757 BOOL fTripleFaultReset = false; 747 hrc = p Machine->GetCPUProperty(CPUPropertyType_TripleFaultReset, &fTripleFaultReset); H();758 hrc = platformX86->GetCPUProperty(CPUPropertyTypeX86_TripleFaultReset, &fTripleFaultReset); H(); 748 759 InsertConfigInteger(pEM, "TripleFaultReset", fTripleFaultReset); 749 760 … … 760 771 { 761 772 ULONG uLeaf, uSubLeaf, uEax, uEbx, uEcx, uEdx; 762 hrc = p Machine->GetCPUIDLeafByOrdinal(iOrdinal, &uLeaf, &uSubLeaf, &uEax, &uEbx, &uEcx, &uEdx);773 hrc = platformX86->GetCPUIDLeafByOrdinal(iOrdinal, &uLeaf, &uSubLeaf, &uEax, &uEbx, &uEcx, &uEdx); 763 774 if (hrc == E_INVALIDARG) 764 775 break; … … 821 832 /* Physical Address Extension (PAE) */ 822 833 BOOL fEnablePAE = false; 823 hrc = p Machine->GetCPUProperty(CPUPropertyType_PAE, &fEnablePAE);H();834 hrc = platformX86->GetCPUProperty(CPUPropertyTypeX86_PAE, &fEnablePAE); H(); 824 835 fEnablePAE |= fIsGuest64Bit; 825 836 InsertConfigInteger(pRoot, "EnablePAE", fEnablePAE); … … 831 842 BOOL fEnableAPIC = true; 832 843 BOOL fEnableX2APIC = true; 833 hrc = p Machine->GetCPUProperty(CPUPropertyType_APIC, &fEnableAPIC);H();834 hrc = p Machine->GetCPUProperty(CPUPropertyType_X2APIC, &fEnableX2APIC);H();844 hrc = platformX86->GetCPUProperty(CPUPropertyTypeX86_APIC, &fEnableAPIC); H(); 845 hrc = platformX86->GetCPUProperty(CPUPropertyTypeX86_X2APIC, &fEnableX2APIC); H(); 835 846 if (fEnableX2APIC) 836 847 Assert(fEnableAPIC); … … 877 888 /* Speculation Control. */ 878 889 BOOL fSpecCtrl = FALSE; 879 hrc = p Machine->GetCPUProperty(CPUPropertyType_SpecCtrl, &fSpecCtrl);H();890 hrc = platformX86->GetCPUProperty(CPUPropertyTypeX86_SpecCtrl, &fSpecCtrl); H(); 880 891 InsertConfigInteger(pCPUM, "SpecCtrl", fSpecCtrl); 881 892 882 893 /* Nested VT-x / AMD-V. */ 883 894 BOOL fNestedHWVirt = FALSE; 884 hrc = p Machine->GetCPUProperty(CPUPropertyType_HWVirt, &fNestedHWVirt);H();895 hrc = platformX86->GetCPUProperty(CPUPropertyTypeX86_HWVirt, &fNestedHWVirt); H(); 885 896 InsertConfigInteger(pCPUM, "NestedHWVirt", fNestedHWVirt ? true : false); 886 897 … … 903 914 904 915 BOOL fHMEnabled; 905 hrc = p Machine->GetHWVirtExProperty(HWVirtExPropertyType_Enabled, &fHMEnabled);H();916 hrc = platformX86->GetHWVirtExProperty(HWVirtExPropertyType_Enabled, &fHMEnabled); H(); 906 917 if (cCpus > 1 && !fHMEnabled) 907 918 { … … 915 926 if (!fHMForced) /* No need to query if already forced above. */ 916 927 { 917 hrc = p Machine->GetHWVirtExProperty(HWVirtExPropertyType_Force, &fHMForced);H();928 hrc = platformX86->GetHWVirtExProperty(HWVirtExPropertyType_Force, &fHMForced); H(); 918 929 if (fHMForced) 919 930 LogRel(("fHMForced=true - HWVirtExPropertyType_Force\n")); … … 947 958 /* HWVirtEx exclusive mode */ 948 959 BOOL fHMExclusive = true; 949 hrc = systemProperties->COMGETTER(ExclusiveHwVirt)(&fHMExclusive); H();960 hrc = platformProperties->COMGETTER(ExclusiveHwVirt)(&fHMExclusive); H(); 950 961 InsertConfigInteger(pHM, "Exclusive", fHMExclusive); 951 962 952 963 /* Nested paging (VT-x/AMD-V) */ 953 964 BOOL fEnableNestedPaging = false; 954 hrc = p Machine->GetHWVirtExProperty(HWVirtExPropertyType_NestedPaging, &fEnableNestedPaging); H();965 hrc = platformX86->GetHWVirtExProperty(HWVirtExPropertyType_NestedPaging, &fEnableNestedPaging); H(); 955 966 InsertConfigInteger(pHM, "EnableNestedPaging", fEnableNestedPaging); 956 967 957 968 /* Large pages; requires nested paging */ 958 969 BOOL fEnableLargePages = false; 959 hrc = p Machine->GetHWVirtExProperty(HWVirtExPropertyType_LargePages, &fEnableLargePages); H();970 hrc = platformX86->GetHWVirtExProperty(HWVirtExPropertyType_LargePages, &fEnableLargePages); H(); 960 971 InsertConfigInteger(pHM, "EnableLargePages", fEnableLargePages); 961 972 962 973 /* VPID (VT-x) */ 963 974 BOOL fEnableVPID = false; 964 hrc = p Machine->GetHWVirtExProperty(HWVirtExPropertyType_VPID, &fEnableVPID); H();975 hrc = platformX86->GetHWVirtExProperty(HWVirtExPropertyType_VPID, &fEnableVPID); H(); 965 976 InsertConfigInteger(pHM, "EnableVPID", fEnableVPID); 966 977 967 978 /* Unrestricted execution aka UX (VT-x) */ 968 979 BOOL fEnableUX = false; 969 hrc = p Machine->GetHWVirtExProperty(HWVirtExPropertyType_UnrestrictedExecution, &fEnableUX); H();980 hrc = platformX86->GetHWVirtExProperty(HWVirtExPropertyType_UnrestrictedExecution, &fEnableUX); H(); 970 981 InsertConfigInteger(pHM, "EnableUX", fEnableUX); 971 982 … … 977 988 /* Indirect branch prediction boundraries. */ 978 989 BOOL fIBPBOnVMExit = false; 979 hrc = p Machine->GetCPUProperty(CPUPropertyType_IBPBOnVMExit, &fIBPBOnVMExit); H();990 hrc = platformX86->GetCPUProperty(CPUPropertyTypeX86_IBPBOnVMExit, &fIBPBOnVMExit); H(); 980 991 InsertConfigInteger(pHM, "IBPBOnVMExit", fIBPBOnVMExit); 981 992 982 993 BOOL fIBPBOnVMEntry = false; 983 hrc = p Machine->GetCPUProperty(CPUPropertyType_IBPBOnVMEntry, &fIBPBOnVMEntry); H();994 hrc = platformX86->GetCPUProperty(CPUPropertyTypeX86_IBPBOnVMEntry, &fIBPBOnVMEntry); H(); 984 995 InsertConfigInteger(pHM, "IBPBOnVMEntry", fIBPBOnVMEntry); 985 996 986 997 BOOL fSpecCtrlByHost = false; 987 hrc = p Machine->GetCPUProperty(CPUPropertyType_SpecCtrlByHost, &fSpecCtrlByHost); H();998 hrc = platformX86->GetCPUProperty(CPUPropertyTypeX86_SpecCtrlByHost, &fSpecCtrlByHost); H(); 988 999 InsertConfigInteger(pHM, "SpecCtrlByHost", fSpecCtrlByHost); 989 1000 990 1001 BOOL fL1DFlushOnSched = true; 991 hrc = p Machine->GetCPUProperty(CPUPropertyType_L1DFlushOnEMTScheduling, &fL1DFlushOnSched); H();1002 hrc = platformX86->GetCPUProperty(CPUPropertyTypeX86_L1DFlushOnEMTScheduling, &fL1DFlushOnSched); H(); 992 1003 InsertConfigInteger(pHM, "L1DFlushOnSched", fL1DFlushOnSched); 993 1004 994 1005 BOOL fL1DFlushOnVMEntry = false; 995 hrc = p Machine->GetCPUProperty(CPUPropertyType_L1DFlushOnVMEntry, &fL1DFlushOnVMEntry); H();1006 hrc = platformX86->GetCPUProperty(CPUPropertyTypeX86_L1DFlushOnVMEntry, &fL1DFlushOnVMEntry); H(); 996 1007 InsertConfigInteger(pHM, "L1DFlushOnVMEntry", fL1DFlushOnVMEntry); 997 1008 998 1009 BOOL fMDSClearOnSched = true; 999 hrc = p Machine->GetCPUProperty(CPUPropertyType_MDSClearOnEMTScheduling, &fMDSClearOnSched); H();1010 hrc = platformX86->GetCPUProperty(CPUPropertyTypeX86_MDSClearOnEMTScheduling, &fMDSClearOnSched); H(); 1000 1011 InsertConfigInteger(pHM, "MDSClearOnSched", fMDSClearOnSched); 1001 1012 1002 1013 BOOL fMDSClearOnVMEntry = false; 1003 hrc = p Machine->GetCPUProperty(CPUPropertyType_MDSClearOnVMEntry, &fMDSClearOnVMEntry); H();1014 hrc = platformX86->GetCPUProperty(CPUPropertyTypeX86_MDSClearOnVMEntry, &fMDSClearOnVMEntry); H(); 1004 1015 InsertConfigInteger(pHM, "MDSClearOnVMEntry", fMDSClearOnVMEntry); 1005 1016 … … 1012 1023 /* Use NEM rather than HM. */ 1013 1024 BOOL fUseNativeApi = false; 1014 hrc = p Machine->GetHWVirtExProperty(HWVirtExPropertyType_UseNativeApi, &fUseNativeApi); H();1025 hrc = platformX86->GetHWVirtExProperty(HWVirtExPropertyType_UseNativeApi, &fUseNativeApi); H(); 1015 1026 InsertConfigInteger(pHM, "UseNEMInstead", fUseNativeApi); 1016 1027 … … 1285 1296 */ 1286 1297 LONG64 timeOffset; 1287 hrc = biosSettings->COMGETTER(TimeOffset)(&timeOffset); H();1298 hrc = firmwareSettings->COMGETTER(TimeOffset)(&timeOffset); H(); 1288 1299 PCFGMNODE pTMNode; 1289 1300 InsertConfigNode(pRoot, "TM", &pTMNode); … … 1386 1397 BOOL fHPETEnabled; 1387 1398 /* Other guests may wish to use HPET too, but MacOS X not functional without it */ 1388 hrc = p Machine->COMGETTER(HPETEnabled)(&fHPETEnabled); H();1399 hrc = platformX86->COMGETTER(HPETEnabled)(&fHPETEnabled); H(); 1389 1400 /* so always enable HPET in extended profile */ 1390 1401 fHPETEnabled |= fOsXGuest; … … 1538 1549 InsertConfigNode(pInst, "Config", &pCfg); 1539 1550 BOOL fRTCUseUTC; 1540 hrc = p Machine->COMGETTER(RTCUseUTC)(&fRTCUseUTC);H();1551 hrc = platform->COMGETTER(RTCUseUTC)(&fRTCUseUTC); H(); 1541 1552 InsertConfigInteger(pCfg, "UseUTC", fRTCUseUTC ? 1 : 0); 1542 1553 … … 1560 1571 #endif 1561 1572 case GraphicsControllerType_VBoxVGA: 1562 vrc = i_configGraphicsController(pDevices, enmGraphicsController, pBusMgr, pMachine, pGraphicsAdapter, biosSettings,1573 vrc = i_configGraphicsController(pDevices, enmGraphicsController, pBusMgr, pMachine, pGraphicsAdapter, firmwareSettings, 1563 1574 RT_BOOL(fHMEnabled)); 1564 1575 if (FAILED(vrc)) … … 1575 1586 */ 1576 1587 FirmwareType_T eFwType = FirmwareType_BIOS; 1577 hrc = pMachine->COMGETTER(FirmwareType)(&eFwType);H();1588 hrc = firmwareSettings->COMGETTER(FirmwareType)(&eFwType); H(); 1578 1589 1579 1590 #ifdef VBOX_WITH_EFI … … 1597 1608 InsertConfigInteger(pBiosCfg, "APIC", uFwAPIC); 1598 1609 BOOL fPXEDebug; 1599 hrc = biosSettings->COMGETTER(PXEDebugEnabled)(&fPXEDebug); H();1610 hrc = firmwareSettings->COMGETTER(PXEDebugEnabled)(&fPXEDebug); H(); 1600 1611 InsertConfigInteger(pBiosCfg, "PXEDebug", fPXEDebug); 1601 1612 InsertConfigBytes(pBiosCfg, "UUID", &HardwareUuid,sizeof(HardwareUuid)); 1602 1613 BOOL fUuidLe; 1603 hrc = biosSettings->COMGETTER(SMBIOSUuidLittleEndian)(&fUuidLe); H();1614 hrc = firmwareSettings->COMGETTER(SMBIOSUuidLittleEndian)(&fUuidLe); H(); 1604 1615 InsertConfigInteger(pBiosCfg, "UuidLe", fUuidLe); 1605 1616 InsertConfigNode(pBiosCfg, "NetBoot", &pNetBootCfg); … … 1680 1691 1681 1692 BOOL fUuidLe; 1682 hrc = biosSettings->COMGETTER(SMBIOSUuidLittleEndian)(&fUuidLe); H();1693 hrc = firmwareSettings->COMGETTER(SMBIOSUuidLittleEndian)(&fUuidLe); H(); 1683 1694 1684 1695 /* Get graphics mode settings */ … … 2606 2617 2607 2618 ULONG ulIOBase; 2608 hrc = serialPort->COMGETTER(IO Base)(&ulIOBase);H();2609 InsertConfigInteger(pCfg, "IO Base", ulIOBase);2619 hrc = serialPort->COMGETTER(IOAddress)(&ulIOBase); H(); 2620 InsertConfigInteger(pCfg, "IOAddress", ulIOBase); 2610 2621 auSerialIoPortBase[ulInstance] = (uint16_t)ulIOBase; 2611 2622 … … 3236 3247 */ 3237 3248 BOOL fACPI; 3238 hrc = biosSettings->COMGETTER(ACPIEnabled)(&fACPI); H();3249 hrc = firmwareSettings->COMGETTER(ACPIEnabled)(&fACPI); H(); 3239 3250 if (fACPI) 3240 3251 { … … 3597 3608 const ComPtr<IMachine> &ptrMachine, 3598 3609 const ComPtr<IGraphicsAdapter> &ptrGraphicsAdapter, 3599 const ComPtr<I BIOSSettings> &ptrBiosSettings,3610 const ComPtr<IFirmwareSettings> &ptrFirmwareSettings, 3600 3611 bool fHMEnabled) 3601 3612 { … … 3687 3698 */ 3688 3699 BOOL fFadeIn; 3689 hrc = ptr BiosSettings->COMGETTER(LogoFadeIn)(&fFadeIn); H();3700 hrc = ptrFirmwareSettings->COMGETTER(LogoFadeIn)(&fFadeIn); H(); 3690 3701 InsertConfigInteger(pCfg, "FadeIn", fFadeIn ? 1 : 0); 3691 3702 BOOL fFadeOut; 3692 hrc = ptr BiosSettings->COMGETTER(LogoFadeOut)(&fFadeOut); H();3703 hrc = ptrFirmwareSettings->COMGETTER(LogoFadeOut)(&fFadeOut); H(); 3693 3704 InsertConfigInteger(pCfg, "FadeOut", fFadeOut ? 1: 0); 3694 3705 ULONG logoDisplayTime; 3695 hrc = ptr BiosSettings->COMGETTER(LogoDisplayTime)(&logoDisplayTime); H();3706 hrc = ptrFirmwareSettings->COMGETTER(LogoDisplayTime)(&logoDisplayTime); H(); 3696 3707 InsertConfigInteger(pCfg, "LogoTime", logoDisplayTime); 3697 3708 Bstr bstrLogoImagePath; 3698 hrc = ptr BiosSettings->COMGETTER(LogoImagePath)(bstrLogoImagePath.asOutParam()); H();3709 hrc = ptrFirmwareSettings->COMGETTER(LogoImagePath)(bstrLogoImagePath.asOutParam()); H(); 3699 3710 InsertConfigString(pCfg, "LogoFile", bstrLogoImagePath); 3700 3711 … … 3702 3713 * Boot menu 3703 3714 */ 3704 BIOSBootMenuMode_T eBootMenuMode;3715 FirmwareBootMenuMode_T enmBootMenuMode; 3705 3716 int iShowBootMenu; 3706 hrc = ptr BiosSettings->COMGETTER(BootMenuMode)(&eBootMenuMode); H();3707 switch (e BootMenuMode)3708 { 3709 case BIOSBootMenuMode_Disabled: iShowBootMenu = 0; break;3710 case BIOSBootMenuMode_MenuOnly: iShowBootMenu = 1; break;3717 hrc = ptrFirmwareSettings->COMGETTER(BootMenuMode)(&enmBootMenuMode); H(); 3718 switch (enmBootMenuMode) 3719 { 3720 case FirmwareBootMenuMode_Disabled: iShowBootMenu = 0; break; 3721 case FirmwareBootMenuMode_MenuOnly: iShowBootMenu = 1; break; 3711 3722 default: iShowBootMenu = 2; break; 3712 3723 } -
trunk/src/VBox/Main/src-server/ApplianceImplExport.cpp
r99604 r101035 146 146 // memory size in MB 147 147 uint32_t ulMemSizeMB = mHWData->mMemorySize; 148 149 ComPtr<IPlatformX86> pPlatformX86; 150 mPlatform->COMGETTER(X86)(pPlatformX86.asOutParam()); 151 148 152 // VRAM size? 149 153 // BIOS settings? … … 155 159 // Long mode enabled? 156 160 BOOL fLongMode; 157 hrc = GetCPUProperty(CPUPropertyType_LongMode, &fLongMode);161 hrc = pPlatformX86->GetCPUProperty(CPUPropertyTypeX86_LongMode, &fLongMode); 158 162 if (FAILED(hrc)) throw hrc; 159 163 … … 620 624 621 625 // <const name="NetworkAdapter" /> 622 uint32_t maxNetworkAdapters = Global::getMaxNetworkAdapters(i_getChipsetType()); 626 ChipsetType_T enmChipsetType; 627 hrc = mPlatform->getChipsetType(&enmChipsetType); 628 if (FAILED(hrc)) 629 return hrc; 630 631 uint32_t const maxNetworkAdapters = PlatformProperties::s_getMaxNetworkAdapters(enmChipsetType); 623 632 size_t a; 624 633 for (a = 0; a < maxNetworkAdapters; ++a) -
trunk/src/VBox/Main/src-server/ApplianceImplImport.cpp
r99608 r101035 415 415 if (vsysThis.pelmVBoxMachine) 416 416 { 417 uint32_t maxNetworkAdapters = Global::getMaxNetworkAdapters(pNewDesc->m->pConfig->hardwareMachine.chipsetType); 417 uint32_t maxNetworkAdapters = 418 PlatformProperties::s_getMaxNetworkAdapters(pNewDesc->m->pConfig->hardwareMachine.platformSettings.chipsetType); 418 419 419 420 const settings::NetworkAdaptersList &llNetworkAdapters = pNewDesc->m->pConfig->hardwareMachine.llNetworkAdapters; … … 446 447 { 447 448 size_t cEthernetAdapters = vsysThis.llEthernetAdapters.size(); 448 uint32_t maxNetworkAdapters = Global::getMaxNetworkAdapters(ChipsetType_PIIX3);449 uint32_t const maxNetworkAdapters = PlatformProperties::s_getMaxNetworkAdapters(ChipsetType_PIIX3); /** @todo BUGBUG x86 only for now. */ 449 450 450 451 /* Check for the constrains */ … … 4415 4416 ULONG *aMaxPortCount) 4416 4417 { 4417 SystemProperties *pSysProps; 4418 pSysProps = mVirtualBox->i_getSystemProperties(); 4419 if (pSysProps == NULL) 4420 return VBOX_E_OBJECT_NOT_FOUND; 4418 ComPtr<IPlatformProperties> platformProperties; 4419 mVirtualBox->GetPlatformProperties(PlatformArchitecture_x86, platformProperties.asOutParam()); /// @todo BUGBUG Only x86 for now! 4421 4420 4422 4421 StorageBus_T enmStorageBus = StorageBus_Null; 4423 HRESULT hrc = p SysProps->GetStorageBusForStorageControllerType(aStorageControllerType, &enmStorageBus);4422 HRESULT hrc = platformProperties->GetStorageBusForStorageControllerType(aStorageControllerType, &enmStorageBus); 4424 4423 if (FAILED(hrc)) 4425 4424 return hrc; 4426 4425 4427 hrc = p SysProps->GetMaxPortCountForStorageBus(enmStorageBus, aMaxPortCount);4426 hrc = platformProperties->GetMaxPortCountForStorageBus(enmStorageBus, aMaxPortCount); 4428 4427 if (FAILED(hrc)) 4429 4428 return hrc; … … 4471 4470 hrc = mVirtualBox->CreateMachine(Bstr(stack.strSettingsFilename).raw(), 4472 4471 Bstr(stack.strNameVBox).raw(), 4472 PlatformArchitecture_x86, /// @todo BUGBUG Only x86 for now! 4473 4473 ComSafeArrayAsInParam(groups), 4474 4474 Bstr(stack.strOsTypeVBox).raw(), … … 4481 4481 pNewMachineRet = pNewMachine; 4482 4482 4483 ComPtr<IPlatform> pPlatform; 4484 hrc = pNewMachine->COMGETTER(Platform)(pPlatform.asOutParam()); 4485 if (FAILED(hrc)) throw hrc; 4486 4487 ComPtr<IPlatformX86> pPlatformX86; /// @todo BUGBUG Only x86 for now! */ 4488 hrc = pPlatform->COMGETTER(X86)(pPlatformX86.asOutParam()); 4489 if (FAILED(hrc)) throw hrc; 4490 4483 4491 // set the description 4484 4492 if (!stack.strDescription.isEmpty()) … … 4494 4502 if (stack.fForceHWVirt) 4495 4503 { 4496 hrc = p NewMachine->SetHWVirtExProperty(HWVirtExPropertyType_Enabled, TRUE);4504 hrc = pPlatformX86->SetHWVirtExProperty(HWVirtExPropertyType_Enabled, TRUE); 4497 4505 if (FAILED(hrc)) throw hrc; 4498 4506 } … … 4528 4536 } 4529 4537 4538 ComPtr<IFirmwareSettings> pFirmwareSettings; 4539 hrc = pNewMachine->COMGETTER(FirmwareSettings)(pFirmwareSettings.asOutParam()); 4540 if (FAILED(hrc)) throw hrc; 4541 4530 4542 if (stack.fForceIOAPIC) 4531 4543 { 4532 ComPtr<IBIOSSettings> pBIOSSettings; 4533 hrc = pNewMachine->COMGETTER(BIOSSettings)(pBIOSSettings.asOutParam()); 4534 if (FAILED(hrc)) throw hrc; 4535 4536 hrc = pBIOSSettings->COMSETTER(IOAPICEnabled)(TRUE); 4544 hrc = pFirmwareSettings->COMSETTER(IOAPICEnabled)(TRUE); 4537 4545 if (FAILED(hrc)) throw hrc; 4538 4546 } … … 4550 4558 firmwareType = FirmwareType_EFI; 4551 4559 } 4552 hrc = p NewMachine->COMSETTER(FirmwareType)(firmwareType);4560 hrc = pFirmwareSettings->COMSETTER(FirmwareType)(firmwareType); 4553 4561 if (FAILED(hrc)) throw hrc; 4554 4562 } … … 4581 4589 4582 4590 /* Change the network adapters */ 4583 uint32_t maxNetworkAdapters = Global::getMaxNetworkAdapters(ChipsetType_PIIX3);4591 uint32_t const maxNetworkAdapters = PlatformProperties::s_getMaxNetworkAdapters(ChipsetType_PIIX3); /** @todo BUGBUG Only x86 for now! */ 4584 4592 4585 4593 std::list<VirtualSystemDescriptionEntry*> vsdeNW = vsdescThis->i_findByType(VirtualSystemDescriptionType_NetworkAdapter); … … 5353 5361 config.hardwareMachine.cCPUs = stack.cCPUs; 5354 5362 if (stack.fForceIOAPIC) 5355 config.hardwareMachine. fHardwareVirt= true;5363 config.hardwareMachine.platformSettings.x86.fHWVirtEx = true; 5356 5364 if (stack.fForceIOAPIC) 5357 config.hardwareMachine. biosSettings.fIOAPICEnabled = true;5365 config.hardwareMachine.firmwareSettings.fIOAPICEnabled = true; 5358 5366 /* RAM size */ 5359 5367 config.hardwareMachine.ulMemorySizeMB = stack.ulMemorySizeMB; -
trunk/src/VBox/Main/src-server/HostImpl.cpp
r100772 r101035 41 41 42 42 #include "HostImpl.h" 43 #include "HostX86Impl.h" 43 44 44 45 #ifdef VBOX_WITH_USB … … 150 151 #endif 151 152 152 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)153 # include <iprt/asm-amd64-x86.h>154 #endif155 153 #ifdef RT_OS_SOLARIS 156 154 # include <iprt/ctype.h> … … 159 157 # include <iprt/file.h> 160 158 #endif 161 #include <iprt/mp.h>162 159 #include <iprt/env.h> 163 160 #include <iprt/mem.h> … … 263 260 const ComObjPtr<HostUpdateAgent> pUpdateHost; 264 261 #endif 262 /** Reference to the x86 host specific portions of the host object. */ 263 const ComObjPtr<HostX86> pHostX86; 265 264 }; 266 265 … … 301 300 302 301 m->pParent = aParent; 302 303 hrc = unconst(m->pHostX86).createObject(); 304 if (SUCCEEDED(hrc)) 305 hrc = m->pHostX86->init(); 306 AssertComRCReturn(hrc, hrc); 303 307 304 308 #ifdef VBOX_WITH_USB … … 515 519 m->hostDnsMonitorProxy.uninit(); 516 520 521 if (m->pHostX86) 522 { 523 m->pHostX86->uninit(); 524 unconst(m->pHostX86).setNull(); 525 } 526 517 527 #ifdef VBOX_WITH_UPDATE_AGENT 518 528 if (m->pUpdateHost) … … 582 592 // 583 593 //////////////////////////////////////////////////////////////////////////////// 594 595 /** 596 * Returns the host's platform architecture. 597 * 598 * @returns COM status code 599 * @param platformArchitecture Where to return the host's platform architecture. 600 */ 601 HRESULT Host::getArchitecture(PlatformArchitecture_T *platformArchitecture) 602 { 603 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 604 *platformArchitecture = PlatformArchitecture_x86; 605 #elif defined(RT_ARCH_ARM64) || defined(RT_ARCH_ARM32) 606 *platformArchitecture = PlatformArchitecture_ARM; 607 #else 608 # error "Port me!" 609 #endif 610 611 return S_OK; 612 } 584 613 585 614 /** … … 1324 1353 1325 1354 /** 1326 * Returns the specific CPUID leaf.1327 *1328 * @returns COM status code1329 * @param aCpuId The CPU number. Mostly ignored.1330 * @param aLeaf The leaf number.1331 * @param aSubLeaf The sub-leaf number.1332 * @param aValEAX Where to return EAX.1333 * @param aValEBX Where to return EBX.1334 * @param aValECX Where to return ECX.1335 * @param aValEDX Where to return EDX.1336 */1337 HRESULT Host::getProcessorCPUIDLeaf(ULONG aCpuId, ULONG aLeaf, ULONG aSubLeaf,1338 ULONG *aValEAX, ULONG *aValEBX, ULONG *aValECX, ULONG *aValEDX)1339 {1340 // no locking required1341 1342 /* Check that the CPU is online. */1343 /** @todo later use RTMpOnSpecific. */1344 if (!RTMpIsCpuOnline(aCpuId))1345 return RTMpIsCpuPresent(aCpuId)1346 ? setError(E_FAIL, tr("CPU no.%u is not present"), aCpuId)1347 : setError(E_FAIL, tr("CPU no.%u is not online"), aCpuId);1348 1349 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86)1350 uint32_t uEAX, uEBX, uECX, uEDX;1351 ASMCpuId_Idx_ECX(aLeaf, aSubLeaf, &uEAX, &uEBX, &uECX, &uEDX);1352 *aValEAX = uEAX;1353 *aValEBX = uEBX;1354 *aValECX = uECX;1355 *aValEDX = uEDX;1356 #else1357 RT_NOREF(aLeaf, aSubLeaf);1358 *aValEAX = 0;1359 *aValEBX = 0;1360 *aValECX = 0;1361 *aValEDX = 0;1362 #endif1363 1364 return S_OK;1365 }1366 1367 /**1368 1355 * Returns the amount of installed system memory in megabytes 1369 1356 * … … 2000 1987 2001 1988 return S_OK; 1989 } 1990 1991 /** 1992 * Returns the x86 host specific portions of the host object. 1993 * 1994 * @returns x86 host specific portions of the host object. 1995 * @param aHostX86 Where to return the x86 host specific portions of the host objects. 1996 */ 1997 HRESULT Host::getX86(ComPtr<IHostX86> &aHostX86) 1998 { 1999 return m->pHostX86.queryInterfaceTo(aHostX86.asOutParam()); 2002 2000 } 2003 2001 -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r100179 r101035 242 242 mMemoryBalloonSize = 0; 243 243 mPageFusionEnabled = false; 244 mHWVirtExEnabled = true;245 mHWVirtExNestedPagingEnabled = true;246 mHWVirtExLargePagesEnabled = HC_ARCH_BITS == 64; /* Not supported on 32 bits hosts. */247 mHWVirtExVPIDEnabled = true;248 mHWVirtExUXEnabled = true;249 mHWVirtExForceEnabled = false;250 mHWVirtExUseNativeApi = false;251 mHWVirtExVirtVmsaveVmload = true;252 #if HC_ARCH_BITS == 64 || defined(RT_OS_WINDOWS) || defined(RT_OS_DARWIN)253 mPAEEnabled = true;254 #else255 mPAEEnabled = false;256 #endif257 mLongMode = HC_ARCH_BITS == 64 ? settings::Hardware::LongMode_Enabled : settings::Hardware::LongMode_Disabled;258 mTripleFaultReset = false;259 mAPIC = true;260 mX2APIC = false;261 mIBPBOnVMExit = false;262 mIBPBOnVMEntry = false;263 mSpecCtrl = false;264 mSpecCtrlByHost = false;265 mL1DFlushOnSched = true;266 mL1DFlushOnVMEntry = false;267 mMDSClearOnSched = true;268 mMDSClearOnVMEntry = false;269 mNestedHWVirt = false;270 mHPETEnabled = false;271 244 mCpuExecutionCap = 100; /* Maximum CPU execution cap by default. */ 272 245 mCpuIdPortabilityLevel = 0; … … 285 258 mDnDMode = DnDMode_Disabled; 286 259 287 mFirmwareType = FirmwareType_BIOS; 288 mKeyboardHIDType = KeyboardHIDType_PS2Keyboard; 289 mPointingHIDType = PointingHIDType_PS2Mouse; 290 mChipsetType = ChipsetType_PIIX3; 291 mIommuType = IommuType_None; 260 mKeyboardHIDType = KeyboardHIDType_PS2Keyboard; /** @todo BUGBUG Assumes x86! */ 261 mPointingHIDType = PointingHIDType_PS2Mouse; /** @todo BUGBUG Assumes x86! */ 292 262 mParavirtProvider = ParavirtProvider_Default; 293 263 mEmulatedUSBCardReaderEnabled = FALSE; … … 342 312 * This gets called from VirtualBox::CreateMachine(). 343 313 * 344 * @param aParent Associated parent object345 * @param strConfigFile Local file system path to the VM settings file (can346 * be relative to the VirtualBox config directory).347 * @param strName name for the machine348 * @param llGroups list of groups for the machine349 * @param strOsType OS Type string (stored as is if aOsType is NULL).350 * @param aOsType OS Type of this machine or NULL.351 * @param aId UUID for the new machine.352 * @param fForceOverwrite Whether to overwrite an existing machine settings file.353 * @param fDirectoryIncludesUUID Whether the use a special VM directory naming354 * scheme (includes the UUID).355 * @param aCipher The cipher to encrypt the VM with.356 * @param aPasswordId The password ID, empty if the VM should not be encrypted.357 * @param aPassword The password to encrypt the VM with.314 * @param aParent Associated parent object. 315 * @param strConfigFile Local file system path to the VM settings (can be relative to the VirtualBox config directory). 316 * @param strName Name for the machine. 317 * @param aArchitecture Architecture to use for the machine. 318 * @param llGroups list of groups for the machine. 319 * @param strOsType OS Type string (stored as is if aOsType is NULL). 320 * @param aOsType OS Type of this machine or NULL. 321 * @param aId UUID for the new machine. 322 * @param fForceOverwrite Whether to overwrite an existing machine settings file. 323 * @param fDirectoryIncludesUUID 324 * Whether the use a special VM directory naming scheme (includes the UUID). 325 * @param aCipher The cipher to encrypt the VM with. 326 * @param aPasswordId The password ID, empty if the VM should not be encrypted. 327 * @param aPassword The password to encrypt the VM with. 358 328 * 359 * @return Success indicator. if not S_OK, the machine object is invalid329 * @return Success indicator. if not S_OK, the machine object is invalid. 360 330 */ 361 331 HRESULT Machine::init(VirtualBox *aParent, 362 332 const Utf8Str &strConfigFile, 363 333 const Utf8Str &strName, 334 PlatformArchitecture_T aArchitecture, 364 335 const StringsList &llGroups, 365 336 const Utf8Str &strOsType, … … 492 463 /* Store OS type */ 493 464 mUserData->s.strOsType = aOsType->i_id(); 494 495 /* Let the OS type select 64-bit ness. */496 mHWData->mLongMode = aOsType->i_is64Bit()497 ? settings::Hardware::LongMode_Enabled : settings::Hardware::LongMode_Disabled;498 499 /* Let the OS type enable the X2APIC */500 mHWData->mX2APIC = aOsType->i_recommendedX2APIC();501 502 hrc = aOsType->COMGETTER(RecommendedFirmware)(&mHWData->mFirmwareType);503 AssertComRC(hrc);504 465 } 505 466 else if (!strOsType.isEmpty()) … … 507 468 /* Store OS type */ 508 469 mUserData->s.strOsType = strOsType; 509 510 /* No guest OS type object. Pick some plausible defaults which the 511 * host can handle. There's no way to know or validate anything. */ 512 mHWData->mLongMode = HC_ARCH_BITS == 64 ? settings::Hardware::LongMode_Enabled : settings::Hardware::LongMode_Disabled; 513 mHWData->mX2APIC = false; 514 } 515 516 /* Apply BIOS defaults. */ 517 mBIOSSettings->i_applyDefaults(aOsType); 470 } 471 472 /* Set the platform architecture first before applying the defaults below. */ 473 hrc = mPlatform->i_initArchitecture(aArchitecture); 474 if (FAILED(hrc)) return hrc; 475 476 /* Apply platform defaults. */ 477 mPlatform->i_applyDefaults(aOsType); 478 i_platformPropertiesUpdate(); 479 480 /* Apply firmware defaults. */ 481 mFirmwareSettings->i_applyDefaults(aOsType); 518 482 519 483 /* Apply TPM defaults. */ … … 840 804 /** 841 805 * Shared code between the various init() implementations. 806 * 807 * @returns HRESULT 842 808 * @param aParent The VirtualBox object. 843 809 * @param strConfigFile Settings file. 844 * @return845 810 */ 846 811 HRESULT Machine::initImpl(VirtualBox *aParent, … … 1183 1148 } 1184 1149 1150 HRESULT Machine::getPlatform(ComPtr<IPlatform> &aPlatform) 1151 { 1152 /* mPlatform is constant during life time, no need to lock */ 1153 ComObjPtr<Platform> pPlatform(mPlatform); 1154 aPlatform = pPlatform; 1155 1156 return S_OK; 1157 } 1185 1158 1186 1159 HRESULT Machine::getAccessible(BOOL *aAccessible) … … 1392 1365 } 1393 1366 1394 HRESULT Machine::getFirmwareType(FirmwareType_T *aFirmwareType)1395 {1396 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);1397 1398 *aFirmwareType = mHWData->mFirmwareType;1399 1400 return S_OK;1401 }1402 1403 HRESULT Machine::setFirmwareType(FirmwareType_T aFirmwareType)1404 {1405 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);1406 1407 HRESULT hrc = i_checkStateDependency(MutableStateDep);1408 if (FAILED(hrc)) return hrc;1409 1410 i_setModified(IsModified_MachineData);1411 mHWData.backup();1412 mHWData->mFirmwareType = aFirmwareType;1413 Utf8Str strNVRAM = i_getDefaultNVRAMFilename();1414 alock.release();1415 1416 mNvramStore->i_updateNonVolatileStorageFile(strNVRAM);1417 1418 return S_OK;1419 }1420 1421 1367 HRESULT Machine::getKeyboardHIDType(KeyboardHIDType_T *aKeyboardHIDType) 1422 1368 { … … 1461 1407 mHWData.backup(); 1462 1408 mHWData->mPointingHIDType = aPointingHIDType; 1463 1464 return S_OK;1465 }1466 1467 HRESULT Machine::getChipsetType(ChipsetType_T *aChipsetType)1468 {1469 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);1470 1471 *aChipsetType = mHWData->mChipsetType;1472 1473 return S_OK;1474 }1475 1476 HRESULT Machine::setChipsetType(ChipsetType_T aChipsetType)1477 {1478 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);1479 1480 HRESULT hrc = i_checkStateDependency(MutableStateDep);1481 if (FAILED(hrc)) return hrc;1482 1483 if (aChipsetType != mHWData->mChipsetType)1484 {1485 i_setModified(IsModified_MachineData);1486 mHWData.backup();1487 mHWData->mChipsetType = aChipsetType;1488 1489 // Resize network adapter array, to be finalized on commit/rollback.1490 // We must not throw away entries yet, otherwise settings are lost1491 // without a way to roll back.1492 size_t newCount = Global::getMaxNetworkAdapters(aChipsetType);1493 size_t oldCount = mNetworkAdapters.size();1494 if (newCount > oldCount)1495 {1496 mNetworkAdapters.resize(newCount);1497 for (size_t slot = oldCount; slot < mNetworkAdapters.size(); slot++)1498 {1499 unconst(mNetworkAdapters[slot]).createObject();1500 mNetworkAdapters[slot]->init(this, (ULONG)slot);1501 }1502 }1503 }1504 1505 return S_OK;1506 }1507 1508 HRESULT Machine::getIommuType(IommuType_T *aIommuType)1509 {1510 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);1511 1512 *aIommuType = mHWData->mIommuType;1513 1514 return S_OK;1515 }1516 1517 HRESULT Machine::setIommuType(IommuType_T aIommuType)1518 {1519 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);1520 1521 HRESULT hrc = i_checkStateDependency(MutableStateDep);1522 if (FAILED(hrc)) return hrc;1523 1524 if (aIommuType != mHWData->mIommuType)1525 {1526 if (aIommuType == IommuType_Intel)1527 {1528 #ifndef VBOX_WITH_IOMMU_INTEL1529 LogRelFunc(("Setting Intel IOMMU when Intel IOMMU support not available!\n"));1530 return E_UNEXPECTED;1531 #endif1532 }1533 1534 i_setModified(IsModified_MachineData);1535 mHWData.backup();1536 mHWData->mIommuType = aIommuType;1537 }1538 1409 1539 1410 return S_OK; … … 2000 1871 } 2001 1872 2002 HRESULT Machine::getHPETEnabled(BOOL *aHPETEnabled)2003 {2004 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);2005 2006 *aHPETEnabled = mHWData->mHPETEnabled;2007 2008 return S_OK;2009 }2010 2011 HRESULT Machine::setHPETEnabled(BOOL aHPETEnabled)2012 {2013 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);2014 2015 HRESULT hrc = i_checkStateDependency(MutableStateDep);2016 if (FAILED(hrc)) return hrc;2017 2018 i_setModified(IsModified_MachineData);2019 mHWData.backup();2020 2021 mHWData->mHPETEnabled = aHPETEnabled;2022 2023 return hrc;2024 }2025 2026 1873 /** @todo this method should not be public */ 2027 1874 HRESULT Machine::getMemoryBalloonSize(ULONG *aMemoryBalloonSize) … … 2093 1940 } 2094 1941 2095 HRESULT Machine::get BIOSSettings(ComPtr<IBIOSSettings> &aBIOSSettings)2096 { 2097 /* m BIOSSettings is constant during life time, no need to lock */2098 a BIOSSettings = mBIOSSettings;1942 HRESULT Machine::getFirmwareSettings(ComPtr<IFirmwareSettings> &aFirmwareSettings) 1943 { 1944 /* mFirmwareSettings is constant during life time, no need to lock */ 1945 aFirmwareSettings = mFirmwareSettings; 2099 1946 2100 1947 return S_OK; … … 2131 1978 2132 1979 aGraphicsAdapter = mGraphicsAdapter; 2133 2134 return S_OK;2135 }2136 2137 HRESULT Machine::getCPUProperty(CPUPropertyType_T aProperty, BOOL *aValue)2138 {2139 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);2140 2141 switch (aProperty)2142 {2143 case CPUPropertyType_PAE:2144 *aValue = mHWData->mPAEEnabled;2145 break;2146 2147 case CPUPropertyType_LongMode:2148 if (mHWData->mLongMode == settings::Hardware::LongMode_Enabled)2149 *aValue = TRUE;2150 else if (mHWData->mLongMode == settings::Hardware::LongMode_Disabled)2151 *aValue = FALSE;2152 #if HC_ARCH_BITS == 642153 else2154 *aValue = TRUE;2155 #else2156 else2157 {2158 *aValue = FALSE;2159 2160 ComObjPtr<GuestOSType> pGuestOSType;2161 HRESULT hrc2 = mParent->i_findGuestOSType(mUserData->s.strOsType,2162 pGuestOSType);2163 if (SUCCEEDED(hrc2) && !pGuestOSType.isNull())2164 {2165 if (pGuestOSType->i_is64Bit())2166 {2167 ComObjPtr<Host> pHost = mParent->i_host();2168 alock.release();2169 2170 hrc2 = pHost->GetProcessorFeature(ProcessorFeature_LongMode, aValue); AssertComRC(hrc2);2171 if (FAILED(hrc2))2172 *aValue = FALSE;2173 }2174 }2175 }2176 #endif2177 break;2178 2179 case CPUPropertyType_TripleFaultReset:2180 *aValue = mHWData->mTripleFaultReset;2181 break;2182 2183 case CPUPropertyType_APIC:2184 *aValue = mHWData->mAPIC;2185 break;2186 2187 case CPUPropertyType_X2APIC:2188 *aValue = mHWData->mX2APIC;2189 break;2190 2191 case CPUPropertyType_IBPBOnVMExit:2192 *aValue = mHWData->mIBPBOnVMExit;2193 break;2194 2195 case CPUPropertyType_IBPBOnVMEntry:2196 *aValue = mHWData->mIBPBOnVMEntry;2197 break;2198 2199 case CPUPropertyType_SpecCtrl:2200 *aValue = mHWData->mSpecCtrl;2201 break;2202 2203 case CPUPropertyType_SpecCtrlByHost:2204 *aValue = mHWData->mSpecCtrlByHost;2205 break;2206 2207 case CPUPropertyType_HWVirt:2208 *aValue = mHWData->mNestedHWVirt;2209 break;2210 2211 case CPUPropertyType_L1DFlushOnEMTScheduling:2212 *aValue = mHWData->mL1DFlushOnSched;2213 break;2214 2215 case CPUPropertyType_L1DFlushOnVMEntry:2216 *aValue = mHWData->mL1DFlushOnVMEntry;2217 break;2218 2219 case CPUPropertyType_MDSClearOnEMTScheduling:2220 *aValue = mHWData->mMDSClearOnSched;2221 break;2222 2223 case CPUPropertyType_MDSClearOnVMEntry:2224 *aValue = mHWData->mMDSClearOnVMEntry;2225 break;2226 2227 default:2228 return E_INVALIDARG;2229 }2230 return S_OK;2231 }2232 2233 HRESULT Machine::setCPUProperty(CPUPropertyType_T aProperty, BOOL aValue)2234 {2235 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);2236 2237 HRESULT hrc = i_checkStateDependency(MutableStateDep);2238 if (FAILED(hrc)) return hrc;2239 2240 switch (aProperty)2241 {2242 case CPUPropertyType_PAE:2243 i_setModified(IsModified_MachineData);2244 mHWData.backup();2245 mHWData->mPAEEnabled = !!aValue;2246 break;2247 2248 case CPUPropertyType_LongMode:2249 i_setModified(IsModified_MachineData);2250 mHWData.backup();2251 mHWData->mLongMode = !aValue ? settings::Hardware::LongMode_Disabled : settings::Hardware::LongMode_Enabled;2252 break;2253 2254 case CPUPropertyType_TripleFaultReset:2255 i_setModified(IsModified_MachineData);2256 mHWData.backup();2257 mHWData->mTripleFaultReset = !!aValue;2258 break;2259 2260 case CPUPropertyType_APIC:2261 if (mHWData->mX2APIC)2262 aValue = TRUE;2263 i_setModified(IsModified_MachineData);2264 mHWData.backup();2265 mHWData->mAPIC = !!aValue;2266 break;2267 2268 case CPUPropertyType_X2APIC:2269 i_setModified(IsModified_MachineData);2270 mHWData.backup();2271 mHWData->mX2APIC = !!aValue;2272 if (aValue)2273 mHWData->mAPIC = !!aValue;2274 break;2275 2276 case CPUPropertyType_IBPBOnVMExit:2277 i_setModified(IsModified_MachineData);2278 mHWData.backup();2279 mHWData->mIBPBOnVMExit = !!aValue;2280 break;2281 2282 case CPUPropertyType_IBPBOnVMEntry:2283 i_setModified(IsModified_MachineData);2284 mHWData.backup();2285 mHWData->mIBPBOnVMEntry = !!aValue;2286 break;2287 2288 case CPUPropertyType_SpecCtrl:2289 i_setModified(IsModified_MachineData);2290 mHWData.backup();2291 mHWData->mSpecCtrl = !!aValue;2292 break;2293 2294 case CPUPropertyType_SpecCtrlByHost:2295 i_setModified(IsModified_MachineData);2296 mHWData.backup();2297 mHWData->mSpecCtrlByHost = !!aValue;2298 break;2299 2300 case CPUPropertyType_HWVirt:2301 i_setModified(IsModified_MachineData);2302 mHWData.backup();2303 mHWData->mNestedHWVirt = !!aValue;2304 break;2305 2306 case CPUPropertyType_L1DFlushOnEMTScheduling:2307 i_setModified(IsModified_MachineData);2308 mHWData.backup();2309 mHWData->mL1DFlushOnSched = !!aValue;2310 break;2311 2312 case CPUPropertyType_L1DFlushOnVMEntry:2313 i_setModified(IsModified_MachineData);2314 mHWData.backup();2315 mHWData->mL1DFlushOnVMEntry = !!aValue;2316 break;2317 2318 case CPUPropertyType_MDSClearOnEMTScheduling:2319 i_setModified(IsModified_MachineData);2320 mHWData.backup();2321 mHWData->mMDSClearOnSched = !!aValue;2322 break;2323 2324 case CPUPropertyType_MDSClearOnVMEntry:2325 i_setModified(IsModified_MachineData);2326 mHWData.backup();2327 mHWData->mMDSClearOnVMEntry = !!aValue;2328 break;2329 2330 default:2331 return E_INVALIDARG;2332 }2333 return S_OK;2334 }2335 2336 HRESULT Machine::getCPUIDLeafByOrdinal(ULONG aOrdinal, ULONG *aIdx, ULONG *aSubIdx, ULONG *aValEax, ULONG *aValEbx,2337 ULONG *aValEcx, ULONG *aValEdx)2338 {2339 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);2340 if (aOrdinal < mHWData->mCpuIdLeafList.size())2341 {2342 for (settings::CpuIdLeafsList::const_iterator it = mHWData->mCpuIdLeafList.begin();2343 it != mHWData->mCpuIdLeafList.end();2344 ++it)2345 {2346 if (aOrdinal == 0)2347 {2348 const settings::CpuIdLeaf &rLeaf= *it;2349 *aIdx = rLeaf.idx;2350 *aSubIdx = rLeaf.idxSub;2351 *aValEax = rLeaf.uEax;2352 *aValEbx = rLeaf.uEbx;2353 *aValEcx = rLeaf.uEcx;2354 *aValEdx = rLeaf.uEdx;2355 return S_OK;2356 }2357 aOrdinal--;2358 }2359 }2360 return E_INVALIDARG;2361 }2362 2363 HRESULT Machine::getCPUIDLeaf(ULONG aIdx, ULONG aSubIdx, ULONG *aValEax, ULONG *aValEbx, ULONG *aValEcx, ULONG *aValEdx)2364 {2365 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);2366 2367 /*2368 * Search the list.2369 */2370 for (settings::CpuIdLeafsList::const_iterator it = mHWData->mCpuIdLeafList.begin(); it != mHWData->mCpuIdLeafList.end(); ++it)2371 {2372 const settings::CpuIdLeaf &rLeaf= *it;2373 if ( rLeaf.idx == aIdx2374 && ( aSubIdx == UINT32_MAX2375 || rLeaf.idxSub == aSubIdx) )2376 {2377 *aValEax = rLeaf.uEax;2378 *aValEbx = rLeaf.uEbx;2379 *aValEcx = rLeaf.uEcx;2380 *aValEdx = rLeaf.uEdx;2381 return S_OK;2382 }2383 }2384 2385 return E_INVALIDARG;2386 }2387 2388 2389 HRESULT Machine::setCPUIDLeaf(ULONG aIdx, ULONG aSubIdx, ULONG aValEax, ULONG aValEbx, ULONG aValEcx, ULONG aValEdx)2390 {2391 /*2392 * Validate input before taking locks and checking state.2393 */2394 if (aSubIdx != 0 && aSubIdx != UINT32_MAX)2395 return setError(E_INVALIDARG, tr("Currently only aSubIdx values 0 and 0xffffffff are supported: %#x"), aSubIdx);2396 if ( aIdx >= UINT32_C(0x20)2397 && aIdx - UINT32_C(0x80000000) >= UINT32_C(0x20)2398 && aIdx - UINT32_C(0xc0000000) >= UINT32_C(0x10) )2399 return setError(E_INVALIDARG, tr("CpuId override leaf %#x is out of range"), aIdx);2400 2401 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);2402 HRESULT hrc = i_checkStateDependency(MutableStateDep);2403 if (FAILED(hrc)) return hrc;2404 2405 /*2406 * Impose a maximum number of leaves.2407 */2408 if (mHWData->mCpuIdLeafList.size() > 256)2409 return setError(E_FAIL, tr("Max of 256 CPUID override leaves reached"));2410 2411 /*2412 * Updating the list is a bit more complicated. So, let's do a remove first followed by an insert.2413 */2414 i_setModified(IsModified_MachineData);2415 mHWData.backup();2416 2417 for (settings::CpuIdLeafsList::iterator it = mHWData->mCpuIdLeafList.begin(); it != mHWData->mCpuIdLeafList.end(); )2418 {2419 settings::CpuIdLeaf &rLeaf= *it;2420 if ( rLeaf.idx == aIdx2421 && ( aSubIdx == UINT32_MAX2422 || rLeaf.idxSub == aSubIdx) )2423 it = mHWData->mCpuIdLeafList.erase(it);2424 else2425 ++it;2426 }2427 2428 settings::CpuIdLeaf NewLeaf;2429 NewLeaf.idx = aIdx;2430 NewLeaf.idxSub = aSubIdx == UINT32_MAX ? 0 : aSubIdx;2431 NewLeaf.uEax = aValEax;2432 NewLeaf.uEbx = aValEbx;2433 NewLeaf.uEcx = aValEcx;2434 NewLeaf.uEdx = aValEdx;2435 mHWData->mCpuIdLeafList.push_back(NewLeaf);2436 return S_OK;2437 }2438 2439 HRESULT Machine::removeCPUIDLeaf(ULONG aIdx, ULONG aSubIdx)2440 {2441 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);2442 2443 HRESULT hrc = i_checkStateDependency(MutableStateDep);2444 if (FAILED(hrc)) return hrc;2445 2446 /*2447 * Do the removal.2448 */2449 bool fModified = mHWData.isBackedUp();2450 for (settings::CpuIdLeafsList::iterator it = mHWData->mCpuIdLeafList.begin(); it != mHWData->mCpuIdLeafList.end(); )2451 {2452 settings::CpuIdLeaf &rLeaf= *it;2453 if ( rLeaf.idx == aIdx2454 && ( aSubIdx == UINT32_MAX2455 || rLeaf.idxSub == aSubIdx) )2456 {2457 if (!fModified)2458 {2459 fModified = true;2460 i_setModified(IsModified_MachineData);2461 mHWData.backup();2462 // Start from the beginning, since mHWData.backup() creates2463 // a new list, causing iterator mixup. This makes sure that2464 // the settings are not unnecessarily marked as modified,2465 // at the price of extra list walking.2466 it = mHWData->mCpuIdLeafList.begin();2467 }2468 else2469 it = mHWData->mCpuIdLeafList.erase(it);2470 }2471 else2472 ++it;2473 }2474 2475 return S_OK;2476 }2477 2478 HRESULT Machine::removeAllCPUIDLeaves()2479 {2480 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);2481 2482 HRESULT hrc = i_checkStateDependency(MutableStateDep);2483 if (FAILED(hrc)) return hrc;2484 2485 if (mHWData->mCpuIdLeafList.size() > 0)2486 {2487 i_setModified(IsModified_MachineData);2488 mHWData.backup();2489 2490 mHWData->mCpuIdLeafList.clear();2491 }2492 2493 return S_OK;2494 }2495 HRESULT Machine::getHWVirtExProperty(HWVirtExPropertyType_T aProperty, BOOL *aValue)2496 {2497 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);2498 2499 switch(aProperty)2500 {2501 case HWVirtExPropertyType_Enabled:2502 *aValue = mHWData->mHWVirtExEnabled;2503 break;2504 2505 case HWVirtExPropertyType_VPID:2506 *aValue = mHWData->mHWVirtExVPIDEnabled;2507 break;2508 2509 case HWVirtExPropertyType_NestedPaging:2510 *aValue = mHWData->mHWVirtExNestedPagingEnabled;2511 break;2512 2513 case HWVirtExPropertyType_UnrestrictedExecution:2514 *aValue = mHWData->mHWVirtExUXEnabled;2515 break;2516 2517 case HWVirtExPropertyType_LargePages:2518 *aValue = mHWData->mHWVirtExLargePagesEnabled;2519 break;2520 2521 case HWVirtExPropertyType_Force:2522 *aValue = mHWData->mHWVirtExForceEnabled;2523 break;2524 2525 case HWVirtExPropertyType_UseNativeApi:2526 *aValue = mHWData->mHWVirtExUseNativeApi;2527 break;2528 2529 case HWVirtExPropertyType_VirtVmsaveVmload:2530 *aValue = mHWData->mHWVirtExVirtVmsaveVmload;2531 break;2532 2533 default:2534 return E_INVALIDARG;2535 }2536 return S_OK;2537 }2538 2539 HRESULT Machine::setHWVirtExProperty(HWVirtExPropertyType_T aProperty, BOOL aValue)2540 {2541 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);2542 2543 HRESULT hrc = i_checkStateDependency(MutableStateDep);2544 if (FAILED(hrc)) return hrc;2545 2546 switch (aProperty)2547 {2548 case HWVirtExPropertyType_Enabled:2549 i_setModified(IsModified_MachineData);2550 mHWData.backup();2551 mHWData->mHWVirtExEnabled = !!aValue;2552 break;2553 2554 case HWVirtExPropertyType_VPID:2555 i_setModified(IsModified_MachineData);2556 mHWData.backup();2557 mHWData->mHWVirtExVPIDEnabled = !!aValue;2558 break;2559 2560 case HWVirtExPropertyType_NestedPaging:2561 i_setModified(IsModified_MachineData);2562 mHWData.backup();2563 mHWData->mHWVirtExNestedPagingEnabled = !!aValue;2564 break;2565 2566 case HWVirtExPropertyType_UnrestrictedExecution:2567 i_setModified(IsModified_MachineData);2568 mHWData.backup();2569 mHWData->mHWVirtExUXEnabled = !!aValue;2570 break;2571 2572 case HWVirtExPropertyType_LargePages:2573 i_setModified(IsModified_MachineData);2574 mHWData.backup();2575 mHWData->mHWVirtExLargePagesEnabled = !!aValue;2576 break;2577 2578 case HWVirtExPropertyType_Force:2579 i_setModified(IsModified_MachineData);2580 mHWData.backup();2581 mHWData->mHWVirtExForceEnabled = !!aValue;2582 break;2583 2584 case HWVirtExPropertyType_UseNativeApi:2585 i_setModified(IsModified_MachineData);2586 mHWData.backup();2587 mHWData->mHWVirtExUseNativeApi = !!aValue;2588 break;2589 2590 case HWVirtExPropertyType_VirtVmsaveVmload:2591 i_setModified(IsModified_MachineData);2592 mHWData.backup();2593 mHWData->mHWVirtExVirtVmsaveVmload = !!aValue;2594 break;2595 2596 default:2597 return E_INVALIDARG;2598 }2599 1980 2600 1981 return S_OK; … … 3115 2496 3116 2497 return hrc; 3117 }3118 3119 HRESULT Machine::getRTCUseUTC(BOOL *aRTCUseUTC)3120 {3121 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);3122 3123 *aRTCUseUTC = mUserData->s.fRTCUseUTC;3124 3125 return S_OK;3126 }3127 3128 HRESULT Machine::setRTCUseUTC(BOOL aRTCUseUTC)3129 {3130 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);3131 3132 /* Only allow it to be set to true when PoweredOff or Aborted.3133 (Clearing it is always permitted.) */3134 if ( aRTCUseUTC3135 && mData->mRegistered3136 && ( !i_isSessionMachine()3137 || ( mData->mMachineState != MachineState_PoweredOff3138 && mData->mMachineState != MachineState_Teleported3139 && mData->mMachineState != MachineState_Aborted3140 )3141 )3142 )3143 return setError(VBOX_E_INVALID_VM_STATE,3144 tr("The machine is not powered off (state is %s)"),3145 Global::stringifyMachineState(mData->mMachineState));3146 3147 i_setModified(IsModified_MachineData);3148 mUserData.backup();3149 mUserData->s.fRTCUseUTC = !!aRTCUseUTC;3150 3151 return S_OK;3152 2498 } 3153 2499 … … 6445 5791 6446 5792 /* Check that we don't exceed the maximum number of USB controllers for the given type. */ 5793 ChipsetType_T enmChipsetType; 5794 hrc = mPlatform->getChipsetType(&enmChipsetType); 5795 if (FAILED(hrc)) 5796 return hrc; 5797 6447 5798 ULONG maxInstances; 6448 hrc = mP arent->i_getSystemProperties()->GetMaxInstancesOfUSBControllerType(mHWData->mChipsetType, aType, &maxInstances);5799 hrc = mPlatformProperties->GetMaxInstancesOfUSBControllerType(enmChipsetType, aType, &maxInstances); 6449 5800 if (FAILED(hrc)) 6450 5801 return hrc; … … 6955 6306 if (FAILED(hrc)) return hrc; 6956 6307 6957 ChipsetType_T aChipset = ChipsetType_PIIX3; 6958 COMGETTER(ChipsetType)(&aChipset); 6959 6960 if (aChipset != ChipsetType_ICH9) 6308 ChipsetType_T aChipset = ChipsetType_PIIX3; /*** @todo BUGBUG ASSUMES x86! */ 6309 hrc = mPlatform->COMGETTER(ChipsetType)(&aChipset); 6310 if (FAILED(hrc)) return hrc; 6311 6312 if (aChipset != ChipsetType_ICH9) /*** @todo BUGBUG ASSUMES x86! */ 6961 6313 { 6962 6314 return setError(E_INVALIDARG, … … 8446 7798 8447 7799 return strResult; 7800 } 7801 7802 FirmwareType_T Machine::i_getFirmwareType() const 7803 { 7804 return mFirmwareSettings->i_getFirmwareType(); 8448 7805 } 8449 7806 … … 8596 7953 mUSBControllers.allocate(); 8597 7954 7955 /* create the platform + platform properties objects for this machine */ 7956 HRESULT hrc = unconst(mPlatform).createObject(); 7957 ComAssertComRCRetRC(hrc); 7958 hrc = mPlatform->init(this); 7959 ComAssertComRCRetRC(hrc); 7960 hrc = unconst(mPlatformProperties).createObject(); 7961 ComAssertComRCRetRC(hrc); 7962 hrc = mPlatformProperties->init(mParent); 7963 ComAssertComRCRetRC(hrc); 7964 8598 7965 /* initialize mOSTypeId */ 8599 7966 mUserData->s.strOsType = mParent->i_getUnknownOSType()->i_id(); 8600 7967 8601 /** @todo r=bird: init() methods never fails, right? Why don't we make them 8602 * return void then! */ 8603 8604 /* create associated BIOS settings object */ 8605 unconst(mBIOSSettings).createObject(); 8606 mBIOSSettings->init(this); 7968 /* create associated firmware settings object */ 7969 unconst(mFirmwareSettings).createObject(); 7970 mFirmwareSettings->init(this); 8607 7971 8608 7972 /* create associated recording settings object */ … … 8649 8013 8650 8014 /* create associated network adapter objects */ 8651 mNetworkAdapters.resize(Global::getMaxNetworkAdapters(mHWData->mChipsetType)); 8015 ChipsetType_T enmChipsetType; 8016 hrc = mPlatform->getChipsetType(&enmChipsetType); 8017 ComAssertComRC(hrc); 8018 8019 mNetworkAdapters.resize(PlatformProperties::s_getMaxNetworkAdapters(enmChipsetType)); 8652 8020 for (ULONG slot = 0; slot < mNetworkAdapters.size(); ++slot) 8653 8021 { … … 8664 8032 mGuestDebugControl->init(this); 8665 8033 8666 return S_OK;8034 return hrc; 8667 8035 } 8668 8036 … … 8749 8117 } 8750 8118 8751 if (mBIOSSettings) 8752 { 8753 mBIOSSettings->uninit(); 8754 unconst(mBIOSSettings).setNull(); 8119 if (mPlatform) 8120 { 8121 mPlatform->uninit(); 8122 unconst(mPlatform).setNull(); 8123 } 8124 8125 if (mPlatformProperties) 8126 { 8127 mPlatformProperties->uninit(); 8128 unconst(mPlatformProperties).setNull(); 8129 } 8130 8131 if (mFirmwareSettings) 8132 { 8133 mFirmwareSettings->uninit(); 8134 unconst(mFirmwareSettings).setNull(); 8755 8135 } 8756 8136 … … 9222 8602 mHWData->mHardwareUUID = data.uuid; 9223 8603 9224 mHWData->mHWVirtExEnabled = data.fHardwareVirt;9225 mHWData->mHWVirtExNestedPagingEnabled = data.fNestedPaging;9226 mHWData->mHWVirtExLargePagesEnabled = data.fLargePages;9227 mHWData->mHWVirtExVPIDEnabled = data.fVPID;9228 mHWData->mHWVirtExUXEnabled = data.fUnrestrictedExecution;9229 mHWData->mHWVirtExForceEnabled = data.fHardwareVirtForce;9230 mHWData->mHWVirtExUseNativeApi = data.fUseNativeApi;9231 mHWData->mHWVirtExVirtVmsaveVmload = data.fVirtVmsaveVmload;9232 mHWData->mPAEEnabled = data.fPAE;9233 mHWData->mLongMode = data.enmLongMode;9234 mHWData->mTripleFaultReset = data.fTripleFaultReset;9235 mHWData->mAPIC = data.fAPIC;9236 mHWData->mX2APIC = data.fX2APIC;9237 mHWData->mIBPBOnVMExit = data.fIBPBOnVMExit;9238 mHWData->mIBPBOnVMEntry = data.fIBPBOnVMEntry;9239 mHWData->mSpecCtrl = data.fSpecCtrl;9240 mHWData->mSpecCtrlByHost = data.fSpecCtrlByHost;9241 mHWData->mL1DFlushOnSched = data.fL1DFlushOnSched;9242 mHWData->mL1DFlushOnVMEntry = data.fL1DFlushOnVMEntry;9243 mHWData->mMDSClearOnSched = data.fMDSClearOnSched;9244 mHWData->mMDSClearOnVMEntry = data.fMDSClearOnVMEntry;9245 mHWData->mNestedHWVirt = data.fNestedHWVirt;9246 8604 mHWData->mCPUCount = data.cCPUs; 9247 8605 mHWData->mCPUHotPlugEnabled = data.fCpuHotPlug; … … 9264 8622 } 9265 8623 9266 // cpuid leafs9267 for (settings::CpuIdLeafsList::const_iterator9268 it = data.llCpuIdLeafs.begin();9269 it != data.llCpuIdLeafs.end();9270 ++it)9271 {9272 const settings::CpuIdLeaf &rLeaf= *it;9273 if ( rLeaf.idx < UINT32_C(0x20)9274 || rLeaf.idx - UINT32_C(0x80000000) < UINT32_C(0x20)9275 || rLeaf.idx - UINT32_C(0xc0000000) < UINT32_C(0x10) )9276 mHWData->mCpuIdLeafList.push_back(rLeaf);9277 /* else: just ignore */9278 }9279 9280 8624 mHWData->mMemorySize = data.ulMemorySizeMB; 9281 8625 mHWData->mPageFusionEnabled = data.fPageFusionEnabled; … … 9291 8635 } 9292 8636 9293 mHWData->mFirmwareType = data.firmwareType;9294 8637 mHWData->mPointingHIDType = data.pointingHIDType; 9295 8638 mHWData->mKeyboardHIDType = data.keyboardHIDType; 9296 mHWData->mChipsetType = data.chipsetType;9297 mHWData->mIommuType = data.iommuType;9298 8639 mHWData->mParavirtProvider = data.paravirtProvider; 9299 8640 mHWData->mParavirtDebug = data.strParavirtDebug; 9300 8641 mHWData->mEmulatedUSBCardReaderEnabled = data.fEmulatedUSBCardReader; 9301 mHWData->mHPETEnabled = data.fHPETEnabled;9302 8642 9303 8643 /* GraphicsAdapter */ … … 9309 8649 if (FAILED(hrc)) return hrc; 9310 8650 9311 /* BIOS */ 9312 hrc = mBIOSSettings->i_loadSettings(data.biosSettings); 8651 /* Platform */ 8652 hrc = mPlatform->i_loadSettings(data.platformSettings); 8653 if (FAILED(hrc)) return hrc; 8654 8655 i_platformPropertiesUpdate(); 8656 8657 /* Firmware */ 8658 hrc = mFirmwareSettings->i_loadSettings(data.firmwareSettings); 9313 8659 if (FAILED(hrc)) return hrc; 9314 8660 … … 9349 8695 // ensure reading the same settings as we saved, since the list skips 9350 8696 // adapters having defaults) 9351 size_t newCount = Global::getMaxNetworkAdapters(mHWData->mChipsetType);9352 size_t oldCount = mNetworkAdapters.size();8697 size_t const newCount = PlatformProperties::s_getMaxNetworkAdapters(data.platformSettings.chipsetType); 8698 size_t const oldCount = mNetworkAdapters.size(); 9353 8699 if (newCount > oldCount) 9354 8700 { … … 10652 9998 10653 9999 // CPU 10654 data.fHardwareVirt = !!mHWData->mHWVirtExEnabled;10655 data.fNestedPaging = !!mHWData->mHWVirtExNestedPagingEnabled;10656 data.fLargePages = !!mHWData->mHWVirtExLargePagesEnabled;10657 data.fVPID = !!mHWData->mHWVirtExVPIDEnabled;10658 data.fUnrestrictedExecution = !!mHWData->mHWVirtExUXEnabled;10659 data.fHardwareVirtForce = !!mHWData->mHWVirtExForceEnabled;10660 data.fUseNativeApi = !!mHWData->mHWVirtExUseNativeApi;10661 data.fVirtVmsaveVmload = !!mHWData->mHWVirtExVirtVmsaveVmload;10662 data.fPAE = !!mHWData->mPAEEnabled;10663 data.enmLongMode = mHWData->mLongMode;10664 data.fTripleFaultReset = !!mHWData->mTripleFaultReset;10665 data.fAPIC = !!mHWData->mAPIC;10666 data.fX2APIC = !!mHWData->mX2APIC;10667 data.fIBPBOnVMExit = !!mHWData->mIBPBOnVMExit;10668 data.fIBPBOnVMEntry = !!mHWData->mIBPBOnVMEntry;10669 data.fSpecCtrl = !!mHWData->mSpecCtrl;10670 data.fSpecCtrlByHost = !!mHWData->mSpecCtrlByHost;10671 data.fL1DFlushOnSched = !!mHWData->mL1DFlushOnSched;10672 data.fL1DFlushOnVMEntry = !!mHWData->mL1DFlushOnVMEntry;10673 data.fMDSClearOnSched = !!mHWData->mMDSClearOnSched;10674 data.fMDSClearOnVMEntry = !!mHWData->mMDSClearOnVMEntry;10675 data.fNestedHWVirt = !!mHWData->mNestedHWVirt;10676 10000 data.cCPUs = mHWData->mCPUCount; 10677 10001 data.fCpuHotPlug = !!mHWData->mCPUHotPlugEnabled; … … 10694 10018 } 10695 10019 10696 /* Standard and Extended CPUID leafs. */10697 data.llCpuIdLeafs.clear();10698 data.llCpuIdLeafs = mHWData->mCpuIdLeafList;10699 10700 10020 // memory 10701 10021 data.ulMemorySizeMB = mHWData->mMemorySize; 10702 10022 data.fPageFusionEnabled = !!mHWData->mPageFusionEnabled; 10703 10023 10704 // firmware10705 data.firmwareType = mHWData->mFirmwareType;10706 10707 10024 // HID 10708 10025 data.pointingHIDType = mHWData->mPointingHIDType; 10709 10026 data.keyboardHIDType = mHWData->mKeyboardHIDType; 10710 10027 10711 // chipset10712 data.chipsetType = mHWData->mChipsetType;10713 10714 // iommu10715 data.iommuType = mHWData->mIommuType;10716 10717 10028 // paravirt 10718 10029 data.paravirtProvider = mHWData->mParavirtProvider; … … 10721 10032 // emulated USB card reader 10722 10033 data.fEmulatedUSBCardReader = !!mHWData->mEmulatedUSBCardReaderEnabled; 10723 10724 // HPET10725 data.fHPETEnabled = !!mHWData->mHPETEnabled;10726 10034 10727 10035 // boot order … … 10734 10042 if (FAILED(hrc)) throw hrc; 10735 10043 10736 /* BIOS settings (required) */ 10737 hrc = mBIOSSettings->i_saveSettings(data.biosSettings); 10044 /* Platform (required) */ 10045 hrc = mPlatform->i_saveSettings(data.platformSettings); 10046 if (FAILED(hrc)) return hrc; 10047 10048 /* Firmware settings (required) */ 10049 hrc = mFirmwareSettings->i_saveSettings(data.firmwareSettings); 10738 10050 if (FAILED(hrc)) throw hrc; 10739 10051 … … 10775 10087 10776 10088 /* Network adapters (required) */ 10777 size_t uMaxNICs = RT_MIN(Global::getMaxNetworkAdapters(mHWData->mChipsetType), mNetworkAdapters.size()); 10089 size_t const uMaxNICs = 10090 RT_MIN(PlatformProperties::s_getMaxNetworkAdapters(data.platformSettings.chipsetType), mNetworkAdapters.size()); 10778 10091 data.llNetworkAdapters.clear(); 10779 10092 /* Write out only the nominal number of network adapters for this … … 12316 11629 i_rollbackMedia(); 12317 11630 12318 if (mBIOSSettings) 12319 mBIOSSettings->i_rollback(); 11631 if (mPlatform) 11632 { 11633 mPlatform->i_rollback(); 11634 i_platformPropertiesUpdate(); 11635 } 11636 11637 if (mFirmwareSettings) 11638 mFirmwareSettings->i_rollback(); 12320 11639 12321 11640 if (mRecordingSettings && (mData->flModifications & IsModified_Recording)) … … 12346 11665 mGuestDebugControl->i_rollback(); 12347 11666 12348 if (!mHWData.isNull()) 12349 mNetworkAdapters.resize(Global::getMaxNetworkAdapters(mHWData->mChipsetType)); 11667 if (mPlatform && (mData->flModifications & IsModified_Platform)) 11668 { 11669 ChipsetType_T enmChipset; 11670 HRESULT hrc = mPlatform->getChipsetType(&enmChipset); 11671 ComAssertComRC(hrc); 11672 11673 mNetworkAdapters.resize(PlatformProperties::s_getMaxNetworkAdapters(enmChipset)); 11674 } 11675 12350 11676 NetworkAdapterVector networkAdapters(mNetworkAdapters.size()); 12351 11677 ComPtr<ISerialPort> serialPorts[RT_ELEMENTS(mSerialPorts)]; … … 12454 11780 i_commitMedia(Global::IsOnline(mData->mMachineState)); 12455 11781 12456 mBIOSSettings->i_commit(); 11782 mPlatform->i_commit(); 11783 mFirmwareSettings->i_commit(); 12457 11784 mRecordingSettings->i_commit(); 12458 11785 mTrustedPlatformModule->i_commit(); … … 12469 11796 * of the list entries manually, including the creation of peers for the 12470 11797 * new objects. */ 11798 ChipsetType_T enmChipset; 11799 HRESULT hrc = mPlatform->getChipsetType(&enmChipset); 11800 ComAssertComRC(hrc); 11801 12471 11802 bool commitNetworkAdapters = false; 12472 size_t newSize = Global::getMaxNetworkAdapters(mHWData->mChipsetType);11803 size_t const newSize = PlatformProperties::s_getMaxNetworkAdapters(enmChipset); 12473 11804 if (mPeer) 12474 11805 { … … 12711 12042 } 12712 12043 12713 mBIOSSettings->i_copyFrom(aThat->mBIOSSettings); 12044 mPlatform->i_copyFrom(aThat->mPlatform); 12045 i_platformPropertiesUpdate(); 12046 mFirmwareSettings->i_copyFrom(aThat->mFirmwareSettings); 12714 12047 mRecordingSettings->i_copyFrom(aThat->mRecordingSettings); 12715 12048 mTrustedPlatformModule->i_copyFrom(aThat->mTrustedPlatformModule); … … 12776 12109 bool Machine::i_isControllerHotplugCapable(StorageControllerType_T enmCtrlType) 12777 12110 { 12778 ComPtr<ISystemProperties> systemProperties;12779 HRESULT hrc = mParent->COMGETTER(SystemProperties)(systemProperties.asOutParam());12780 if (FAILED(hrc))12781 return false;12782 12783 12111 BOOL aHotplugCapable = FALSE; 12784 systemProperties->GetStorageControllerHotplugCapable(enmCtrlType, &aHotplugCapable); 12112 HRESULT hrc = mPlatformProperties->GetStorageControllerHotplugCapable(enmCtrlType, &aHotplugCapable); 12113 AssertComRC(hrc); 12785 12114 12786 12115 return RT_BOOL(aHotplugCapable); … … 12982 12311 #endif /* VBOX_WITH_RESOURCE_USAGE_API */ 12983 12312 12313 /** 12314 * Updates the machine's platform properties based on the current platform architecture. 12315 * 12316 * @note Called internally when committing, rolling back or loading settings. 12317 */ 12318 void Machine::i_platformPropertiesUpdate() 12319 { 12320 if (mPlatform) 12321 { 12322 /* Update architecture for platform properties. */ 12323 PlatformArchitecture_T platformArchitecture; 12324 HRESULT hrc = mPlatform->getArchitecture(&platformArchitecture); 12325 ComAssertComRC(hrc); 12326 hrc = mPlatformProperties->i_setArchitecture(platformArchitecture); 12327 ComAssertComRC(hrc); 12328 } 12329 } 12330 12984 12331 12985 12332 //////////////////////////////////////////////////////////////////////////////// … … 13088 12435 } 13089 12436 13090 unconst(mBIOSSettings).createObject(); 13091 mBIOSSettings->init(this, aMachine->mBIOSSettings); 12437 unconst(mPlatformProperties).createObject(); 12438 mPlatformProperties->init(mParent); 12439 unconst(mPlatform).createObject(); 12440 mPlatform->init(this, aMachine->mPlatform); 12441 12442 i_platformPropertiesUpdate(); 12443 12444 unconst(mFirmwareSettings).createObject(); 12445 mFirmwareSettings->init(this, aMachine->mFirmwareSettings); 13092 12446 13093 12447 unconst(mRecordingSettings).createObject(); … … 15808 15162 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 15809 15163 15810 /* Let the OS type select 64-bit ness. */ 15811 mHWData->mLongMode = osType->i_is64Bit() 15812 ? settings::Hardware::LongMode_Enabled : settings::Hardware::LongMode_Disabled; 15813 15814 /* Let the OS type enable the X2APIC */ 15815 mHWData->mX2APIC = osType->i_recommendedX2APIC(); 15164 mPlatform->i_applyDefaults(osType); 15816 15165 15817 15166 /* This one covers IOAPICEnabled. */ 15818 m BIOSSettings->i_applyDefaults(osType);15167 mFirmwareSettings->i_applyDefaults(osType); 15819 15168 15820 15169 /* Initialize default record settings. */ 15821 15170 mRecordingSettings->i_applyDefaults(); 15822 15823 /* Initialize default BIOS settings here */15824 /* Hardware virtualization must be ON by default */15825 mHWData->mAPIC = true;15826 mHWData->mHWVirtExEnabled = true;15827 15171 15828 15172 hrc = osType->COMGETTER(RecommendedRAM)(&mHWData->mMemorySize); … … 15859 15203 15860 15204 hrc = mGraphicsAdapter->COMSETTER(Accelerate3DEnabled)(fAccelerate3DEnabled); 15861 if (FAILED(hrc)) return hrc;15862 15863 hrc = osType->COMGETTER(RecommendedFirmware)(&mHWData->mFirmwareType);15864 if (FAILED(hrc)) return hrc;15865 15866 hrc = osType->COMGETTER(RecommendedPAE)(&mHWData->mPAEEnabled);15867 if (FAILED(hrc)) return hrc;15868 15869 hrc = osType->COMGETTER(RecommendedHPET)(&mHWData->mHPETEnabled);15870 if (FAILED(hrc)) return hrc;15871 15872 BOOL mRTCUseUTC;15873 hrc = osType->COMGETTER(RecommendedRTCUseUTC)(&mRTCUseUTC);15874 if (FAILED(hrc)) return hrc;15875 15876 setRTCUseUTC(mRTCUseUTC);15877 if (FAILED(hrc)) return hrc;15878 15879 /* the setter does more than just the assignment, so use it */15880 ChipsetType_T enmChipsetType;15881 hrc = osType->COMGETTER(RecommendedChipset)(&enmChipsetType);15882 if (FAILED(hrc)) return hrc;15883 15884 hrc = COMSETTER(ChipsetType)(enmChipsetType);15885 if (FAILED(hrc)) return hrc;15886 15887 hrc = osType->COMGETTER(RecommendedTFReset)(&mHWData->mTripleFaultReset);15888 if (FAILED(hrc)) return hrc;15889 15890 /* Apply IOMMU defaults. */15891 IommuType_T enmIommuType;15892 hrc = osType->COMGETTER(RecommendedIommuType)(&enmIommuType);15893 if (FAILED(hrc)) return hrc;15894 15895 hrc = COMSETTER(IommuType)(enmIommuType);15896 15205 if (FAILED(hrc)) return hrc; 15897 15206 -
trunk/src/VBox/Main/src-server/NetworkAdapterImpl.cpp
r98292 r101035 80 80 HRESULT NetworkAdapter::init(Machine *aParent, ULONG uSlot) 81 81 { 82 ComAssertRet(aParent, E_INVALIDARG); 83 82 84 LogFlowThisFunc(("aParent=%p, uSlot=%d\n", aParent, uSlot)); 83 85 84 ComAssertRet(aParent, E_INVALIDARG); 85 uint32_t maxNetworkAdapters = Global::getMaxNetworkAdapters(aParent->i_getChipsetType()); 86 ChipsetType_T enmChipsetType; 87 HRESULT hrc = aParent->i_getPlatform()->getChipsetType(&enmChipsetType); 88 if (FAILED(hrc)) 89 return hrc; 90 91 uint32_t const maxNetworkAdapters = PlatformProperties::s_getMaxNetworkAdapters(enmChipsetType); 86 92 ComAssertRet(uSlot < maxNetworkAdapters, E_INVALIDARG); 87 93 … … 1204 1210 * nodes are assigned in the Data::Data() constructor and don't do it 1205 1211 * here. It implies that this method may only be called after constructing 1206 * a new BIOSSettings object while all its data fields are in the default1212 * a new FirmwareSettings object while all its data fields are in the default 1207 1213 * values. Exceptions are fields whose creation time defaults don't match 1208 1214 * values that should be applied when these fields are not explicitly set -
trunk/src/VBox/Main/src-server/SerialPortImpl.cpp
r98292 r101035 377 377 378 378 379 HRESULT SerialPort::getIO Base(ULONG *aIOBase)380 { 381 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 382 383 *aIOBase = m->bd->ulIO Base;384 385 return S_OK; 386 } 387 388 HRESULT SerialPort::setIO Base(ULONG aIOBase)379 HRESULT SerialPort::getIOAddress(ULONG *aIOBase) 380 { 381 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 382 383 *aIOBase = m->bd->ulIOAddress; 384 385 return S_OK; 386 } 387 388 HRESULT SerialPort::setIOAddress(ULONG aIOBase) 389 389 { 390 390 /* check IOBase limits 391 391 * (when changing this, make sure it corresponds to XML schema */ 392 if (aIOBase > 0xFFFF) 392 if (aIOBase > 0xFFFF) /** @todo BUGBUG Check with ARM. */ 393 393 return setError(E_INVALIDARG, 394 394 tr("Invalid I/O port base address of the serial port %d: %lu (must be in range [0, 0x%X])"), … … 406 406 HRESULT hrc = S_OK; 407 407 408 if (m->bd->ulIO Base!= aIOBase)408 if (m->bd->ulIOAddress != aIOBase) 409 409 { 410 410 m->bd.backup(); 411 m->bd->ulIO Base= aIOBase;411 m->bd->ulIOAddress = aIOBase; 412 412 413 413 m->fModified = true; … … 681 681 case 0: 682 682 { 683 m->bd->ulIO Base= 0x3f8;683 m->bd->ulIOAddress = 0x3f8; 684 684 m->bd->ulIRQ = 4; 685 685 break; … … 687 687 case 1: 688 688 { 689 m->bd->ulIO Base= 0x2f8;689 m->bd->ulIOAddress = 0x2f8; 690 690 m->bd->ulIRQ = 3; 691 691 break; … … 693 693 case 2: 694 694 { 695 m->bd->ulIO Base= 0x3e8;695 m->bd->ulIOAddress = 0x3e8; 696 696 m->bd->ulIRQ = 4; 697 697 break; … … 699 699 case 3: 700 700 { 701 m->bd->ulIO Base= 0x2e8;701 m->bd->ulIOAddress = 0x2e8; 702 702 m->bd->ulIRQ = 3; 703 703 break; … … 735 735 { 736 736 case 0: 737 if (m->bd->ulIO Base== 0x3f8 && m->bd->ulIRQ == 4)737 if (m->bd->ulIOAddress == 0x3f8 && m->bd->ulIRQ == 4) 738 738 return true; 739 739 break; 740 740 case 1: 741 if (m->bd->ulIO Base== 0x2f8 && m->bd->ulIRQ == 3)741 if (m->bd->ulIOAddress == 0x2f8 && m->bd->ulIRQ == 3) 742 742 return true; 743 743 break; 744 744 case 2: 745 if (m->bd->ulIO Base== 0x3e8 && m->bd->ulIRQ == 4)745 if (m->bd->ulIOAddress == 0x3e8 && m->bd->ulIRQ == 4) 746 746 return true; 747 747 break; 748 748 case 3: 749 if (m->bd->ulIO Base== 0x2e8 && m->bd->ulIRQ == 3)749 if (m->bd->ulIOAddress == 0x2e8 && m->bd->ulIRQ == 3) 750 750 return true; 751 751 break; … … 757 757 /* Detect old-style defaults (0x3f8, irq 4) in any slot, they are still 758 758 * in place for many VMs created by old VirtualBox versions. */ 759 if (m->bd->ulIO Base== 0x3f8 && m->bd->ulIRQ == 4)759 if (m->bd->ulIOAddress == 0x3f8 && m->bd->ulIRQ == 4) 760 760 return true; 761 761 } -
trunk/src/VBox/Main/src-server/SnapshotImpl.cpp
r100200 r101035 1164 1164 /* create all other child objects that will be immutable private copies */ 1165 1165 1166 unconst(mBIOSSettings).createObject(); 1167 hrc = mBIOSSettings->initCopy(this, pMachine->mBIOSSettings); 1166 unconst(mPlatform).createObject(); 1167 hrc = mPlatform->initCopy(this, pMachine->mPlatform); 1168 if (FAILED(hrc)) return hrc; 1169 1170 unconst(mPlatformProperties).createObject(); 1171 hrc = mPlatformProperties->init(mParent); /* Does not contain any "real" data, hence only init() and not initCopy(). */ 1172 if (FAILED(hrc)) return hrc; 1173 1174 unconst(mFirmwareSettings).createObject(); 1175 hrc = mFirmwareSettings->initCopy(this, pMachine->mFirmwareSettings); 1168 1176 if (FAILED(hrc)) return hrc; 1169 1177 … … 1309 1317 /* create all other child objects that will be immutable private copies */ 1310 1318 1311 unconst(mBIOSSettings).createObject(); 1312 mBIOSSettings->init(this); 1319 unconst(mPlatform).createObject(); 1320 mPlatform->init(this); 1321 mPlatform->i_loadSettings(hardware.platformSettings); /* Needed for initializing the network adapters below (chipset type). */ 1322 1323 unconst(mPlatformProperties).createObject(); 1324 mPlatformProperties->init(mParent); 1325 1326 unconst(mFirmwareSettings).createObject(); 1327 mFirmwareSettings->init(this); 1313 1328 1314 1329 unconst(mRecordingSettings).createObject(); … … 1333 1348 mUSBDeviceFilters->init(this); 1334 1349 1335 mNetworkAdapters.resize( Global::getMaxNetworkAdapters(mHWData->mChipsetType));1350 mNetworkAdapters.resize(PlatformProperties::s_getMaxNetworkAdapters(hardware.platformSettings.chipsetType)); 1336 1351 for (ULONG slot = 0; slot < mNetworkAdapters.size(); slot++) 1337 1352 { -
trunk/src/VBox/Main/src-server/StorageControllerImpl.cpp
r98292 r101035 110 110 tr("Invalid storage connection type")); 111 111 112 ChipsetType_T chipsetType; 113 HRESULT hrc = aParent->i_getPlatform()->COMGETTER(ChipsetType)(&chipsetType); 114 AssertComRCReturnRC(hrc); 115 112 116 ULONG maxInstances; 113 ChipsetType_T chipsetType; 114 HRESULT hrc = aParent->COMGETTER(ChipsetType)(&chipsetType); 115 if (FAILED(hrc)) 116 return hrc; 117 hrc = aParent->i_getVirtualBox()->i_getSystemProperties()-> 118 GetMaxInstancesOfStorageBus(chipsetType, aStorageBus, &maxInstances); 119 if (FAILED(hrc)) 120 return hrc; 117 hrc = aParent->i_getPlatformProperties()->GetMaxInstancesOfStorageBus(chipsetType, aStorageBus, &maxInstances); 118 AssertComRCReturnRC(hrc); 119 121 120 if (aInstance >= maxInstances) 122 121 return setError(E_INVALIDARG, … … 446 445 { 447 446 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 448 return m->p SystemProperties->GetMaxDevicesPerPortForStorageBus(m->bd->storageBus, aMaxDevicesPerPortCount);447 return m->pParent->i_getPlatformProperties()->GetMaxDevicesPerPortForStorageBus(m->bd->storageBus, aMaxDevicesPerPortCount); 449 448 } 450 449 … … 452 451 { 453 452 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 454 return m->p SystemProperties->GetMinPortCountForStorageBus(m->bd->storageBus, aMinPortCount);453 return m->pParent->i_getPlatformProperties()->GetMinPortCountForStorageBus(m->bd->storageBus, aMinPortCount); 455 454 } 456 455 … … 458 457 { 459 458 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 460 return m->p SystemProperties->GetMaxPortCountForStorageBus(m->bd->storageBus, aMaxPortCount);459 return m->pParent->i_getPlatformProperties()->GetMaxPortCountForStorageBus(m->bd->storageBus, aMaxPortCount); 461 460 } 462 461 … … 707 706 ULONG portCount = m->bd->ulPortCount; 708 707 ULONG devicesPerPort; 709 HRESULT hrc = m->p SystemProperties->GetMaxDevicesPerPortForStorageBus(m->bd->storageBus, &devicesPerPort);708 HRESULT hrc = m->pParent->i_getPlatformProperties()->GetMaxDevicesPerPortForStorageBus(m->bd->storageBus, &devicesPerPort); 710 709 if (FAILED(hrc)) return hrc; 711 710 -
trunk/src/VBox/Main/src-server/SystemPropertiesImpl.cpp
r98292 r101035 117 117 m->uLogHistoryCount = 3; 118 118 119 120 /* On Windows, OS X and Solaris, HW virtualization use isn't exclusive121 * by default so that VT-x or AMD-V can be shared with other122 * hypervisors without requiring user intervention.123 * NB: See also SystemProperties constructor in settings.h124 */125 #if defined(RT_OS_DARWIN) || defined(RT_OS_WINDOWS) || defined(RT_OS_SOLARIS)126 m->fExclusiveHwVirt = false;127 #else128 m->fExclusiveHwVirt = true;129 #endif130 131 119 HRESULT hrc = S_OK; 132 120 … … 152 140 153 141 m_llMediumFormats.push_back(hdf); 142 } 143 } 144 145 if (SUCCEEDED(hrc)) 146 { 147 hrc = unconst(m_platformProperties).createObject(); 148 if (SUCCEEDED(hrc)) 149 { 150 hrc = m_platformProperties->init(mParent); 151 if (SUCCEEDED(hrc)) 152 hrc = m_platformProperties->i_setArchitecture(PlatformProperties::s_getHostPlatformArchitecture()); 154 153 } 155 154 } … … 268 267 269 268 270 HRESULT SystemProperties::getSerialPortCount(ULONG *count)271 {272 /* no need to lock, this is const */273 *count = SchemaDefs::SerialPortCount;274 275 return S_OK;276 }277 278 279 HRESULT SystemProperties::getParallelPortCount(ULONG *count)280 {281 /* no need to lock, this is const */282 *count = SchemaDefs::ParallelPortCount;283 284 return S_OK;285 }286 287 288 HRESULT SystemProperties::getMaxBootPosition(ULONG *aMaxBootPosition)289 {290 /* no need to lock, this is const */291 *aMaxBootPosition = SchemaDefs::MaxBootPosition;292 293 return S_OK;294 }295 296 297 HRESULT SystemProperties::getRawModeSupported(BOOL *aRawModeSupported)298 {299 *aRawModeSupported = FALSE;300 return S_OK;301 }302 303 304 HRESULT SystemProperties::getExclusiveHwVirt(BOOL *aExclusiveHwVirt)305 {306 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);307 308 *aExclusiveHwVirt = m->fExclusiveHwVirt;309 310 return S_OK;311 }312 313 HRESULT SystemProperties::setExclusiveHwVirt(BOOL aExclusiveHwVirt)314 {315 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);316 m->fExclusiveHwVirt = !!aExclusiveHwVirt;317 alock.release();318 319 // VirtualBox::i_saveSettings() needs vbox write lock320 AutoWriteLock vboxLock(mParent COMMA_LOCKVAL_SRC_POS);321 return mParent->i_saveSettings();322 }323 324 HRESULT SystemProperties::getMaxNetworkAdapters(ChipsetType_T aChipset, ULONG *aMaxNetworkAdapters)325 {326 /* no need for locking, no state */327 uint32_t uResult = Global::getMaxNetworkAdapters(aChipset);328 if (uResult == 0)329 AssertMsgFailed(("Invalid chipset type %d\n", aChipset));330 *aMaxNetworkAdapters = uResult;331 return S_OK;332 }333 334 HRESULT SystemProperties::getMaxNetworkAdaptersOfType(ChipsetType_T aChipset, NetworkAttachmentType_T aType, ULONG *count)335 {336 /* no need for locking, no state */337 uint32_t uResult = Global::getMaxNetworkAdapters(aChipset);338 if (uResult == 0)339 AssertMsgFailed(("Invalid chipset type %d\n", aChipset));340 341 switch (aType)342 {343 case NetworkAttachmentType_NAT:344 case NetworkAttachmentType_Internal:345 case NetworkAttachmentType_NATNetwork:346 /* chipset default is OK */347 break;348 case NetworkAttachmentType_Bridged:349 /* Maybe use current host interface count here? */350 break;351 case NetworkAttachmentType_HostOnly:352 uResult = RT_MIN(uResult, 8);353 break;354 default:355 AssertMsgFailed(("Unhandled attachment type %d\n", aType));356 }357 358 *count = uResult;359 360 return S_OK;361 }362 363 364 HRESULT SystemProperties::getMaxDevicesPerPortForStorageBus(StorageBus_T aBus,365 ULONG *aMaxDevicesPerPort)366 {367 /* no need to lock, this is const */368 switch (aBus)369 {370 case StorageBus_SATA:371 case StorageBus_SCSI:372 case StorageBus_SAS:373 case StorageBus_USB:374 case StorageBus_PCIe:375 case StorageBus_VirtioSCSI:376 {377 /* SATA and both SCSI controllers only support one device per port. */378 *aMaxDevicesPerPort = 1;379 break;380 }381 case StorageBus_IDE:382 case StorageBus_Floppy:383 {384 /* The IDE and Floppy controllers support 2 devices. One as master385 * and one as slave (or floppy drive 0 and 1). */386 *aMaxDevicesPerPort = 2;387 break;388 }389 default:390 AssertMsgFailed(("Invalid bus type %d\n", aBus));391 }392 393 return S_OK;394 }395 396 HRESULT SystemProperties::getMinPortCountForStorageBus(StorageBus_T aBus,397 ULONG *aMinPortCount)398 {399 /* no need to lock, this is const */400 switch (aBus)401 {402 case StorageBus_SATA:403 case StorageBus_SAS:404 case StorageBus_PCIe:405 case StorageBus_VirtioSCSI:406 {407 *aMinPortCount = 1;408 break;409 }410 case StorageBus_SCSI:411 {412 *aMinPortCount = 16;413 break;414 }415 case StorageBus_IDE:416 {417 *aMinPortCount = 2;418 break;419 }420 case StorageBus_Floppy:421 {422 *aMinPortCount = 1;423 break;424 }425 case StorageBus_USB:426 {427 *aMinPortCount = 8;428 break;429 }430 default:431 AssertMsgFailed(("Invalid bus type %d\n", aBus));432 }433 434 return S_OK;435 }436 437 HRESULT SystemProperties::getMaxPortCountForStorageBus(StorageBus_T aBus,438 ULONG *aMaxPortCount)439 {440 /* no need to lock, this is const */441 switch (aBus)442 {443 case StorageBus_SATA:444 {445 *aMaxPortCount = 30;446 break;447 }448 case StorageBus_SCSI:449 {450 *aMaxPortCount = 16;451 break;452 }453 case StorageBus_IDE:454 {455 *aMaxPortCount = 2;456 break;457 }458 case StorageBus_Floppy:459 {460 *aMaxPortCount = 1;461 break;462 }463 case StorageBus_SAS:464 case StorageBus_PCIe:465 {466 *aMaxPortCount = 255;467 break;468 }469 case StorageBus_USB:470 {471 *aMaxPortCount = 8;472 break;473 }474 case StorageBus_VirtioSCSI:475 {476 *aMaxPortCount = 256;477 break;478 }479 default:480 AssertMsgFailed(("Invalid bus type %d\n", aBus));481 }482 483 return S_OK;484 }485 486 HRESULT SystemProperties::getMaxInstancesOfStorageBus(ChipsetType_T aChipset,487 StorageBus_T aBus,488 ULONG *aMaxInstances)489 {490 ULONG cCtrs = 0;491 492 /* no need to lock, this is const */493 switch (aBus)494 {495 case StorageBus_SATA:496 case StorageBus_SCSI:497 case StorageBus_SAS:498 case StorageBus_PCIe:499 case StorageBus_VirtioSCSI:500 cCtrs = aChipset == ChipsetType_ICH9 ? 8 : 1;501 break;502 case StorageBus_USB:503 case StorageBus_IDE:504 case StorageBus_Floppy:505 {506 cCtrs = 1;507 break;508 }509 default:510 AssertMsgFailed(("Invalid bus type %d\n", aBus));511 }512 513 *aMaxInstances = cCtrs;514 515 return S_OK;516 }517 518 HRESULT SystemProperties::getDeviceTypesForStorageBus(StorageBus_T aBus,519 std::vector<DeviceType_T> &aDeviceTypes)520 {521 aDeviceTypes.resize(0);522 523 /* no need to lock, this is const */524 switch (aBus)525 {526 case StorageBus_IDE:527 case StorageBus_SATA:528 case StorageBus_SCSI:529 case StorageBus_SAS:530 case StorageBus_USB:531 case StorageBus_VirtioSCSI:532 {533 aDeviceTypes.resize(2);534 aDeviceTypes[0] = DeviceType_DVD;535 aDeviceTypes[1] = DeviceType_HardDisk;536 break;537 }538 case StorageBus_Floppy:539 {540 aDeviceTypes.resize(1);541 aDeviceTypes[0] = DeviceType_Floppy;542 break;543 }544 case StorageBus_PCIe:545 {546 aDeviceTypes.resize(1);547 aDeviceTypes[0] = DeviceType_HardDisk;548 break;549 }550 default:551 AssertMsgFailed(("Invalid bus type %d\n", aBus));552 }553 554 return S_OK;555 }556 557 HRESULT SystemProperties::getStorageBusForStorageControllerType(StorageControllerType_T aStorageControllerType,558 StorageBus_T *aStorageBus)559 {560 /* no need to lock, this is const */561 switch (aStorageControllerType)562 {563 case StorageControllerType_LsiLogic:564 case StorageControllerType_BusLogic:565 *aStorageBus = StorageBus_SCSI;566 break;567 case StorageControllerType_IntelAhci:568 *aStorageBus = StorageBus_SATA;569 break;570 case StorageControllerType_PIIX3:571 case StorageControllerType_PIIX4:572 case StorageControllerType_ICH6:573 *aStorageBus = StorageBus_IDE;574 break;575 case StorageControllerType_I82078:576 *aStorageBus = StorageBus_Floppy;577 break;578 case StorageControllerType_LsiLogicSas:579 *aStorageBus = StorageBus_SAS;580 break;581 case StorageControllerType_USB:582 *aStorageBus = StorageBus_USB;583 break;584 case StorageControllerType_NVMe:585 *aStorageBus = StorageBus_PCIe;586 break;587 case StorageControllerType_VirtioSCSI:588 *aStorageBus = StorageBus_VirtioSCSI;589 break;590 default:591 return setError(E_FAIL, tr("Invalid storage controller type %d\n"), aStorageBus);592 }593 594 return S_OK;595 }596 597 HRESULT SystemProperties::getStorageControllerTypesForStorageBus(StorageBus_T aStorageBus,598 std::vector<StorageControllerType_T> &aStorageControllerTypes)599 {600 aStorageControllerTypes.resize(0);601 602 /* no need to lock, this is const */603 switch (aStorageBus)604 {605 case StorageBus_IDE:606 aStorageControllerTypes.resize(3);607 aStorageControllerTypes[0] = StorageControllerType_PIIX4;608 aStorageControllerTypes[1] = StorageControllerType_PIIX3;609 aStorageControllerTypes[2] = StorageControllerType_ICH6;610 break;611 case StorageBus_SATA:612 aStorageControllerTypes.resize(1);613 aStorageControllerTypes[0] = StorageControllerType_IntelAhci;614 break;615 case StorageBus_SCSI:616 aStorageControllerTypes.resize(2);617 aStorageControllerTypes[0] = StorageControllerType_LsiLogic;618 aStorageControllerTypes[1] = StorageControllerType_BusLogic;619 break;620 case StorageBus_Floppy:621 aStorageControllerTypes.resize(1);622 aStorageControllerTypes[0] = StorageControllerType_I82078;623 break;624 case StorageBus_SAS:625 aStorageControllerTypes.resize(1);626 aStorageControllerTypes[0] = StorageControllerType_LsiLogicSas;627 break;628 case StorageBus_USB:629 aStorageControllerTypes.resize(1);630 aStorageControllerTypes[0] = StorageControllerType_USB;631 break;632 case StorageBus_PCIe:633 aStorageControllerTypes.resize(1);634 aStorageControllerTypes[0] = StorageControllerType_NVMe;635 break;636 case StorageBus_VirtioSCSI:637 aStorageControllerTypes.resize(1);638 aStorageControllerTypes[0] = StorageControllerType_VirtioSCSI;639 break;640 default:641 return setError(E_FAIL, tr("Invalid storage bus %d\n"), aStorageBus);642 }643 644 return S_OK;645 }646 647 269 HRESULT SystemProperties::getDefaultIoCacheSettingForStorageController(StorageControllerType_T aControllerType, 648 270 BOOL *aEnabled) … … 669 291 AssertMsgFailed(("Invalid controller type %d\n", aControllerType)); 670 292 } 671 return S_OK;672 }673 674 HRESULT SystemProperties::getStorageControllerHotplugCapable(StorageControllerType_T aControllerType,675 BOOL *aHotplugCapable)676 {677 switch (aControllerType)678 {679 case StorageControllerType_IntelAhci:680 case StorageControllerType_USB:681 *aHotplugCapable = true;682 break;683 case StorageControllerType_LsiLogic:684 case StorageControllerType_LsiLogicSas:685 case StorageControllerType_BusLogic:686 case StorageControllerType_NVMe:687 case StorageControllerType_VirtioSCSI:688 case StorageControllerType_PIIX3:689 case StorageControllerType_PIIX4:690 case StorageControllerType_ICH6:691 case StorageControllerType_I82078:692 *aHotplugCapable = false;693 break;694 default:695 AssertMsgFailedReturn(("Invalid controller type %d\n", aControllerType), E_FAIL);696 }697 698 return S_OK;699 }700 701 HRESULT SystemProperties::getMaxInstancesOfUSBControllerType(ChipsetType_T aChipset,702 USBControllerType_T aType,703 ULONG *aMaxInstances)704 {705 NOREF(aChipset);706 ULONG cCtrs = 0;707 708 /* no need to lock, this is const */709 switch (aType)710 {711 case USBControllerType_OHCI:712 case USBControllerType_EHCI:713 case USBControllerType_XHCI:714 {715 cCtrs = 1;716 break;717 }718 default:719 AssertMsgFailed(("Invalid bus type %d\n", aType));720 }721 722 *aMaxInstances = cCtrs;723 724 293 return S_OK; 725 294 } … … 1360 929 } 1361 930 931 HRESULT SystemProperties::getPlatform(ComPtr<IPlatformProperties> &aPlatformProperties) 932 { 933 /* No need to lock, as m_platformProperties is const. */ 934 935 return m_platformProperties.queryInterfaceTo(aPlatformProperties.asOutParam()); 936 } 937 1362 938 HRESULT SystemProperties::getProxyMode(ProxyMode_T *pProxyMode) 1363 939 { … … 1445 1021 } 1446 1022 1447 HRESULT SystemProperties::getSupportedParavirtProviders(std::vector<ParavirtProvider_T> &aSupportedParavirtProviders)1448 {1449 static const ParavirtProvider_T aParavirtProviders[] =1450 {1451 ParavirtProvider_None,1452 ParavirtProvider_Default,1453 ParavirtProvider_Legacy,1454 ParavirtProvider_Minimal,1455 ParavirtProvider_HyperV,1456 ParavirtProvider_KVM,1457 };1458 aSupportedParavirtProviders.assign(aParavirtProviders,1459 aParavirtProviders + RT_ELEMENTS(aParavirtProviders));1460 return S_OK;1461 }1462 1463 1023 HRESULT SystemProperties::getSupportedClipboardModes(std::vector<ClipboardMode_T> &aSupportedClipboardModes) 1464 1024 { … … 1486 1046 aSupportedDnDModes.assign(aDnDModes, 1487 1047 aDnDModes + RT_ELEMENTS(aDnDModes)); 1488 return S_OK;1489 }1490 1491 HRESULT SystemProperties::getSupportedFirmwareTypes(std::vector<FirmwareType_T> &aSupportedFirmwareTypes)1492 {1493 static const FirmwareType_T aFirmwareTypes[] =1494 {1495 FirmwareType_BIOS,1496 FirmwareType_EFI,1497 FirmwareType_EFI32,1498 FirmwareType_EFI64,1499 FirmwareType_EFIDUAL,1500 };1501 aSupportedFirmwareTypes.assign(aFirmwareTypes,1502 aFirmwareTypes + RT_ELEMENTS(aFirmwareTypes));1503 1048 return S_OK; 1504 1049 } … … 1678 1223 aSupportedRecordingVideoRateControlModes.assign(aRecordingVideoRateControlModes, 1679 1224 aRecordingVideoRateControlModes + RT_ELEMENTS(aRecordingVideoRateControlModes)); 1680 return S_OK;1681 }1682 1683 HRESULT SystemProperties::getSupportedGraphicsControllerTypes(std::vector<GraphicsControllerType_T> &aSupportedGraphicsControllerTypes)1684 {1685 static const GraphicsControllerType_T aGraphicsControllerTypes[] =1686 {1687 GraphicsControllerType_VBoxVGA,1688 GraphicsControllerType_VMSVGA,1689 GraphicsControllerType_VBoxSVGA,1690 GraphicsControllerType_Null,1691 };1692 aSupportedGraphicsControllerTypes.assign(aGraphicsControllerTypes,1693 aGraphicsControllerTypes + RT_ELEMENTS(aGraphicsControllerTypes));1694 1225 return S_OK; 1695 1226 } … … 1762 1293 } 1763 1294 1764 HRESULT SystemProperties::getSupportedNetworkAdapterTypes(std::vector<NetworkAdapterType_T> &aSupportedNetworkAdapterTypes)1765 {1766 static const NetworkAdapterType_T aNetworkAdapterTypes[] =1767 {1768 NetworkAdapterType_Am79C970A,1769 NetworkAdapterType_Am79C973,1770 NetworkAdapterType_I82540EM,1771 NetworkAdapterType_I82543GC,1772 NetworkAdapterType_I82545EM,1773 NetworkAdapterType_Virtio,1774 };1775 aSupportedNetworkAdapterTypes.assign(aNetworkAdapterTypes,1776 aNetworkAdapterTypes + RT_ELEMENTS(aNetworkAdapterTypes));1777 return S_OK;1778 }1779 1780 1295 HRESULT SystemProperties::getSupportedPortModes(std::vector<PortMode_T> &aSupportedPortModes) 1781 1296 { … … 1790 1305 aSupportedPortModes.assign(aPortModes, 1791 1306 aPortModes + RT_ELEMENTS(aPortModes)); 1792 return S_OK;1793 }1794 1795 HRESULT SystemProperties::getSupportedUartTypes(std::vector<UartType_T> &aSupportedUartTypes)1796 {1797 static const UartType_T aUartTypes[] =1798 {1799 UartType_U16450,1800 UartType_U16550A,1801 UartType_U16750,1802 };1803 aSupportedUartTypes.assign(aUartTypes,1804 aUartTypes + RT_ELEMENTS(aUartTypes));1805 return S_OK;1806 }1807 1808 HRESULT SystemProperties::getSupportedUSBControllerTypes(std::vector<USBControllerType_T> &aSupportedUSBControllerTypes)1809 {1810 static const USBControllerType_T aUSBControllerTypes[] =1811 {1812 USBControllerType_OHCI,1813 USBControllerType_EHCI,1814 USBControllerType_XHCI,1815 };1816 aSupportedUSBControllerTypes.assign(aUSBControllerTypes,1817 aUSBControllerTypes + RT_ELEMENTS(aUSBControllerTypes));1818 1307 return S_OK; 1819 1308 } … … 1858 1347 } 1859 1348 1860 HRESULT SystemProperties::getSupportedAudioControllerTypes(std::vector<AudioControllerType_T> &aSupportedAudioControllerTypes)1861 {1862 static const AudioControllerType_T aAudioControllerTypes[] =1863 {1864 AudioControllerType_AC97,1865 AudioControllerType_SB16,1866 AudioControllerType_HDA,1867 };1868 aSupportedAudioControllerTypes.assign(aAudioControllerTypes,1869 aAudioControllerTypes + RT_ELEMENTS(aAudioControllerTypes));1870 return S_OK;1871 }1872 1873 HRESULT SystemProperties::getSupportedStorageBuses(std::vector<StorageBus_T> &aSupportedStorageBuses)1874 {1875 static const StorageBus_T aStorageBuses[] =1876 {1877 StorageBus_SATA,1878 StorageBus_IDE,1879 StorageBus_SCSI,1880 StorageBus_Floppy,1881 StorageBus_SAS,1882 StorageBus_USB,1883 StorageBus_PCIe,1884 StorageBus_VirtioSCSI,1885 };1886 aSupportedStorageBuses.assign(aStorageBuses,1887 aStorageBuses + RT_ELEMENTS(aStorageBuses));1888 return S_OK;1889 }1890 1891 HRESULT SystemProperties::getSupportedStorageControllerTypes(std::vector<StorageControllerType_T> &aSupportedStorageControllerTypes)1892 {1893 static const StorageControllerType_T aStorageControllerTypes[] =1894 {1895 StorageControllerType_IntelAhci,1896 StorageControllerType_PIIX4,1897 StorageControllerType_PIIX3,1898 StorageControllerType_ICH6,1899 StorageControllerType_LsiLogic,1900 StorageControllerType_BusLogic,1901 StorageControllerType_I82078,1902 StorageControllerType_LsiLogicSas,1903 StorageControllerType_USB,1904 StorageControllerType_NVMe,1905 StorageControllerType_VirtioSCSI,1906 };1907 aSupportedStorageControllerTypes.assign(aStorageControllerTypes,1908 aStorageControllerTypes + RT_ELEMENTS(aStorageControllerTypes));1909 return S_OK;1910 }1911 1912 HRESULT SystemProperties::getSupportedChipsetTypes(std::vector<ChipsetType_T> &aSupportedChipsetTypes)1913 {1914 static const ChipsetType_T aChipsetTypes[] =1915 {1916 ChipsetType_PIIX3,1917 ChipsetType_ICH9,1918 };1919 aSupportedChipsetTypes.assign(aChipsetTypes,1920 aChipsetTypes + RT_ELEMENTS(aChipsetTypes));1921 return S_OK;1922 }1923 1924 HRESULT SystemProperties::getSupportedIommuTypes(std::vector<IommuType_T> &aSupportedIommuTypes)1925 {1926 static const IommuType_T aIommuTypes[] =1927 {1928 IommuType_None,1929 IommuType_Automatic,1930 IommuType_AMD,1931 /** @todo Add Intel when it's supported. */1932 };1933 aSupportedIommuTypes.assign(aIommuTypes,1934 aIommuTypes + RT_ELEMENTS(aIommuTypes));1935 return S_OK;1936 }1937 1938 HRESULT SystemProperties::getSupportedTpmTypes(std::vector<TpmType_T> &aSupportedTpmTypes)1939 {1940 static const TpmType_T aTpmTypes[] =1941 {1942 TpmType_None,1943 TpmType_v1_2,1944 TpmType_v2_01945 };1946 aSupportedTpmTypes.assign(aTpmTypes,1947 aTpmTypes + RT_ELEMENTS(aTpmTypes));1948 return S_OK;1949 }1950 1951 1349 1952 1350 // public methods only for internal purposes … … 1981 1379 1982 1380 m->uLogHistoryCount = data.uLogHistoryCount; 1983 m->fExclusiveHwVirt = data.fExclusiveHwVirt;1984 1381 m->uProxyMode = data.uProxyMode; 1985 1382 m->strProxyUrl = data.strProxyUrl; -
trunk/src/VBox/Main/src-server/UnattendedImpl.cpp
r100108 r101035 2509 2509 bool const fIs64Bit = i_isGuestOSArchX64(strGuestOsTypeId); 2510 2510 2511 ComPtr<IPlatform> pPlatform; 2512 hrc = ptrMachine->COMGETTER(Platform)(pPlatform.asOutParam()); 2513 AssertComRCReturn(hrc, hrc); 2514 2511 2515 BOOL fRtcUseUtc = FALSE; 2512 hrc = p trMachine->COMGETTER(RTCUseUTC)(&fRtcUseUtc);2516 hrc = pPlatform->COMGETTER(RTCUseUTC)(&fRtcUseUtc); 2513 2517 if (FAILED(hrc)) 2514 2518 return hrc; 2515 2519 2520 ComPtr<IFirmwareSettings> pFirmwareSettings; 2521 hrc = ptrMachine->COMGETTER(FirmwareSettings)(pFirmwareSettings.asOutParam()); 2522 AssertComRCReturn(hrc, hrc); 2523 2516 2524 FirmwareType_T enmFirmware = FirmwareType_BIOS; 2517 hrc = p trMachine->COMGETTER(FirmwareType)(&enmFirmware);2525 hrc = pFirmwareSettings->COMGETTER(FirmwareType)(&enmFirmware); 2518 2526 if (FAILED(hrc)) 2519 2527 return hrc; -
trunk/src/VBox/Main/src-server/VirtualBoxImpl.cpp
r100737 r101035 1253 1253 } 1254 1254 1255 HRESULT VirtualBox::getPlatformProperties(PlatformArchitecture_T platformArchitecture, 1256 ComPtr<IPlatformProperties> &aPlatformProperties) 1257 { 1258 ComObjPtr<PlatformProperties> platformProperties; 1259 HRESULT hrc = platformProperties.createObject(); 1260 AssertComRCReturn(hrc, hrc); 1261 1262 hrc = platformProperties->init(this); 1263 AssertComRCReturn(hrc, hrc); 1264 1265 hrc = platformProperties->i_setArchitecture(platformArchitecture); 1266 AssertComRCReturn(hrc, hrc); 1267 1268 return platformProperties.queryInterfaceTo(aPlatformProperties.asOutParam()); 1269 } 1270 1255 1271 HRESULT VirtualBox::getSystemProperties(ComPtr<ISystemProperties> &aSystemProperties) 1256 1272 { … … 1600 1616 if (pMachine->i_isAccessible()) 1601 1617 { 1602 uint32_t cNetworkAdapters = Global::getMaxNetworkAdapters(pMachine->i_getChipsetType()); 1618 ChipsetType_T enmChipsetType; 1619 HRESULT hrc = pMachine->i_getPlatform()->getChipsetType(&enmChipsetType); 1620 ComAssertComRC(hrc); 1621 1622 uint32_t const cNetworkAdapters = PlatformProperties::s_getMaxNetworkAdapters(enmChipsetType); 1603 1623 for (ULONG i = 0; i < cNetworkAdapters; i++) 1604 1624 { 1605 1625 ComPtr<INetworkAdapter> pNet; 1606 HRESULThrc = pMachine->GetNetworkAdapter(i, pNet.asOutParam());1626 hrc = pMachine->GetNetworkAdapter(i, pNet.asOutParam()); 1607 1627 if (FAILED(hrc) || pNet.isNull()) 1608 1628 continue; … … 1651 1671 if (pMachine->i_isAccessible()) 1652 1672 { 1653 uint32_t cNetworkAdapters = Global::getMaxNetworkAdapters(pMachine->i_getChipsetType()); 1673 ChipsetType_T enmChipsetType; 1674 HRESULT hrc = pMachine->i_getPlatform()->getChipsetType(&enmChipsetType); 1675 ComAssertComRC(hrc); 1676 1677 uint32_t const cNetworkAdapters = PlatformProperties::s_getMaxNetworkAdapters(enmChipsetType); 1654 1678 for (ULONG i = 0; i < cNetworkAdapters; i++) 1655 1679 { 1656 1680 ComPtr<INetworkAdapter> pNet; 1657 HRESULThrc = pMachine->GetNetworkAdapter(i, pNet.asOutParam());1681 hrc = pMachine->GetNetworkAdapter(i, pNet.asOutParam()); 1658 1682 if (FAILED(hrc) || pNet.isNull()) 1659 1683 continue; … … 2088 2112 HRESULT VirtualBox::createMachine(const com::Utf8Str &aSettingsFile, 2089 2113 const com::Utf8Str &aName, 2114 PlatformArchitecture_T aArchitecture, 2090 2115 const std::vector<com::Utf8Str> &aGroups, 2091 2116 const com::Utf8Str &aOsTypeId, … … 2097 2122 { 2098 2123 LogFlowThisFuncEnter(); 2099 LogFlowThisFunc(("aSettingsFile=\"%s\", aName=\"%s\", a OsTypeId =\"%s\", aCreateFlags=\"%s\"\n",2100 aSettingsFile.c_str(), aName.c_str(), a OsTypeId.c_str(), aFlags.c_str()));2124 LogFlowThisFunc(("aSettingsFile=\"%s\", aName=\"%s\", aArchitecture=%#x, aOsTypeId =\"%s\", aCreateFlags=\"%s\"\n", 2125 aSettingsFile.c_str(), aName.c_str(), aArchitecture, aOsTypeId.c_str(), aFlags.c_str())); 2101 2126 2102 2127 StringsList llGroups; … … 2105 2130 return hrc; 2106 2131 2107 /** @todo r=bird: Would be goo tto rewrite this parsing using offset into2132 /** @todo r=bird: Would be good to rewrite this parsing using offset into 2108 2133 * aFlags and drop all the C pointers, strchr, misguided RTStrStr and 2109 2134 * tedious copying of substrings. */ … … 2185 2210 strSettingsFile, 2186 2211 aName, 2212 aArchitecture, 2187 2213 llGroups, 2188 2214 aOsTypeId, -
trunk/src/VBox/Main/testcase/Makefile.kmk
r99770 r101035 48 48 tstMediumLock \ 49 49 tstSafeArray \ 50 tstSettings \ 50 51 tstBstr \ 51 52 tstGuid \ … … 294 295 tstSafeArray_SOURCES = tstSafeArray.cpp 295 296 297 298 # 299 # tstSettings 300 # 301 tstSettings_TEMPLATE = VBoxMainClientTstExe 302 tstSettings_INCS = \ 303 ../include \ 304 $(VBOX_MAIN_APIWRAPPER_INCS) \ 305 $(dir $(VBOX_XML_SCHEMADEFS_H)) 306 tstSettings_SOURCES = \ 307 tstSettings.cpp \ 308 ../src-all/HashedPw.cpp \ 309 ../xml/Settings.cpp 296 310 297 311 # … … 349 363 # generate rules. 350 364 include $(FILE_KBUILD_SUB_FOOTER) 351 -
trunk/src/VBox/Main/testcase/tstVBoxAPI.cpp
r98103 r101035 65 65 66 66 67 static BOOLtstApiIVirtualBox(IVirtualBox *pVBox)67 static void tstApiIVirtualBox(IVirtualBox *pVBox) 68 68 { 69 69 HRESULT hrc; … … 128 128 RTTestFailed(g_hTest, "%d: IVirtualBox::guestOSTypes failed", __LINE__); 129 129 130 /** Create VM */ 130 /* For now we only test same-same architectures (host == guest). */ 131 PlatformArchitecture_T enmPlatformArch; 132 #if defined(RT_ARCH_X86) || defined(RT_ARCH_AMD64) 133 enmPlatformArch = PlatformArchitecture_x86; 134 #elif defined(RT_ARCH_ARM32) || defined(RT_ARCH_ARM64) 135 enmPlatformArch = PlatformArchitecture_ARM; 136 #else 137 # error "Port me!" 138 #endif 139 140 /* 141 * Host 142 */ 143 ComPtr<IHost> host; 144 RTTestSub(g_hTest, "IVirtualBox::host"); 145 CHECK_ERROR(pVBox, COMGETTER(Host)(host.asOutParam())); 146 if (SUCCEEDED(hrc)) 147 { 148 RTTestPassed(g_hTest, "IVirtualBox::host"); 149 CHECK_ERROR(host, COMGETTER(Architecture)(&enmPlatformArch)); 150 151 switch (enmPlatformArch) 152 { 153 case PlatformArchitecture_x86: 154 { 155 ComPtr<IHostX86> hostX86; 156 CHECK_ERROR(host, COMGETTER(X86)(hostX86.asOutParam())); 157 break; 158 } 159 160 default: 161 break; 162 } 163 } 164 else 165 RTTestFailed(g_hTest, "%d: IVirtualBox::host failed", __LINE__); 166 167 ComPtr<ISystemProperties> sysprop; 168 RTTestSub(g_hTest, "IVirtualBox::systemProperties"); 169 CHECK_ERROR(pVBox, COMGETTER(SystemProperties)(sysprop.asOutParam())); 170 if (SUCCEEDED(hrc)) 171 { 172 RTTestPassed(g_hTest, "IVirtualBox::systemProperties"); 173 174 RTTestSub(g_hTest, "IVirtualBox::platform::::platformProperties"); 175 ComPtr<IPlatformProperties> platformprop; 176 CHECK_ERROR(sysprop, COMGETTER(Platform)(platformprop.asOutParam())); 177 BOOL fTemp; 178 CHECK_ERROR(platformprop, COMGETTER(ExclusiveHwVirt)(&fTemp)); 179 ULONG ulTemp; 180 CHECK_ERROR(platformprop, GetMaxNetworkAdapters(ChipsetType_PIIX3, &ulTemp)); 181 } 182 else 183 RTTestFailed(g_hTest, "%d: IVirtualBox::systemProperties failed", __LINE__); 184 185 /* 186 * VM 187 */ 131 188 RTTestSub(g_hTest, "IVirtualBox::CreateMachine"); 132 189 ComPtr<IMachine> ptrMachine; … … 135 192 CHECK_ERROR(pVBox, CreateMachine(NULL, /** Settings */ 136 193 tstMachineName.raw(), /** Name */ 194 enmPlatformArch, 137 195 ComSafeArrayAsInParam(groups), /** Groups */ 138 196 NULL, /** OS Type */ … … 147 205 { 148 206 RTTestFailed(g_hTest, "%d: IVirtualBox::CreateMachine failed", __LINE__); 149 return FALSE;207 return; 150 208 } 151 209 … … 157 215 { 158 216 RTTestFailed(g_hTest, "%d: IVirtualBox::RegisterMachine failed", __LINE__); 159 return FALSE; 160 } 161 162 ComPtr<IHost> host; 163 RTTestSub(g_hTest, "IVirtualBox::host"); 164 CHECK_ERROR(pVBox, COMGETTER(Host)(host.asOutParam())); 165 if (SUCCEEDED(hrc)) 166 { 167 /** @todo Add IHost testing here. */ 168 RTTestPassed(g_hTest, "IVirtualBox::host"); 169 } 170 else 171 RTTestFailed(g_hTest, "%d: IVirtualBox::host failed", __LINE__); 172 173 ComPtr<ISystemProperties> sysprop; 174 RTTestSub(g_hTest, "IVirtualBox::systemProperties"); 175 CHECK_ERROR(pVBox, COMGETTER(SystemProperties)(sysprop.asOutParam())); 176 if (SUCCEEDED(hrc)) 177 { 178 /** @todo Add ISystemProperties testing here. */ 179 RTTestPassed(g_hTest, "IVirtualBox::systemProperties"); 180 } 181 else 182 RTTestFailed(g_hTest, "%d: IVirtualBox::systemProperties failed", __LINE__); 217 return; 218 } 183 219 184 220 com::SafeIfaceArray<IMachine> machines; 185 RTTestSub(g_hTest, "IVirtualBox::machines ");221 RTTestSub(g_hTest, "IVirtualBox::machines2"); 186 222 CHECK_ERROR(pVBox, COMGETTER(Machines)(ComSafeArrayAsOutParam(machines))); 187 223 if (SUCCEEDED(hrc)) 188 224 { 189 bool bFound = FALSE;225 bool fFound = FALSE; 190 226 for (size_t i = 0; i < machines.size(); ++i) 191 227 { … … 198 234 if (tmpName == tstMachineName) 199 235 { 200 bFound = TRUE;236 fFound = TRUE; 201 237 break; 202 238 } … … 205 241 } 206 242 207 if ( bFound)243 if (fFound) 208 244 RTTestPassed(g_hTest, "IVirtualBox::machines"); 209 245 else … … 212 248 else 213 249 RTTestFailed(g_hTest, "%d: IVirtualBox::machines failed", __LINE__); 250 251 RTTestSub(g_hTest, "IMachine::FirmwareSettings"); 252 ComPtr<IFirmwareSettings> ptrFirmwareSettings; 253 CHECK_ERROR(ptrMachine, COMGETTER(FirmwareSettings)(ptrFirmwareSettings.asOutParam())); 254 FirmwareType_T firmwareType; 255 CHECK_ERROR(ptrFirmwareSettings, COMGETTER(FirmwareType)(&firmwareType)); 256 257 // CHECK_ERROR(ptrMachine, LockMachine()); 258 // RTTestSub(g_hTest, "IMachine::saveSettings"); 259 // CHECK_ERROR(ptrMachine, SaveSettings()); 260 261 Bstr bstSettingsFile; 262 CHECK_ERROR(ptrMachine, COMGETTER(SettingsFilePath)(bstSettingsFile.asOutParam())); 263 RTTestPrintf(g_hTest, RTTESTLVL_DEBUG, "Settings file: %ls\n", bstSettingsFile.raw()); 264 // CHECK_ERROR(ptrMachine, UnlockMachine()); 214 265 215 266 #if 0 /** Not yet implemented */ … … 344 395 else 345 396 RTTestFailed(g_hTest, "%d: IVirtualBox::genericNetworkDrivers failed", __LINE__); 346 347 return TRUE;348 397 } 349 398 350 399 351 static BOOLtstApiClean(IVirtualBox *pVBox)400 static void tstApiClean(IVirtualBox *pVBox) 352 401 { 353 402 HRESULT hrc; … … 355 404 /** Delete created VM and its files */ 356 405 ComPtr<IMachine> machine; 357 CHECK_ERROR _RET(pVBox, FindMachine(Bstr(tstMachineName).raw(), machine.asOutParam()), FALSE);406 CHECK_ERROR(pVBox, FindMachine(Bstr(tstMachineName).raw(), machine.asOutParam())); 358 407 SafeIfaceArray<IMedium> media; 359 CHECK_ERROR_RET(machine, Unregister(CleanupMode_DetachAllReturnHardDisksOnly, 360 ComSafeArrayAsOutParam(media)), FALSE); 408 CHECK_ERROR(machine, Unregister(CleanupMode_DetachAllReturnHardDisksOnly, ComSafeArrayAsOutParam(media))); 361 409 ComPtr<IProgress> progress; 362 CHECK_ERROR_RET(machine, DeleteConfig(ComSafeArrayAsInParam(media), progress.asOutParam()), FALSE); 363 CHECK_ERROR_RET(progress, WaitForCompletion(-1), FALSE); 364 365 return TRUE; 410 CHECK_ERROR(machine, DeleteConfig(ComSafeArrayAsInParam(media), progress.asOutParam())); 411 CHECK_ERROR(progress, WaitForCompletion(-1)); 366 412 } 367 413 … … 402 448 tstApiIVirtualBox(ptrVBox); 403 449 404 405 450 /** Clean files/configs */ 406 451 tstApiClean(ptrVBox); -
trunk/src/VBox/Main/testcase/tstVBoxAPIXPCOM.cpp
r99775 r101035 198 198 rc = virtualBox->CreateMachine(NULL, /* settings file */ 199 199 NS_LITERAL_STRING("A brand new name").get(), 200 PlatformArchitecture_x86, 200 201 0, nsnull, /* groups (safearray)*/ 201 202 nsnull, /* ostype */ -
trunk/src/VBox/Main/testcase/tstVBoxMultipleVM.cpp
r98103 r101035 334 334 /* Default VM settings */ 335 335 CHECK_ERROR_L(pVBox, CreateMachine(NULL, /* Settings */ 336 machineName.raw(), /* Name */ 337 ComSafeArrayAsInParam(groups), /* Groups */ 338 NULL, /* OS Type */ 339 NULL, /** Cipher */ 340 NULL, /** Password id */ 341 NULL, /** Password */ 342 NULL, /* Create flags */ 343 ptrMachine.asOutParam())); 336 machineName.raw(), /* Name */ 337 PlatformArchitecture_x86, 338 ComSafeArrayAsInParam(groups), /* Groups */ 339 NULL, /* OS Type */ 340 NULL, /** Cipher */ 341 NULL, /** Password id */ 342 NULL, /** Password */ 343 NULL, /* Create flags */ 344 ptrMachine.asOutParam())); 344 345 if (SUCCEEDED(hrc)) 345 346 { -
trunk/src/VBox/Main/webservice/samples/java/jax-ws/clienttest.java
r98103 r101035 100 100 vbox.openSession(session, id); 101 101 IMachine mach = session.getMachine(); 102 I BIOSSettings bios = mach.getBIOSSettings();103 bios.setIOAPICEnabled(true);102 IFirmwareSettings firmware = mach.getFirmwareSettings(); 103 firmware.setIOAPICEnabled(true); 104 104 mach.saveSettings(); 105 105 session.close(); -
trunk/src/VBox/Main/xml/Settings.cpp
r99723 r101035 430 430 else if (uMinor == 19) 431 431 sv = SettingsVersion_v1_19; 432 else if (uMinor > 19) 432 else if (uMinor == 20) 433 sv = SettingsVersion_v1_20; 434 else if (uMinor > 20) 433 435 sv = SettingsVersion_Future; 434 436 } … … 1072 1074 break; 1073 1075 1076 case SettingsVersion_v1_20: 1077 pcszVersion = "1.20"; 1078 break; 1079 1074 1080 default: 1075 1081 // catch human error: the assertion below will trigger in debug … … 1094 1100 // but as it's an omission of someone who changed this file 1095 1101 // it's the only generic possibility. 1096 pcszVersion = "1. 19";1097 m->sv = SettingsVersion_v1_ 19;1102 pcszVersion = "1.20"; 1103 m->sv = SettingsVersion_v1_20; 1098 1104 } 1099 1105 break; … … 1648 1654 //////////////////////////////////////////////////////////////////////////////// 1649 1655 1656 PlatformProperties::PlatformProperties() 1657 : fExclusiveHwVirt(true) 1658 { 1659 #if defined(RT_OS_DARWIN) || defined(RT_OS_WINDOWS) || defined(RT_OS_SOLARIS) 1660 fExclusiveHwVirt = false; /** BUGBUG Does this apply to MacOS on ARM as well? */ 1661 #endif 1662 } 1663 1650 1664 /** 1651 1665 * Constructor. Needs to set sane defaults which stand the test of time. … … 1654 1668 : uProxyMode(ProxyMode_System) 1655 1669 , uLogHistoryCount(3) 1656 , fExclusiveHwVirt(true) 1657 { 1658 #if defined(RT_OS_DARWIN) || defined(RT_OS_WINDOWS) || defined(RT_OS_SOLARIS) 1659 fExclusiveHwVirt = false; 1660 #endif 1670 { 1661 1671 } 1662 1672 … … 2352 2362 pelmGlobalChild->getAttributeValue("autostartDatabasePath", systemProperties.strAutostartDatabasePath); 2353 2363 pelmGlobalChild->getAttributeValue("defaultFrontend", systemProperties.strDefaultFrontend); 2354 pelmGlobalChild->getAttributeValue("exclusiveHwVirt", systemProperties.fExclusiveHwVirt); 2364 if (m->sv < SettingsVersion_v1_20) /* exclusiveHwVirt was part of SystemProperties for < v1.20. */ 2365 pelmGlobalChild->getAttributeValue("exclusiveHwVirt", platformProperties.fExclusiveHwVirt); 2355 2366 if (!pelmGlobalChild->getAttributeValue("proxyMode", systemProperties.uProxyMode)) 2356 2367 fCopyProxySettingsFromExtraData = true; 2357 2368 pelmGlobalChild->getAttributeValue("proxyUrl", systemProperties.strProxyUrl); 2358 2369 pelmGlobalChild->getAttributeValue("LanguageId", systemProperties.strLanguageId); 2370 } 2371 if ( pelmGlobalChild->nameEquals("PlatformProperties") 2372 && m->sv >= SettingsVersion_v1_20) 2373 { 2374 /* Since settings v1.20 exclusiveHwVirt is part of PlatformProperties. */ 2375 pelmGlobalChild->getAttributeValue("exclusiveHwVirt", platformProperties.fExclusiveHwVirt); 2359 2376 } 2360 2377 #ifdef VBOX_WITH_UPDATE_AGENT … … 2650 2667 pelmSysProps->setAttribute("proxyUrl", systemProperties.strProxyUrl); 2651 2668 pelmSysProps->setAttribute("proxyMode", systemProperties.uProxyMode); 2652 pelmSysProps->setAttribute("exclusiveHwVirt", systemProperties.fExclusiveHwVirt); 2669 if (m->sv >= SettingsVersion_v1_20) /* Since settings v1.20 exclusiveHwVirt is part of PlatformProperties. */ 2670 { 2671 xml::ElementNode *pelmPlatProps = pelmGlobal->createChild("PlatformProperties"); 2672 pelmPlatProps->setAttribute("exclusiveHwVirt", platformProperties.fExclusiveHwVirt); 2673 } 2674 else 2675 pelmSysProps->setAttribute("exclusiveHwVirt", platformProperties.fExclusiveHwVirt); 2653 2676 if (systemProperties.strLanguageId.isNotEmpty()) 2654 2677 pelmSysProps->setAttribute("LanguageId", systemProperties.strLanguageId); … … 2726 2749 * Constructor. Needs to set sane defaults which stand the test of time. 2727 2750 */ 2728 BIOSSettings::BIOSSettings() : 2751 FirmwareSettings::FirmwareSettings() : 2752 firmwareType(FirmwareType_BIOS), 2729 2753 fACPIEnabled(true), 2730 2754 fIOAPICEnabled(false), … … 2734 2758 fSmbiosUuidLittleEndian(true), 2735 2759 ulLogoDisplayTime(0), 2736 biosBootMenuMode(BIOSBootMenuMode_MessageAndMenu),2760 enmBootMenuMode(FirmwareBootMenuMode_MessageAndMenu), 2737 2761 apicMode(APICMode_APIC), 2738 2762 llTimeOffset(0) … … 2741 2765 2742 2766 /** 2743 * Check if all settings have default values. 2744 */ 2745 bool BIOSSettings::areDefaultSettings() const 2746 { 2747 return fACPIEnabled 2748 && !fIOAPICEnabled 2749 && fLogoFadeIn 2750 && fLogoFadeOut 2751 && !fPXEDebugEnabled 2752 && !fSmbiosUuidLittleEndian 2753 && ulLogoDisplayTime == 0 2754 && biosBootMenuMode == BIOSBootMenuMode_MessageAndMenu 2755 && apicMode == APICMode_APIC 2756 && llTimeOffset == 0 2757 && strLogoImagePath.isEmpty(); 2767 * Returns if all settings have default values. 2768 * 2769 * @returns \c true if all settings have default values, \c false if not. 2770 * @param enmCPUArch CPU architecture to use for checking the default values for. 2771 */ 2772 bool FirmwareSettings::areDefaultSettings(CPUArchitecture_T enmCPUArch) const 2773 { 2774 switch (enmCPUArch) 2775 { 2776 case CPUArchitecture_x86: 2777 RT_FALL_THROUGH(); 2778 case CPUArchitecture_AMD64: 2779 return 2780 firmwareType == FirmwareType_BIOS 2781 && !fIOAPICEnabled 2782 && fLogoFadeIn 2783 && fLogoFadeOut 2784 && !fPXEDebugEnabled 2785 && !fSmbiosUuidLittleEndian 2786 && ulLogoDisplayTime == 0 2787 && enmBootMenuMode == FirmwareBootMenuMode_MessageAndMenu 2788 && apicMode == APICMode_APIC 2789 && llTimeOffset == 0 2790 && strLogoImagePath.isEmpty(); 2791 2792 case CPUArchitecture_ARMv8_32: 2793 RT_FALL_THROUGH(); 2794 case CPUArchitecture_ARMv8_64: 2795 return 2796 ( enmCPUArch == CPUArchitecture_ARMv8_32 2797 ? firmwareType == FirmwareType_EFI32 2798 : firmwareType == FirmwareType_EFI64) 2799 && !fIOAPICEnabled 2800 && fLogoFadeIn 2801 && fLogoFadeOut 2802 && !fPXEDebugEnabled 2803 && !fSmbiosUuidLittleEndian 2804 && ulLogoDisplayTime == 0 2805 && enmBootMenuMode == FirmwareBootMenuMode_MessageAndMenu 2806 && apicMode == APICMode_APIC 2807 && llTimeOffset == 0 2808 && strLogoImagePath.isEmpty(); 2809 break; 2810 2811 default: 2812 break; 2813 } 2814 2815 AssertFailedReturn(false); 2758 2816 } 2759 2817 … … 2763 2821 * machine settings have really changed and thus need to be written out to disk. 2764 2822 */ 2765 bool BIOSSettings::operator==(const BIOSSettings &d) const2823 bool FirmwareSettings::operator==(const FirmwareSettings &d) const 2766 2824 { 2767 2825 return (this == &d) 2768 || ( fACPIEnabled == d.fACPIEnabled 2826 || ( firmwareType == d.firmwareType 2827 && fACPIEnabled == d.fACPIEnabled 2769 2828 && fIOAPICEnabled == d.fIOAPICEnabled 2770 2829 && fLogoFadeIn == d.fLogoFadeIn … … 2773 2832 && fSmbiosUuidLittleEndian == d.fSmbiosUuidLittleEndian 2774 2833 && ulLogoDisplayTime == d.ulLogoDisplayTime 2775 && biosBootMenuMode == d.biosBootMenuMode2834 && enmBootMenuMode == d.enmBootMenuMode 2776 2835 && apicMode == d.apicMode 2777 2836 && llTimeOffset == d.llTimeOffset … … 3629 3688 ulSlot(0), 3630 3689 fEnabled(false), 3631 ulIO Base(0x3f8),3690 ulIOAddress(0x3f8), 3632 3691 ulIRQ(4), 3633 3692 portMode(PortMode_Disconnected), … … 3647 3706 || ( ulSlot == s.ulSlot 3648 3707 && fEnabled == s.fEnabled 3649 && ulIO Base == s.ulIOBase3708 && ulIOAddress == s.ulIOAddress 3650 3709 && ulIRQ == s.ulIRQ 3651 3710 && portMode == s.portMode … … 3774 3833 * Constructor. Needs to set sane defaults which stand the test of time. 3775 3834 */ 3776 CpuIdLeaf ::CpuIdLeaf() :3835 CpuIdLeafX86::CpuIdLeafX86() : 3777 3836 idx(UINT32_MAX), 3778 3837 idxSub(0), … … 3789 3848 * machine settings have really changed and thus need to be written out to disk. 3790 3849 */ 3791 bool CpuIdLeaf ::operator==(const CpuIdLeaf&c) const3850 bool CpuIdLeafX86::operator==(const CpuIdLeafX86 &c) const 3792 3851 { 3793 3852 return (this == &c) … … 3903 3962 } 3904 3963 3905 3906 /** 3907 * Constructor. Needs to set sane defaults which stand the test of time. 3908 */ 3909 Hardware::Hardware() : 3910 strVersion("1"), 3911 fHardwareVirt(true), 3912 fNestedPaging(true), 3913 fVPID(true), 3914 fUnrestrictedExecution(true), 3915 fHardwareVirtForce(false), 3916 fUseNativeApi(false), 3917 fTripleFaultReset(false), 3964 #ifdef VBOX_WITH_VIRT_ARMV8 3965 PlatformARM::PlatformARM() 3966 /** @todo BUGBUG Anything for ARM here? */ 3967 { 3968 3969 } 3970 3971 bool PlatformARM::operator==(const PlatformARM& h) const 3972 { 3973 RT_NOREF(h); 3974 return true; /** @todo BUGBUG Anything for ARM here? */ 3975 } 3976 #endif /* VBOX_WITH_VIRT_ARMV8 */ 3977 3978 PlatformX86::PlatformX86() : 3918 3979 fPAE(false), 3919 3980 fAPIC(true), 3920 3981 fX2APIC(false), 3982 fHPETEnabled(false), 3983 enmLongMode(HC_ARCH_BITS == 64 ? PlatformX86::LongMode_Enabled : PlatformX86::LongMode_Disabled), 3984 fTripleFaultReset(false), 3921 3985 fIBPBOnVMExit(false), 3922 3986 fIBPBOnVMEntry(false), … … 3927 3991 fMDSClearOnSched(true), 3928 3992 fMDSClearOnVMEntry(false), 3929 fNestedHWVirt(false), 3930 fVirtVmsaveVmload(true), 3931 enmLongMode(HC_ARCH_BITS == 64 ? Hardware::LongMode_Enabled : Hardware::LongMode_Disabled), 3993 fHWVirtEx(true), 3994 fHWVirtExNestedPaging(true), 3995 fHWVirtExVPID(true), 3996 fHWVirtExUX(true), 3997 fHWVirtExForce(false), 3998 fHWVirtExUseNativeApi(false), 3999 fHWVirtExVirtVmsaveVmload(true), 4000 fNestedHWVirt(false) 4001 { 4002 /* The default value for PAE depends on the host: 4003 * - 64 bits host -> always true 4004 * - 32 bits host -> true for Windows & Darwin (masked off if the host cpu doesn't support it anyway) 4005 */ 4006 #if HC_ARCH_BITS == 64 || defined(RT_OS_WINDOWS) || defined(RT_OS_DARWIN) 4007 fPAE = true; 4008 #endif 4009 4010 /* The default value of large page supports depends on the host: 4011 * - 64 bits host -> true, unless it's Linux (pending further prediction work due to excessively expensive large page allocations) 4012 * - 32 bits host -> false 4013 */ 4014 #if HC_ARCH_BITS == 64 && !defined(RT_OS_LINUX) 4015 fHWVirtExLargePages = true; /** @todo BUGBUG Does this apply for ARM as well? */ 4016 #else 4017 /* Not supported on 32 bits hosts. */ 4018 fHWVirtExLargePages = false; 4019 #endif 4020 } 4021 4022 /** 4023 * Comparison operator. This gets called from MachineConfigFile::operator==, 4024 * which in turn gets called from Platform::saveSettings to figure out whether 4025 * machine settings have really changed and thus need to be written out to disk. 4026 */ 4027 bool PlatformX86::operator==(const PlatformX86& h) const 4028 { 4029 return (this == &h) 4030 || ( fPAE == h.fPAE 4031 && fAPIC == h.fAPIC 4032 && fX2APIC == h.fX2APIC 4033 && fHPETEnabled == h.fHPETEnabled 4034 && enmLongMode == h.enmLongMode 4035 && llCpuIdLeafs == h.llCpuIdLeafs 4036 && fTripleFaultReset == h.fTripleFaultReset 4037 && fIBPBOnVMExit == h.fIBPBOnVMExit 4038 && fIBPBOnVMEntry == h.fIBPBOnVMEntry 4039 && fSpecCtrl == h.fSpecCtrl 4040 && fSpecCtrlByHost == h.fSpecCtrlByHost 4041 && fL1DFlushOnSched == h.fL1DFlushOnSched 4042 && fL1DFlushOnVMEntry == h.fL1DFlushOnVMEntry 4043 && fMDSClearOnSched == h.fMDSClearOnSched 4044 && fMDSClearOnVMEntry == h.fMDSClearOnVMEntry 4045 && fHWVirtEx == h.fHWVirtEx 4046 && fHWVirtExNestedPaging == h.fHWVirtExNestedPaging 4047 && fHWVirtExLargePages == h.fHWVirtExLargePages 4048 && fHWVirtExVPID == h.fHWVirtExVPID 4049 && fHWVirtExUX == h.fHWVirtExUX 4050 && fHWVirtExForce == h.fHWVirtExForce 4051 && fHWVirtExUseNativeApi == h.fHWVirtExUseNativeApi 4052 && fHWVirtExVirtVmsaveVmload == h.fHWVirtExVirtVmsaveVmload 4053 && fNestedHWVirt == h.fNestedHWVirt); 4054 } 4055 4056 /** 4057 * Constructor. Needs to set sane defaults which stand the test of time. 4058 */ 4059 Platform::Platform() : 4060 architectureType(PlatformArchitecture_x86), /* We default to x86 here, as this is what we ever had so far. */ 4061 chipsetType(ChipsetType_PIIX3), 4062 iommuType(IommuType_None), 4063 fRTCUseUTC(false) 4064 { 4065 } 4066 4067 /** 4068 * Comparison operator. This gets called from MachineConfigFile::operator==, 4069 * which in turn gets called from Platform::saveSettings to figure out whether 4070 * machine settings have really changed and thus need to be written out to disk. 4071 */ 4072 bool Platform::operator==(const Platform& h) const 4073 { 4074 bool fRc = (this == &h) 4075 || ( architectureType == h.architectureType 4076 && chipsetType == h.chipsetType 4077 && iommuType == h.iommuType 4078 && fRTCUseUTC == h.fRTCUseUTC); 4079 if (fRc) 4080 { 4081 switch (architectureType) 4082 { 4083 case PlatformArchitecture_x86: 4084 return x86 == h.x86; 4085 #ifdef VBOX_WITH_VIRT_ARMV8 4086 case PlatformArchitecture_ARM: 4087 return arm == h.arm; 4088 #endif 4089 default: 4090 AssertFailedReturn(false); 4091 } 4092 } 4093 4094 return fRc; 4095 } 4096 4097 /** 4098 * Constructor. Needs to set sane defaults which stand the test of time. 4099 */ 4100 Hardware::Hardware() : 4101 strVersion("1"), 3932 4102 cCPUs(1), 3933 4103 fCpuHotPlug(false), 3934 fHPETEnabled(false),3935 4104 ulCpuExecutionCap(100), 3936 4105 uCpuIdPortabilityLevel(0), 3937 4106 strCpuProfile("host"), 3938 4107 ulMemorySizeMB((uint32_t)-1), 3939 firmwareType(FirmwareType_BIOS),3940 4108 pointingHIDType(PointingHIDType_PS2Mouse), 3941 4109 keyboardHIDType(KeyboardHIDType_PS2Keyboard), 3942 chipsetType(ChipsetType_PIIX3),3943 iommuType(IommuType_None),3944 4110 paravirtProvider(ParavirtProvider_Legacy), // default for old VMs, for new ones it's ParavirtProvider_Default 3945 4111 strParavirtDebug(""), … … 3951 4117 fPageFusionEnabled(false) 3952 4118 { 3953 mapBootOrder[0] = DeviceType_Floppy; 4119 mapBootOrder[0] = DeviceType_Floppy; /** @todo BUGBUG Handle ARM. */ 3954 4120 mapBootOrder[1] = DeviceType_DVD; 3955 4121 mapBootOrder[2] = DeviceType_HardDisk; 3956 3957 /* The default value for PAE depends on the host:3958 * - 64 bits host -> always true3959 * - 32 bits host -> true for Windows & Darwin (masked off if the host cpu doesn't support it anyway)3960 */3961 #if HC_ARCH_BITS == 64 || defined(RT_OS_WINDOWS) || defined(RT_OS_DARWIN)3962 fPAE = true;3963 #endif3964 3965 /* The default value of large page supports depends on the host:3966 * - 64 bits host -> true, unless it's Linux (pending further prediction work due to excessively expensive large page allocations)3967 * - 32 bits host -> false3968 */3969 #if HC_ARCH_BITS == 64 && !defined(RT_OS_LINUX)3970 fLargePages = true;3971 #else3972 /* Not supported on 32 bits hosts. */3973 fLargePages = false;3974 #endif3975 4122 } 3976 4123 … … 4030 4177 || ( strVersion == h.strVersion 4031 4178 && uuid == h.uuid 4032 && fHardwareVirt == h.fHardwareVirt4033 && fNestedPaging == h.fNestedPaging4034 && fLargePages == h.fLargePages4035 && fVPID == h.fVPID4036 && fUnrestrictedExecution == h.fUnrestrictedExecution4037 && fHardwareVirtForce == h.fHardwareVirtForce4038 && fUseNativeApi == h.fUseNativeApi4039 && fPAE == h.fPAE4040 && enmLongMode == h.enmLongMode4041 && fTripleFaultReset == h.fTripleFaultReset4042 && fAPIC == h.fAPIC4043 && fX2APIC == h.fX2APIC4044 && fIBPBOnVMExit == h.fIBPBOnVMExit4045 && fIBPBOnVMEntry == h.fIBPBOnVMEntry4046 && fSpecCtrl == h.fSpecCtrl4047 && fSpecCtrlByHost == h.fSpecCtrlByHost4048 && fL1DFlushOnSched == h.fL1DFlushOnSched4049 && fL1DFlushOnVMEntry == h.fL1DFlushOnVMEntry4050 && fMDSClearOnSched == h.fMDSClearOnSched4051 && fMDSClearOnVMEntry == h.fMDSClearOnVMEntry4052 && fNestedHWVirt == h.fNestedHWVirt4053 && fVirtVmsaveVmload == h.fVirtVmsaveVmload4054 4179 && cCPUs == h.cCPUs 4055 4180 && fCpuHotPlug == h.fCpuHotPlug … … 4057 4182 && uCpuIdPortabilityLevel == h.uCpuIdPortabilityLevel 4058 4183 && strCpuProfile == h.strCpuProfile 4059 && fHPETEnabled == h.fHPETEnabled4060 4184 && llCpus == h.llCpus 4061 && llCpuIdLeafs == h.llCpuIdLeafs4062 4185 && ulMemorySizeMB == h.ulMemorySizeMB 4063 4186 && mapBootOrder == h.mapBootOrder 4064 && firmwareType == h.firmwareType4065 4187 && pointingHIDType == h.pointingHIDType 4066 4188 && keyboardHIDType == h.keyboardHIDType 4067 && chipsetType == h.chipsetType4068 && iommuType == h.iommuType4069 4189 && paravirtProvider == h.paravirtProvider 4070 4190 && strParavirtDebug == h.strParavirtDebug 4071 4191 && fEmulatedUSBCardReader == h.fEmulatedUSBCardReader 4072 4192 && vrdeSettings == h.vrdeSettings 4073 && biosSettings == h.biosSettings 4193 && platformSettings == h.platformSettings 4194 && firmwareSettings == h.firmwareSettings 4074 4195 && nvramSettings == h.nvramSettings 4075 4196 && graphicsAdapter == h.graphicsAdapter … … 4286 4407 fTeleporterEnabled(false), 4287 4408 uTeleporterPort(0), 4288 fRTCUseUTC(false),4289 4409 enmVMPriority(VMProcPriority_Default) 4290 4410 { … … 4311 4431 && strTeleporterAddress == c.strTeleporterAddress 4312 4432 && strTeleporterPassword == c.strTeleporterPassword 4313 && fRTCUseUTC == c.fRTCUseUTC4314 4433 && ovIcon == c.ovIcon 4315 4434 && enmVMPriority == c.enmVMPriority); … … 4461 4580 4462 4581 /** 4463 * Called from MachineConfigFile::readHardware() to read cpu information. 4582 * Called from MachineConfigFile::readHardware() to read CPU information. 4583 * 4464 4584 * @param elmCpu 4465 4585 * @param ll … … 4482 4602 4483 4603 /** 4484 * Called from MachineConfigFile::readHardware() to cpuid information. 4604 * Called from MachineConfigFile::readPlatformX86() to read x86 CPUID information. 4605 * 4485 4606 * @param elmCpuid 4486 4607 * @param ll 4487 4608 */ 4488 void MachineConfigFile::readCpuIdTree (const xml::ElementNode &elmCpuid,4489 CpuIdLeafsList &ll)4609 void MachineConfigFile::readCpuIdTreeX86(const xml::ElementNode &elmCpuid, 4610 CpuIdLeafsX86List &ll) 4490 4611 { 4491 4612 xml::NodesLoop nl1(elmCpuid, "CpuIdLeaf"); … … 4493 4614 while ((pelmCpuIdLeaf = nl1.forAllNodes())) 4494 4615 { 4495 CpuIdLeaf leaf;4616 CpuIdLeafX86 leaf; 4496 4617 4497 4618 if (!pelmCpuIdLeaf->getAttributeValue("id", leaf.idx)) 4498 throw ConfigFileError(this, pelmCpuIdLeaf, N_("Required CpuId /@id attribute is missing"));4619 throw ConfigFileError(this, pelmCpuIdLeaf, N_("Required CpuIdLeaf/@id attribute is missing")); 4499 4620 4500 4621 if (!pelmCpuIdLeaf->getAttributeValue("subleaf", leaf.idxSub)) … … 4789 4910 if (!pelmPort->getAttributeValue("enabled", port.fEnabled)) 4790 4911 throw ConfigFileError(this, pelmPort, N_("Required UART/Port/@enabled attribute is missing")); 4791 if (!pelmPort->getAttributeValue("IOBase", port.ulIOBase)) 4792 throw ConfigFileError(this, pelmPort, N_("Required UART/Port/@IOBase attribute is missing")); 4912 if (m->sv >= SettingsVersion_v1_20) /* IOBase was changed to IOAddress since settings v1.20. */ 4913 { 4914 if (!pelmPort->getAttributeValue("IOAddress", port.ulIOAddress)) 4915 throw ConfigFileError(this, pelmPort, N_("Required UART/Port/@IOAddress attribute is missing")); 4916 } 4917 else /* Settings < v1.20. */ 4918 { 4919 if (!pelmPort->getAttributeValue("IOBase", port.ulIOAddress)) 4920 throw ConfigFileError(this, pelmPort, N_("Required UART/Port/@IOBase attribute is missing")); 4921 } 4793 4922 if (!pelmPort->getAttributeValue("IRQ", port.ulIRQ)) 4794 4923 throw ConfigFileError(this, pelmPort, N_("Required UART/Port/@IRQ attribute is missing")); … … 5059 5188 5060 5189 /** 5190 * Reads the x86 CPUID tree. 5191 * 5192 * For settings >= v1.20 these were stored under the "Platform/x86/CPU" node. 5193 * For settings < v1.20 these were stored under the "Hardware/CPU" node. 5194 * 5195 * @param elmPlatformOrHardware Platform or Hardware node to read from. 5196 * @param platX86 Where to store the platform settings. 5197 */ 5198 void MachineConfigFile::readPlatformCPUIDTreeX86(const xml::ElementNode &elmChild, 5199 PlatformX86 &platX86) 5200 { 5201 const xml::ElementNode *pelmCPUChild; 5202 if ((pelmCPUChild = elmChild.findChildElement("CpuIdTree"))) 5203 readCpuIdTreeX86(*pelmCPUChild, platX86.llCpuIdLeafs); 5204 } 5205 5206 /** 5207 * Reads the x86 platform settings. 5208 * 5209 * For settings >= v1.20 these were stored under the "Platform/x86" node. 5210 * For settings < v1.20 these were stored under the "Hardware" node. 5211 * 5212 * @param elmPlatformX86OrHardware Platform/x86 or Hardware node to read from. 5213 * @param platX86 Where to store the x86 platform settings. 5214 */ 5215 void MachineConfigFile::readPlatformX86(const xml::ElementNode &elmPlatformX86OrHardware, 5216 PlatformX86 &platX86) 5217 { 5218 xml::NodesLoop nl1(elmPlatformX86OrHardware); 5219 5220 const xml::ElementNode *pelChild; 5221 while ((pelChild = nl1.forAllNodes())) 5222 { 5223 if (pelChild->nameEquals("HPET")) 5224 { 5225 pelChild->getAttributeValue("enabled", platX86.fHPETEnabled); 5226 } 5227 else if (pelChild->nameEquals("CPU")) 5228 { 5229 const xml::ElementNode *pelmCPUChild; 5230 if ((pelmCPUChild = pelChild->findChildElement("HardwareVirtEx"))) 5231 pelmCPUChild->getAttributeValue("enabled", platX86.fHWVirtEx); 5232 if ((pelmCPUChild = pelChild->findChildElement("HardwareVirtExNestedPaging"))) 5233 pelmCPUChild->getAttributeValue("enabled", platX86.fHWVirtExNestedPaging); 5234 if ((pelmCPUChild = pelChild->findChildElement("HardwareVirtExLargePages"))) 5235 pelmCPUChild->getAttributeValue("enabled", platX86.fHWVirtExLargePages); 5236 if ((pelmCPUChild = pelChild->findChildElement("HardwareVirtExVPID"))) 5237 pelmCPUChild->getAttributeValue("enabled", platX86.fHWVirtExVPID); 5238 if ((pelmCPUChild = pelChild->findChildElement("HardwareVirtExUX"))) 5239 pelmCPUChild->getAttributeValue("enabled", platX86.fHWVirtExUX); 5240 if ((pelmCPUChild = pelChild->findChildElement("HardwareVirtForce"))) 5241 pelmCPUChild->getAttributeValue("enabled", platX86.fHWVirtExForce); 5242 if ((pelmCPUChild = pelChild->findChildElement("HardwareVirtExUseNativeApi"))) 5243 pelmCPUChild->getAttributeValue("enabled", platX86.fHWVirtExUseNativeApi); 5244 if ((pelmCPUChild = pelChild->findChildElement("HardwareVirtExVirtVmsaveVmload"))) 5245 pelmCPUChild->getAttributeValue("enabled", platX86.fHWVirtExVirtVmsaveVmload); 5246 5247 if (!(pelmCPUChild = pelChild->findChildElement("PAE"))) 5248 { 5249 /* The default for pre 3.1 was false, so we must respect that. */ 5250 if (m->sv < SettingsVersion_v1_9) 5251 platX86.fPAE = false; 5252 } 5253 else 5254 pelmCPUChild->getAttributeValue("enabled", platX86.fPAE); 5255 5256 bool fLongMode; 5257 if ( (pelmCPUChild = pelChild->findChildElement("LongMode")) 5258 && pelmCPUChild->getAttributeValue("enabled", fLongMode) ) 5259 platX86.enmLongMode = fLongMode ? PlatformX86::LongMode_Enabled : PlatformX86::LongMode_Disabled; 5260 else 5261 platX86.enmLongMode = PlatformX86::LongMode_Legacy; 5262 5263 if ((pelmCPUChild = pelChild->findChildElement("TripleFaultReset"))) 5264 pelmCPUChild->getAttributeValue("enabled", platX86.fTripleFaultReset); 5265 if ((pelmCPUChild = pelChild->findChildElement("APIC"))) 5266 pelmCPUChild->getAttributeValue("enabled", platX86.fAPIC); 5267 if ((pelmCPUChild = pelChild->findChildElement("X2APIC"))) 5268 pelmCPUChild->getAttributeValue("enabled", platX86.fX2APIC); 5269 5270 if ((pelmCPUChild = pelChild->findChildElement("IBPBOn"))) 5271 { 5272 pelmCPUChild->getAttributeValue("vmexit", platX86.fIBPBOnVMExit); 5273 pelmCPUChild->getAttributeValue("vmentry", platX86.fIBPBOnVMEntry); 5274 } 5275 if ((pelmCPUChild = pelChild->findChildElement("SpecCtrl"))) 5276 pelmCPUChild->getAttributeValue("enabled", platX86.fSpecCtrl); 5277 if ((pelmCPUChild = pelChild->findChildElement("SpecCtrlByHost"))) 5278 pelmCPUChild->getAttributeValue("enabled", platX86.fSpecCtrlByHost); 5279 if ((pelmCPUChild = pelChild->findChildElement("L1DFlushOn"))) 5280 { 5281 pelmCPUChild->getAttributeValue("scheduling", platX86.fL1DFlushOnSched); 5282 pelmCPUChild->getAttributeValue("vmentry", platX86.fL1DFlushOnVMEntry); 5283 } 5284 if ((pelmCPUChild = pelChild->findChildElement("MDSClearOn"))) 5285 { 5286 pelmCPUChild->getAttributeValue("scheduling", platX86.fMDSClearOnSched); 5287 pelmCPUChild->getAttributeValue("vmentry", platX86.fMDSClearOnVMEntry); 5288 } 5289 if ((pelmCPUChild = pelChild->findChildElement("NestedHWVirt"))) 5290 pelmCPUChild->getAttributeValue("enabled", platX86.fNestedHWVirt); 5291 5292 readPlatformCPUIDTreeX86(*pelChild, platX86); 5293 } 5294 } 5295 } 5296 5297 /** 5298 * Reads the platform settings. 5299 * 5300 * For settings >= v1.20 (>= VirtualBox 7.1) these were stored under the "Platform" node. 5301 * For settings < v1.20 (<= VirtualBox 7.0) these were stored under the "Hardware" node. 5302 * 5303 * @param elmPlatformOrHardware Platform or Hardware node to read from. 5304 * @param plat Where to store the platform settings. 5305 */ 5306 void MachineConfigFile::readPlatform(const xml::ElementNode &elmPlatformOrHardware, 5307 Platform &plat) 5308 { 5309 /* 5310 * Platform-generic stuff. 5311 */ 5312 xml::NodesLoop nl1(elmPlatformOrHardware); 5313 const xml::ElementNode *pelmChild; 5314 while ((pelmChild = nl1.forAllNodes())) 5315 { 5316 if (pelmChild->nameEquals("Chipset")) 5317 { 5318 Utf8Str strChipsetType; 5319 if (pelmChild->getAttributeValue("type", strChipsetType)) 5320 { 5321 if (strChipsetType == "PIIX3") 5322 plat.chipsetType = ChipsetType_PIIX3; 5323 else if (strChipsetType == "ICH9") 5324 plat.chipsetType = ChipsetType_ICH9; 5325 else if (strChipsetType == "ARMv8Virtual") 5326 plat.chipsetType = ChipsetType_ARMv8Virtual; 5327 else 5328 throw ConfigFileError(this, 5329 pelmChild, 5330 N_("Invalid value '%s' in Chipset/@type"), 5331 strChipsetType.c_str()); 5332 } 5333 } 5334 else if (pelmChild->nameEquals("Iommu")) 5335 { 5336 Utf8Str strIommuType; 5337 if (pelmChild->getAttributeValue("type", strIommuType)) 5338 { 5339 if (strIommuType == "None") 5340 plat.iommuType = IommuType_None; 5341 else if (strIommuType == "Automatic") 5342 plat.iommuType = IommuType_Automatic; 5343 else if (strIommuType == "AMD") 5344 plat.iommuType = IommuType_AMD; 5345 else if (strIommuType == "Intel") 5346 plat.iommuType = IommuType_Intel; 5347 else 5348 throw ConfigFileError(this, 5349 pelmChild, 5350 N_("Invalid value '%s' in Iommu/@type"), 5351 strIommuType.c_str()); 5352 } 5353 } 5354 else if (pelmChild->nameEquals("RTC")) 5355 { 5356 Utf8Str strLocalOrUTC; 5357 plat.fRTCUseUTC = pelmChild->getAttributeValue("localOrUTC", strLocalOrUTC) 5358 && strLocalOrUTC == "UTC"; 5359 } 5360 } 5361 5362 if (m->sv >= SettingsVersion_v1_20) /* Settings v1.20 introduced platform architecture support. */ 5363 { 5364 Utf8Str strArch; 5365 if (elmPlatformOrHardware.getAttributeValue("architecture", strArch)) 5366 { 5367 if (strArch.equalsIgnoreCase("x86")) 5368 plat.architectureType = PlatformArchitecture_x86; 5369 else if (strArch.equalsIgnoreCase("ARM")) 5370 plat.architectureType = PlatformArchitecture_ARM; 5371 else 5372 throw ConfigFileError(this, 5373 &elmPlatformOrHardware, 5374 N_("Platform/@architecture '%s' invalid"), strArch.c_str()); 5375 } 5376 else 5377 throw ConfigFileError(this, &elmPlatformOrHardware, N_("Platform/@architecture missing")); 5378 } 5379 5380 /* 5381 * Platform-specific stuff. 5382 */ 5383 switch (plat.architectureType) 5384 { 5385 case PlatformArchitecture_x86: 5386 { 5387 const xml::ElementNode *pelmPlatformX86OrHardware; 5388 if (m->sv >= SettingsVersion_v1_20) /* Settings v1.20 introduced platform support with a x86 sub node. */ 5389 { 5390 pelmPlatformX86OrHardware = elmPlatformOrHardware.findChildElement("x86"); 5391 if (!pelmPlatformX86OrHardware) 5392 throw ConfigFileError(this, &elmPlatformOrHardware, N_("Required Platform/@x86 element is missing")); 5393 } 5394 else /* For settings < v1.20 we stored everyhing in the Hardware node. */ 5395 pelmPlatformX86OrHardware = &elmPlatformOrHardware; 5396 5397 readPlatformX86(*pelmPlatformX86OrHardware, plat.x86); 5398 break; 5399 } 5400 5401 #ifdef VBOX_WITH_VIRT_ARMV8 5402 case PlatformArchitecture_ARM: 5403 { 5404 /** @todo BUGBUG Implement loading ARM platform stuff here. */ 5405 break; 5406 } 5407 #endif 5408 default: 5409 AssertFailed(); 5410 break; 5411 } 5412 } 5413 5414 /** 5061 5415 * Reads in a \<Hardware\> block and stores it in the given structure. Used 5062 5416 * both directly from readMachine and from readSnapshot, since snapshots … … 5134 5488 } 5135 5489 5136 if ((pelmCPUChild = pelmHwChild->findChildElement("HardwareVirtEx")))5137 {5138 pelmCPUChild->getAttributeValue("enabled", hw.fHardwareVirt);5139 }5140 if ((pelmCPUChild = pelmHwChild->findChildElement("HardwareVirtExNestedPaging")))5141 pelmCPUChild->getAttributeValue("enabled", hw.fNestedPaging);5142 if ((pelmCPUChild = pelmHwChild->findChildElement("HardwareVirtExLargePages")))5143 pelmCPUChild->getAttributeValue("enabled", hw.fLargePages);5144 if ((pelmCPUChild = pelmHwChild->findChildElement("HardwareVirtExVPID")))5145 pelmCPUChild->getAttributeValue("enabled", hw.fVPID);5146 if ((pelmCPUChild = pelmHwChild->findChildElement("HardwareVirtExUX")))5147 pelmCPUChild->getAttributeValue("enabled", hw.fUnrestrictedExecution);5148 if ((pelmCPUChild = pelmHwChild->findChildElement("HardwareVirtForce")))5149 pelmCPUChild->getAttributeValue("enabled", hw.fHardwareVirtForce);5150 if ((pelmCPUChild = pelmHwChild->findChildElement("HardwareVirtExUseNativeApi")))5151 pelmCPUChild->getAttributeValue("enabled", hw.fUseNativeApi);5152 if ((pelmCPUChild = pelmHwChild->findChildElement("HardwareVirtExVirtVmsaveVmload")))5153 pelmCPUChild->getAttributeValue("enabled", hw.fVirtVmsaveVmload);5154 5155 if (!(pelmCPUChild = pelmHwChild->findChildElement("PAE")))5156 {5157 /* The default for pre 3.1 was false, so we must respect that. */5158 if (m->sv < SettingsVersion_v1_9)5159 hw.fPAE = false;5160 }5161 else5162 pelmCPUChild->getAttributeValue("enabled", hw.fPAE);5163 5164 bool fLongMode;5165 if ( (pelmCPUChild = pelmHwChild->findChildElement("LongMode"))5166 && pelmCPUChild->getAttributeValue("enabled", fLongMode) )5167 hw.enmLongMode = fLongMode ? Hardware::LongMode_Enabled : Hardware::LongMode_Disabled;5168 else5169 hw.enmLongMode = Hardware::LongMode_Legacy;5170 5171 5490 if ((pelmCPUChild = pelmHwChild->findChildElement("SyntheticCpu"))) 5172 5491 { … … 5177 5496 pelmHwChild->getAttributeValue("CpuIdPortabilityLevel", hw.uCpuIdPortabilityLevel); 5178 5497 pelmHwChild->getAttributeValue("CpuProfile", hw.strCpuProfile); 5179 5180 if ((pelmCPUChild = pelmHwChild->findChildElement("TripleFaultReset")))5181 pelmCPUChild->getAttributeValue("enabled", hw.fTripleFaultReset);5182 5183 if ((pelmCPUChild = pelmHwChild->findChildElement("APIC")))5184 pelmCPUChild->getAttributeValue("enabled", hw.fAPIC);5185 if ((pelmCPUChild = pelmHwChild->findChildElement("X2APIC")))5186 pelmCPUChild->getAttributeValue("enabled", hw.fX2APIC);5187 if (hw.fX2APIC)5188 hw.fAPIC = true;5189 pelmCPUChild = pelmHwChild->findChildElement("IBPBOn");5190 if (pelmCPUChild)5191 {5192 pelmCPUChild->getAttributeValue("vmexit", hw.fIBPBOnVMExit);5193 pelmCPUChild->getAttributeValue("vmentry", hw.fIBPBOnVMEntry);5194 }5195 pelmCPUChild = pelmHwChild->findChildElement("SpecCtrl");5196 if (pelmCPUChild)5197 pelmCPUChild->getAttributeValue("enabled", hw.fSpecCtrl);5198 pelmCPUChild = pelmHwChild->findChildElement("SpecCtrlByHost");5199 if (pelmCPUChild)5200 pelmCPUChild->getAttributeValue("enabled", hw.fSpecCtrlByHost);5201 pelmCPUChild = pelmHwChild->findChildElement("L1DFlushOn");5202 if (pelmCPUChild)5203 {5204 pelmCPUChild->getAttributeValue("scheduling", hw.fL1DFlushOnSched);5205 pelmCPUChild->getAttributeValue("vmentry", hw.fL1DFlushOnVMEntry);5206 }5207 pelmCPUChild = pelmHwChild->findChildElement("MDSClearOn");5208 if (pelmCPUChild)5209 {5210 pelmCPUChild->getAttributeValue("scheduling", hw.fMDSClearOnSched);5211 pelmCPUChild->getAttributeValue("vmentry", hw.fMDSClearOnVMEntry);5212 }5213 pelmCPUChild = pelmHwChild->findChildElement("NestedHWVirt");5214 if (pelmCPUChild)5215 pelmCPUChild->getAttributeValue("enabled", hw.fNestedHWVirt);5216 5217 if ((pelmCPUChild = pelmHwChild->findChildElement("CpuIdTree")))5218 readCpuIdTree(*pelmCPUChild, hw.llCpuIdLeafs);5219 5498 } 5220 5499 else if (pelmHwChild->nameEquals("Memory")) … … 5222 5501 pelmHwChild->getAttributeValue("RAMSize", hw.ulMemorySizeMB); 5223 5502 pelmHwChild->getAttributeValue("PageFusion", hw.fPageFusionEnabled); 5224 }5225 else if (pelmHwChild->nameEquals("Firmware"))5226 {5227 Utf8Str strFirmwareType;5228 if (pelmHwChild->getAttributeValue("type", strFirmwareType))5229 {5230 if ( (strFirmwareType == "BIOS")5231 || (strFirmwareType == "1") // some trunk builds used the number here5232 )5233 hw.firmwareType = FirmwareType_BIOS;5234 else if ( (strFirmwareType == "EFI")5235 || (strFirmwareType == "2") // some trunk builds used the number here5236 )5237 hw.firmwareType = FirmwareType_EFI;5238 else if ( strFirmwareType == "EFI32")5239 hw.firmwareType = FirmwareType_EFI32;5240 else if ( strFirmwareType == "EFI64")5241 hw.firmwareType = FirmwareType_EFI64;5242 else if ( strFirmwareType == "EFIDUAL")5243 hw.firmwareType = FirmwareType_EFIDUAL;5244 else5245 throw ConfigFileError(this,5246 pelmHwChild,5247 N_("Invalid value '%s' in Firmware/@type"),5248 strFirmwareType.c_str());5249 }5250 5503 } 5251 5504 else if (pelmHwChild->nameEquals("HID")) … … 5291 5544 } 5292 5545 } 5293 else if (pelmHwChild->nameEquals("Chipset"))5294 {5295 Utf8Str strChipsetType;5296 if (pelmHwChild->getAttributeValue("type", strChipsetType))5297 {5298 if (strChipsetType == "PIIX3")5299 hw.chipsetType = ChipsetType_PIIX3;5300 else if (strChipsetType == "ICH9")5301 hw.chipsetType = ChipsetType_ICH9;5302 else5303 throw ConfigFileError(this,5304 pelmHwChild,5305 N_("Invalid value '%s' in Chipset/@type"),5306 strChipsetType.c_str());5307 }5308 }5309 else if (pelmHwChild->nameEquals("Iommu"))5310 {5311 Utf8Str strIommuType;5312 if (pelmHwChild->getAttributeValue("type", strIommuType))5313 {5314 if (strIommuType == "None")5315 hw.iommuType = IommuType_None;5316 else if (strIommuType == "Automatic")5317 hw.iommuType = IommuType_Automatic;5318 else if (strIommuType == "AMD")5319 hw.iommuType = IommuType_AMD;5320 else if (strIommuType == "Intel")5321 hw.iommuType = IommuType_Intel;5322 else5323 throw ConfigFileError(this,5324 pelmHwChild,5325 N_("Invalid value '%s' in Iommu/@type"),5326 strIommuType.c_str());5327 }5328 }5329 5546 else if (pelmHwChild->nameEquals("Paravirt")) 5330 5547 { … … 5353 5570 pelmHwChild->getAttributeValue("debug", hw.strParavirtDebug); 5354 5571 } 5355 else if (pelmHwChild->nameEquals("HPET"))5356 {5357 pelmHwChild->getAttributeValue("enabled", hw.fHPETEnabled);5358 }5359 5572 else if (pelmHwChild->nameEquals("Boot")) 5360 5573 { … … 5503 5716 } 5504 5717 } 5505 else if (pelmHwChild->nameEquals("BIOS"))5506 {5507 const xml::ElementNode *pelmBIOSChild;5508 if ((pelmBIOSChild = pelmHwChild->findChildElement("ACPI")))5509 pelmBIOSChild->getAttributeValue("enabled", hw.biosSettings.fACPIEnabled);5510 if ((pelmBIOSChild = pelmHwChild->findChildElement("IOAPIC")))5511 pelmBIOSChild->getAttributeValue("enabled", hw.biosSettings.fIOAPICEnabled);5512 if ( (pelmBIOSChild = pelmHwChild->findChildElement("APIC")))5513 { 5514 Utf8Str str APIC;5515 if (pelm BIOSChild->getAttributeValue("mode", strAPIC))5718 /* Since v1.20 (VBox 7.1) we store BIOS / UEFI settings inside the "Firmware" element. 5719 * Older versions (< v1.20) stored those settings in a "BIOS" element (see down below) for that. See also down below. */ 5720 else if ( pelmHwChild->nameEquals("BIOS") 5721 || pelmHwChild->nameEquals("Firmware")) 5722 { 5723 /* For settings < v1.20 we already has an element "Firmware", which only contained the firmware type. The rest lived in the "BIOS" element. 5724 * For settings >= v1.20 we moved the "BIOS" element attributes also to "Firmware". */ 5725 if (pelmHwChild->nameEquals("Firmware")) 5726 { 5727 Utf8Str strFirmwareType; 5728 if (pelmHwChild->getAttributeValue("type", strFirmwareType)) 5516 5729 { 5517 strAPIC.toUpper(); 5518 if (strAPIC == "DISABLED") 5519 hw.biosSettings.apicMode = APICMode_Disabled; 5520 else if (strAPIC == "APIC") 5521 hw.biosSettings.apicMode = APICMode_APIC; 5522 else if (strAPIC == "X2APIC") 5523 hw.biosSettings.apicMode = APICMode_X2APIC; 5730 if ( (strFirmwareType == "BIOS") 5731 || (strFirmwareType == "1") // some trunk builds used the number here 5732 ) 5733 hw.firmwareSettings.firmwareType = FirmwareType_BIOS; 5734 else if ( (strFirmwareType == "EFI") 5735 || (strFirmwareType == "2") // some trunk builds used the number here 5736 ) 5737 hw.firmwareSettings.firmwareType = FirmwareType_EFI; 5738 else if ( strFirmwareType == "EFI32") 5739 hw.firmwareSettings.firmwareType = FirmwareType_EFI32; 5740 else if ( strFirmwareType == "EFI64") 5741 hw.firmwareSettings.firmwareType = FirmwareType_EFI64; 5742 else if ( strFirmwareType == "EFIDUAL") 5743 hw.firmwareSettings.firmwareType = FirmwareType_EFIDUAL; 5524 5744 else 5525 throw ConfigFileError(this, pelmBIOSChild, N_("Invalid value '%s' in APIC/@mode attribute"), strAPIC.c_str()); 5745 throw ConfigFileError(this, 5746 pelmHwChild, 5747 N_("Invalid value '%s' in Firmware/@type"), 5748 strFirmwareType.c_str()); 5526 5749 } 5527 5750 } 5528 if ((pelmBIOSChild = pelmHwChild->findChildElement("Logo"))) 5529 { 5530 pelmBIOSChild->getAttributeValue("fadeIn", hw.biosSettings.fLogoFadeIn); 5531 pelmBIOSChild->getAttributeValue("fadeOut", hw.biosSettings.fLogoFadeOut); 5532 pelmBIOSChild->getAttributeValue("displayTime", hw.biosSettings.ulLogoDisplayTime); 5533 pelmBIOSChild->getAttributeValue("imagePath", hw.biosSettings.strLogoImagePath); 5534 } 5535 if ((pelmBIOSChild = pelmHwChild->findChildElement("BootMenu"))) 5536 { 5537 Utf8Str strBootMenuMode; 5538 if (pelmBIOSChild->getAttributeValue("mode", strBootMenuMode)) 5751 5752 /* Read the firmware settings either from the "Firmware" or "BIOS" elements, depending on the settings version. */ 5753 if ( ( pelmHwChild->nameEquals("Firmware") 5754 && m->sv >= SettingsVersion_v1_20) 5755 || ( pelmHwChild->nameEquals("BIOS") 5756 && m->sv < SettingsVersion_v1_20) 5757 ) 5758 { 5759 const xml::ElementNode *pelmFirmwareOrBIOSChild; 5760 if ((pelmFirmwareOrBIOSChild = pelmHwChild->findChildElement("ACPI"))) 5761 pelmFirmwareOrBIOSChild->getAttributeValue("enabled", hw.firmwareSettings.fACPIEnabled); 5762 if ((pelmFirmwareOrBIOSChild = pelmHwChild->findChildElement("IOAPIC"))) 5763 pelmFirmwareOrBIOSChild->getAttributeValue("enabled", hw.firmwareSettings.fIOAPICEnabled); 5764 if ((pelmFirmwareOrBIOSChild = pelmHwChild->findChildElement("APIC"))) 5539 5765 { 5540 // settings before 1.3 used lower case so make sure this is case-insensitive 5541 strBootMenuMode.toUpper(); 5542 if (strBootMenuMode == "DISABLED") 5543 hw.biosSettings.biosBootMenuMode = BIOSBootMenuMode_Disabled; 5544 else if (strBootMenuMode == "MENUONLY") 5545 hw.biosSettings.biosBootMenuMode = BIOSBootMenuMode_MenuOnly; 5546 else if (strBootMenuMode == "MESSAGEANDMENU") 5547 hw.biosSettings.biosBootMenuMode = BIOSBootMenuMode_MessageAndMenu; 5548 else 5549 throw ConfigFileError(this, pelmBIOSChild, N_("Invalid value '%s' in BootMenu/@mode attribute"), strBootMenuMode.c_str()); 5766 Utf8Str strAPIC; 5767 if (pelmFirmwareOrBIOSChild->getAttributeValue("mode", strAPIC)) 5768 { 5769 strAPIC.toUpper(); 5770 if (strAPIC == "DISABLED") 5771 hw.firmwareSettings.apicMode = APICMode_Disabled; 5772 else if (strAPIC == "APIC") 5773 hw.firmwareSettings.apicMode = APICMode_APIC; 5774 else if (strAPIC == "X2APIC") 5775 hw.firmwareSettings.apicMode = APICMode_X2APIC; 5776 else 5777 throw ConfigFileError(this, pelmFirmwareOrBIOSChild, N_("Invalid value '%s' in APIC/@mode attribute"), strAPIC.c_str()); 5778 } 5550 5779 } 5551 } 5552 if ((pelmBIOSChild = pelmHwChild->findChildElement("PXEDebug"))) 5553 pelmBIOSChild->getAttributeValue("enabled", hw.biosSettings.fPXEDebugEnabled); 5554 if ((pelmBIOSChild = pelmHwChild->findChildElement("TimeOffset"))) 5555 pelmBIOSChild->getAttributeValue("value", hw.biosSettings.llTimeOffset); 5556 if ((pelmBIOSChild = pelmHwChild->findChildElement("NVRAM"))) 5557 { 5558 pelmBIOSChild->getAttributeValue("path", hw.nvramSettings.strNvramPath); 5559 if (m->sv >= SettingsVersion_v1_19) 5780 if ((pelmFirmwareOrBIOSChild = pelmHwChild->findChildElement("Logo"))) 5560 5781 { 5561 pelmBIOSChild->getAttributeValue("keyId", hw.nvramSettings.strKeyId); 5562 pelmBIOSChild->getAttributeValue("keyStore", hw.nvramSettings.strKeyStore); 5782 pelmFirmwareOrBIOSChild->getAttributeValue("fadeIn", hw.firmwareSettings.fLogoFadeIn); 5783 pelmFirmwareOrBIOSChild->getAttributeValue("fadeOut", hw.firmwareSettings.fLogoFadeOut); 5784 pelmFirmwareOrBIOSChild->getAttributeValue("displayTime", hw.firmwareSettings.ulLogoDisplayTime); 5785 pelmFirmwareOrBIOSChild->getAttributeValue("imagePath", hw.firmwareSettings.strLogoImagePath); 5563 5786 } 5564 } 5565 if ((pelmBIOSChild = pelmHwChild->findChildElement("SmbiosUuidLittleEndian"))) 5566 pelmBIOSChild->getAttributeValue("enabled", hw.biosSettings.fSmbiosUuidLittleEndian); 5567 else 5568 hw.biosSettings.fSmbiosUuidLittleEndian = false; /* Default for existing VMs. */ 5569 5570 // legacy BIOS/IDEController (pre 1.7) 5571 if ( (m->sv < SettingsVersion_v1_7) 5572 && (pelmBIOSChild = pelmHwChild->findChildElement("IDEController")) 5573 ) 5574 { 5575 StorageController sctl; 5576 sctl.strName = "IDE Controller"; 5577 sctl.storageBus = StorageBus_IDE; 5578 5579 Utf8Str strType; 5580 if (pelmBIOSChild->getAttributeValue("type", strType)) 5787 if ((pelmFirmwareOrBIOSChild = pelmHwChild->findChildElement("BootMenu"))) 5581 5788 { 5582 if (strType == "PIIX3") 5583 sctl.controllerType = StorageControllerType_PIIX3; 5584 else if (strType == "PIIX4") 5585 sctl.controllerType = StorageControllerType_PIIX4; 5586 else if (strType == "ICH6") 5587 sctl.controllerType = StorageControllerType_ICH6; 5588 else 5589 throw ConfigFileError(this, pelmBIOSChild, N_("Invalid value '%s' for IDEController/@type attribute"), strType.c_str()); 5789 Utf8Str strBootMenuMode; 5790 if (pelmFirmwareOrBIOSChild->getAttributeValue("mode", strBootMenuMode)) 5791 { 5792 // settings before 1.3 used lower case so make sure this is case-insensitive 5793 strBootMenuMode.toUpper(); 5794 if (strBootMenuMode == "DISABLED") 5795 hw.firmwareSettings.enmBootMenuMode = FirmwareBootMenuMode_Disabled; 5796 else if (strBootMenuMode == "MENUONLY") 5797 hw.firmwareSettings.enmBootMenuMode = FirmwareBootMenuMode_MenuOnly; 5798 else if (strBootMenuMode == "MESSAGEANDMENU") 5799 hw.firmwareSettings.enmBootMenuMode = FirmwareBootMenuMode_MessageAndMenu; 5800 else 5801 throw ConfigFileError(this, pelmFirmwareOrBIOSChild, N_("Invalid value '%s' in BootMenu/@mode attribute"), strBootMenuMode.c_str()); 5802 } 5590 5803 } 5591 sctl.ulPortCount = 2; 5592 hw.storage.llStorageControllers.push_back(sctl); 5804 if ((pelmFirmwareOrBIOSChild = pelmHwChild->findChildElement("PXEDebug"))) 5805 pelmFirmwareOrBIOSChild->getAttributeValue("enabled", hw.firmwareSettings.fPXEDebugEnabled); 5806 if ((pelmFirmwareOrBIOSChild = pelmHwChild->findChildElement("TimeOffset"))) 5807 pelmFirmwareOrBIOSChild->getAttributeValue("value", hw.firmwareSettings.llTimeOffset); 5808 if ((pelmFirmwareOrBIOSChild = pelmHwChild->findChildElement("NVRAM"))) 5809 { 5810 pelmFirmwareOrBIOSChild->getAttributeValue("path", hw.nvramSettings.strNvramPath); 5811 if (m->sv >= SettingsVersion_v1_19) 5812 { 5813 pelmFirmwareOrBIOSChild->getAttributeValue("keyId", hw.nvramSettings.strKeyId); 5814 pelmFirmwareOrBIOSChild->getAttributeValue("keyStore", hw.nvramSettings.strKeyStore); 5815 } 5816 } 5817 if ((pelmFirmwareOrBIOSChild = pelmHwChild->findChildElement("SmbiosUuidLittleEndian"))) 5818 pelmFirmwareOrBIOSChild->getAttributeValue("enabled", hw.firmwareSettings.fSmbiosUuidLittleEndian); 5819 else 5820 hw.firmwareSettings.fSmbiosUuidLittleEndian = false; /* Default for existing VMs. */ 5821 5822 // legacy BIOS/IDEController (pre 1.7) 5823 if ( (m->sv < SettingsVersion_v1_7) 5824 && (pelmFirmwareOrBIOSChild = pelmHwChild->findChildElement("IDEController")) 5825 ) 5826 { 5827 StorageController sctl; 5828 sctl.strName = "IDE Controller"; 5829 sctl.storageBus = StorageBus_IDE; 5830 5831 Utf8Str strType; 5832 if (pelmFirmwareOrBIOSChild->getAttributeValue("type", strType)) 5833 { 5834 if (strType == "PIIX3") 5835 sctl.controllerType = StorageControllerType_PIIX3; 5836 else if (strType == "PIIX4") 5837 sctl.controllerType = StorageControllerType_PIIX4; 5838 else if (strType == "ICH6") 5839 sctl.controllerType = StorageControllerType_ICH6; 5840 else 5841 throw ConfigFileError(this, pelmFirmwareOrBIOSChild, N_("Invalid value '%s' for IDEController/@type attribute"), strType.c_str()); 5842 } 5843 sctl.ulPortCount = 2; 5844 hw.storage.llStorageControllers.push_back(sctl); 5845 } 5593 5846 } 5594 5847 } … … 5701 5954 else if (pelmHwChild->nameEquals("Network")) 5702 5955 readNetworkAdapters(*pelmHwChild, hw.llNetworkAdapters); 5703 else if (pelmHwChild->nameEquals("RTC"))5704 {5705 Utf8Str strLocalOrUTC;5706 machineUserData.fRTCUseUTC = pelmHwChild->getAttributeValue("localOrUTC", strLocalOrUTC)5707 && strLocalOrUTC == "UTC";5708 }5709 5956 else if ( pelmHwChild->nameEquals("UART") 5710 5957 || pelmHwChild->nameEquals("Uart") // used before 1.3 … … 5864 6111 readStorageControllers(*pelmHwChild, hw.storage); 5865 6112 } 6113 6114 /* We read the platform settings here, which were part of the "Hardware" node for settings < 1.2.0. 6115 * For newer settings (>= v1.20) we read the platform settings outside readHardware(). */ 6116 if (m->sv < SettingsVersion_v1_20) 6117 readPlatform(elmHardware, hw.platformSettings); 5866 6118 5867 6119 if (hw.ulMemorySizeMB == (uint32_t)-1) … … 6482 6734 6483 6735 pElement->getAttributeValuePath("stateFile", pSnap->strStateFile); // online snapshots only 6736 6737 /* We read the platform settings here for newer settings (>= v1.20). 6738 * For older settings (< v1.20) we read the platform settings in readHardware(). */ 6739 if (m->sv >= SettingsVersion_v1_20) 6740 { 6741 const xml::ElementNode *pelmPlatform; 6742 if (!(pelmPlatform = pElement->findChildElement("Platform"))) 6743 throw ConfigFileError(this, pElement, N_("Required Snapshot/@Platform element is missing")); 6744 readPlatform(*pelmPlatform, pSnap->hardware.platformSettings); 6745 } 6484 6746 6485 6747 // parse Hardware before the other elements because other things depend on it … … 6676 6938 parseBase64(machineUserData.ovIcon, str, &elmMachine); 6677 6939 6940 /* We read the platform settings here for newer settings (>= v1.20). 6941 * For older settings (< v1.20) we read the platform settings in readHardware(). */ 6942 if (m->sv >= SettingsVersion_v1_20) 6943 { 6944 const xml::ElementNode *pelmPlatform; 6945 if (!(pelmPlatform = elmMachine.findChildElement("Platform"))) 6946 throw ConfigFileError(this, &elmMachine, N_("Required Machine/@Platform element is missing")); 6947 readPlatform(*pelmPlatform, hardwareMachine.platformSettings); 6948 } 6949 6678 6950 // parse Hardware before the other elements because other things depend on it 6679 6951 const xml::ElementNode *pelmHardware; 6680 6952 if (!(pelmHardware = elmMachine.findChildElement("Hardware"))) 6681 throw ConfigFileError(this, &elmMachine, N_("Required Machine/ Hardware element is missing"));6953 throw ConfigFileError(this, &elmMachine, N_("Required Machine/@Hardware element is missing")); 6682 6954 readHardware(*pelmHardware, hardwareMachine); 6683 6955 … … 6822 7094 6823 7095 /** 6824 * Creates a \<Hardware\> node under elmParent and then writes out the XML 7096 * Writes x86-specific platform settings out to the XML. 7097 * 7098 * For settings >= v1.20 this creates a \<x86\> node under elmParent. 6825 7099 * keys under that. Called for both the \<Machine\> node and for snapshots. 6826 * @param elmParent 6827 * @param hw 6828 * @param fl 6829 * @param pllElementsWithUuidAttributes 6830 */ 6831 void MachineConfigFile::buildHardwareXML(xml::ElementNode &elmParent, 6832 const Hardware &hw, 6833 uint32_t fl, 6834 std::list<xml::ElementNode*> *pllElementsWithUuidAttributes) 6835 { 6836 xml::ElementNode *pelmHardware = elmParent.createChild("Hardware"); 6837 6838 if ( m->sv >= SettingsVersion_v1_4 6839 && (m->sv < SettingsVersion_v1_7 ? hw.strVersion != "1" : hw.strVersion != "2")) 6840 pelmHardware->setAttribute("version", hw.strVersion); 6841 6842 if ((m->sv >= SettingsVersion_v1_9) 6843 && !hw.uuid.isZero() 6844 && hw.uuid.isValid() 6845 ) 6846 pelmHardware->setAttribute("uuid", hw.uuid.toStringCurly()); 6847 6848 xml::ElementNode *pelmCPU = pelmHardware->createChild("CPU"); 6849 6850 if (!hw.fHardwareVirt) 6851 pelmCPU->createChild("HardwareVirtEx")->setAttribute("enabled", hw.fHardwareVirt); 6852 if (!hw.fNestedPaging) 6853 pelmCPU->createChild("HardwareVirtExNestedPaging")->setAttribute("enabled", hw.fNestedPaging); 6854 if (!hw.fVPID) 6855 pelmCPU->createChild("HardwareVirtExVPID")->setAttribute("enabled", hw.fVPID); 6856 if (!hw.fUnrestrictedExecution) 6857 pelmCPU->createChild("HardwareVirtExUX")->setAttribute("enabled", hw.fUnrestrictedExecution); 7100 * 7101 * @param elmParent Parent element. 7102 * For settings >= v1.20 this is the \<Platform\> element. 7103 * For settings < v1.20 this is the \<Hardware\> element. 7104 * @param elmCPU CPU element platform-generic settings. 7105 * For settings >= v1.20 this is the \<Platform/CPU\> element. 7106 * For settings < v1.20 this is the \<Hardware/CPU\> element. 7107 * @param platX86 x86-specific platform settings to use for building the XML. 7108 */ 7109 void MachineConfigFile::buildPlatformX86XML(xml::ElementNode &elmParent, xml::ElementNode &elmCPU, const PlatformX86 &platX86) 7110 { 7111 xml::ElementNode *pelmX86Root; 7112 xml::ElementNode *pelmX86CPU; 7113 if (m->sv >= SettingsVersion_v1_20) 7114 { 7115 pelmX86Root = elmParent.createChild("x86"); 7116 pelmX86CPU = pelmX86Root->createChild("CPU"); 7117 7118 } 7119 else 7120 { 7121 pelmX86Root = &elmParent; /* Before settings v1.20 the x86-specifics were sprinkled across the Machine element. */ 7122 pelmX86CPU = &elmCPU; /* Use the generic CPU element, even for x86-specific things. */ 7123 } 7124 7125 if ( (m->sv >= SettingsVersion_v1_10) 7126 && platX86.fHPETEnabled) 7127 { 7128 xml::ElementNode *pelmHPET = pelmX86Root->createChild("HPET"); 7129 pelmHPET->setAttribute("enabled", platX86.fHPETEnabled); 7130 } 7131 7132 // HardwareVirtExLargePages has too crazy default handling, must always save this setting. 7133 pelmX86CPU->createChild("HardwareVirtExLargePages")->setAttribute("enabled", platX86.fHWVirtExLargePages); 7134 7135 if (m->sv >= SettingsVersion_v1_9) 7136 { 7137 if (platX86.fHWVirtExForce) 7138 pelmX86CPU->createChild("HardwareVirtForce")->setAttribute("enabled", platX86.fHWVirtExForce); 7139 } 7140 7141 if (m->sv >= SettingsVersion_v1_9 && platX86.fHWVirtExUseNativeApi) 7142 pelmX86CPU->createChild("HardwareVirtExUseNativeApi")->setAttribute("enabled", platX86.fHWVirtExUseNativeApi); 7143 7144 if (!platX86.fHWVirtEx) 7145 pelmX86CPU->createChild("HardwareVirtEx")->setAttribute("enabled", platX86.fHWVirtEx); 7146 if (!platX86.fHWVirtExNestedPaging) 7147 pelmX86CPU->createChild("HardwareVirtExNestedPaging")->setAttribute("enabled", platX86.fHWVirtExNestedPaging); 7148 if (!platX86.fHWVirtExVPID) 7149 pelmX86CPU->createChild("HardwareVirtExVPID")->setAttribute("enabled", platX86.fHWVirtExVPID); 7150 if (!platX86.fHWVirtExUX) 7151 pelmX86CPU->createChild("HardwareVirtExUX")->setAttribute("enabled", platX86.fHWVirtExUX); 6858 7152 // PAE has too crazy default handling, must always save this setting. 6859 pelm CPU->createChild("PAE")->setAttribute("enabled", hw.fPAE);7153 pelmX86CPU->createChild("PAE")->setAttribute("enabled", platX86.fPAE); 6860 7154 if (m->sv >= SettingsVersion_v1_16) 6861 7155 { 6862 if ( hw.fIBPBOnVMEntry || hw.fIBPBOnVMExit)6863 { 6864 xml::ElementNode *pelmChild = pelm CPU->createChild("IBPBOn");6865 if ( hw.fIBPBOnVMExit)6866 pelmChild->setAttribute("vmexit", hw.fIBPBOnVMExit);6867 if ( hw.fIBPBOnVMEntry)6868 pelmChild->setAttribute("vmentry", hw.fIBPBOnVMEntry);6869 } 6870 if ( hw.fSpecCtrl)6871 pelm CPU->createChild("SpecCtrl")->setAttribute("enabled", hw.fSpecCtrl);6872 if ( hw.fSpecCtrlByHost)6873 pelm CPU->createChild("SpecCtrlByHost")->setAttribute("enabled", hw.fSpecCtrlByHost);6874 if (! hw.fL1DFlushOnSched || hw.fL1DFlushOnVMEntry)6875 { 6876 xml::ElementNode *pelmChild = pelm CPU->createChild("L1DFlushOn");6877 if (! hw.fL1DFlushOnSched)6878 pelmChild->setAttribute("scheduling", hw.fL1DFlushOnSched);6879 if ( hw.fL1DFlushOnVMEntry)6880 pelmChild->setAttribute("vmentry", hw.fL1DFlushOnVMEntry);6881 } 6882 if (! hw.fMDSClearOnSched || hw.fMDSClearOnVMEntry)6883 { 6884 xml::ElementNode *pelmChild = pelm CPU->createChild("MDSClearOn");6885 if (! hw.fMDSClearOnSched)6886 pelmChild->setAttribute("scheduling", hw.fMDSClearOnSched);6887 if ( hw.fMDSClearOnVMEntry)6888 pelmChild->setAttribute("vmentry", hw.fMDSClearOnVMEntry);6889 } 6890 } 6891 if (m->sv >= SettingsVersion_v1_17 && hw.fNestedHWVirt)6892 pelm CPU->createChild("NestedHWVirt")->setAttribute("enabled", hw.fNestedHWVirt);6893 6894 if (m->sv >= SettingsVersion_v1_18 && ! hw.fVirtVmsaveVmload)6895 pelm CPU->createChild("HardwareVirtExVirtVmsaveVmload")->setAttribute("enabled", hw.fVirtVmsaveVmload);6896 6897 if (m->sv >= SettingsVersion_v1_14 && hw.enmLongMode != Hardware::LongMode_Legacy)7156 if (platX86.fIBPBOnVMEntry || platX86.fIBPBOnVMExit) 7157 { 7158 xml::ElementNode *pelmChild = pelmX86CPU->createChild("IBPBOn"); 7159 if (platX86.fIBPBOnVMExit) 7160 pelmChild->setAttribute("vmexit", platX86.fIBPBOnVMExit); 7161 if (platX86.fIBPBOnVMEntry) 7162 pelmChild->setAttribute("vmentry", platX86.fIBPBOnVMEntry); 7163 } 7164 if (platX86.fSpecCtrl) 7165 pelmX86CPU->createChild("SpecCtrl")->setAttribute("enabled", platX86.fSpecCtrl); 7166 if (platX86.fSpecCtrlByHost) 7167 pelmX86CPU->createChild("SpecCtrlByHost")->setAttribute("enabled", platX86.fSpecCtrlByHost); 7168 if (!platX86.fL1DFlushOnSched || platX86.fL1DFlushOnVMEntry) 7169 { 7170 xml::ElementNode *pelmChild = pelmX86CPU->createChild("L1DFlushOn"); 7171 if (!platX86.fL1DFlushOnSched) 7172 pelmChild->setAttribute("scheduling", platX86.fL1DFlushOnSched); 7173 if (platX86.fL1DFlushOnVMEntry) 7174 pelmChild->setAttribute("vmentry", platX86.fL1DFlushOnVMEntry); 7175 } 7176 if (!platX86.fMDSClearOnSched || platX86.fMDSClearOnVMEntry) 7177 { 7178 xml::ElementNode *pelmChild = pelmX86CPU->createChild("MDSClearOn"); 7179 if (!platX86.fMDSClearOnSched) 7180 pelmChild->setAttribute("scheduling", platX86.fMDSClearOnSched); 7181 if (platX86.fMDSClearOnVMEntry) 7182 pelmChild->setAttribute("vmentry", platX86.fMDSClearOnVMEntry); 7183 } 7184 } 7185 if (m->sv >= SettingsVersion_v1_17 && platX86.fNestedHWVirt) 7186 pelmX86CPU->createChild("NestedHWVirt")->setAttribute("enabled", platX86.fNestedHWVirt); 7187 7188 if (m->sv >= SettingsVersion_v1_18 && !platX86.fHWVirtExVirtVmsaveVmload) 7189 pelmX86CPU->createChild("HardwareVirtExVirtVmsaveVmload")->setAttribute("enabled", platX86.fHWVirtExVirtVmsaveVmload); 7190 7191 if (m->sv >= SettingsVersion_v1_14 && platX86.enmLongMode != PlatformX86::LongMode_Legacy) 6898 7192 { 6899 7193 // LongMode has too crazy default handling, must always save this setting. 6900 pelm CPU->createChild("LongMode")->setAttribute("enabled", hw.enmLongMode == Hardware::LongMode_Enabled);6901 } 6902 6903 if ( hw.fTripleFaultReset)6904 pelm CPU->createChild("TripleFaultReset")->setAttribute("enabled", hw.fTripleFaultReset);7194 pelmX86CPU->createChild("LongMode")->setAttribute("enabled", platX86.enmLongMode == PlatformX86::LongMode_Enabled); 7195 } 7196 7197 if (platX86.fTripleFaultReset) 7198 pelmX86CPU->createChild("TripleFaultReset")->setAttribute("enabled", platX86.fTripleFaultReset); 6905 7199 if (m->sv >= SettingsVersion_v1_14) 6906 7200 { 6907 if (hw.fX2APIC) 6908 pelmCPU->createChild("X2APIC")->setAttribute("enabled", hw.fX2APIC); 6909 else if (!hw.fAPIC) 6910 pelmCPU->createChild("APIC")->setAttribute("enabled", hw.fAPIC); 6911 } 7201 if (platX86.fX2APIC) 7202 pelmX86CPU->createChild("X2APIC")->setAttribute("enabled", platX86.fX2APIC); 7203 else if (!platX86.fAPIC) 7204 pelmX86CPU->createChild("APIC")->setAttribute("enabled", platX86.fAPIC); 7205 } 7206 7207 xml::ElementNode *pelmCpuIdTree = NULL; 7208 for (CpuIdLeafsX86List::const_iterator it = platX86.llCpuIdLeafs.begin(); 7209 it != platX86.llCpuIdLeafs.end(); 7210 ++it) 7211 { 7212 const CpuIdLeafX86 &leaf = *it; 7213 7214 if (pelmCpuIdTree == NULL) 7215 pelmCpuIdTree = pelmX86CPU->createChild("CpuIdTree"); 7216 7217 xml::ElementNode *pelmCpuIdLeaf = pelmCpuIdTree->createChild("CpuIdLeaf"); 7218 pelmCpuIdLeaf->setAttribute("id", leaf.idx); 7219 if (leaf.idxSub != 0) 7220 pelmCpuIdLeaf->setAttribute("subleaf", leaf.idxSub); 7221 pelmCpuIdLeaf->setAttribute("eax", leaf.uEax); 7222 pelmCpuIdLeaf->setAttribute("ebx", leaf.uEbx); 7223 pelmCpuIdLeaf->setAttribute("ecx", leaf.uEcx); 7224 pelmCpuIdLeaf->setAttribute("edx", leaf.uEdx); 7225 } 7226 } 7227 7228 /** 7229 * Stores platform-generic and platform-specific data and then writes out the XML. 7230 * 7231 * For settings >= v.120 this creates a \<Platform\> node under elmParent. 7232 * For settings < v.120 this stores the data directly under elmParent. 7233 * 7234 * Called for both the \<Machine\> node and for snapshots. 7235 * 7236 * @param elmParent Parent element. 7237 * @param hw Hardware settings to use for building the XML. 7238 * For CPU stuff we don't have in Platform (yet). 7239 * @param plat Platform settings to use for building the XML. 7240 */ 7241 void MachineConfigFile::buildPlatformXML(xml::ElementNode &elmParent, 7242 const Hardware &hw, const Platform &plat) 7243 { 7244 xml::ElementNode *pelmPlatformOrHardware; 7245 if (m->sv >= SettingsVersion_v1_20) /* Since settings v1.20 we have a dedicated Platform element. */ 7246 { 7247 pelmPlatformOrHardware = elmParent.createChild("Platform"); 7248 7249 switch (plat.architectureType) 7250 { 7251 case PlatformArchitecture_x86: 7252 pelmPlatformOrHardware->setAttribute("architecture", "x86"); 7253 break; 7254 7255 case PlatformArchitecture_ARM: 7256 pelmPlatformOrHardware->setAttribute("architecture", "ARM"); 7257 break; 7258 7259 default: 7260 AssertFailed(); 7261 break; 7262 } 7263 } 7264 else /* For settings < v1.20 we use the parent element (which is Hardware). */ 7265 pelmPlatformOrHardware = &elmParent; 7266 7267 if ( m->sv >= SettingsVersion_v1_10 7268 && plat.fRTCUseUTC) 7269 { 7270 xml::ElementNode *pelmRTC = pelmPlatformOrHardware->createChild("RTC"); 7271 pelmRTC->setAttribute("localOrUTC", plat.fRTCUseUTC ? "UTC" : "local"); 7272 } 7273 7274 if (m->sv >= SettingsVersion_v1_11) 7275 { 7276 if (plat.chipsetType != ChipsetType_PIIX3) 7277 { 7278 xml::ElementNode *pelmChipset = pelmPlatformOrHardware->createChild("Chipset"); 7279 const char *pcszChipset; 7280 7281 switch (plat.chipsetType) 7282 { 7283 case ChipsetType_PIIX3: pcszChipset = "PIIX3"; break; 7284 case ChipsetType_ICH9: pcszChipset = "ICH9"; break; 7285 case ChipsetType_ARMv8Virtual: pcszChipset = "ARMv8Virtual"; break; 7286 default: Assert(false); pcszChipset = "PIIX3"; break; 7287 } 7288 pelmChipset->setAttribute("type", pcszChipset); 7289 } 7290 } 7291 7292 if ( m->sv >= SettingsVersion_v1_19 7293 && plat.iommuType != IommuType_None) 7294 { 7295 const char *pcszIommuType; 7296 switch (plat.iommuType) 7297 { 7298 case IommuType_None: pcszIommuType = "None"; break; 7299 case IommuType_Automatic: pcszIommuType = "Automatic"; break; 7300 case IommuType_AMD: pcszIommuType = "AMD"; break; 7301 case IommuType_Intel: pcszIommuType = "Intel"; break; 7302 default: Assert(false); pcszIommuType = "None"; break; 7303 } 7304 7305 xml::ElementNode *pelmIommu = pelmPlatformOrHardware->createChild("Iommu"); 7306 pelmIommu->setAttribute("type", pcszIommuType); 7307 } 7308 7309 xml::ElementNode *pelmCPU = pelmPlatformOrHardware->createChild("CPU"); 7310 6912 7311 if (hw.cCPUs > 1) 6913 7312 pelmCPU->setAttribute("count", hw.cCPUs); … … 6919 7318 pelmCPU->setAttribute("CpuProfile", hw.strCpuProfile); 6920 7319 6921 // HardwareVirtExLargePages has too crazy default handling, must always save this setting.6922 pelmCPU->createChild("HardwareVirtExLargePages")->setAttribute("enabled", hw.fLargePages);6923 6924 if (m->sv >= SettingsVersion_v1_9)6925 {6926 if (hw.fHardwareVirtForce)6927 pelmCPU->createChild("HardwareVirtForce")->setAttribute("enabled", hw.fHardwareVirtForce);6928 }6929 6930 if (m->sv >= SettingsVersion_v1_9 && hw.fUseNativeApi)6931 pelmCPU->createChild("HardwareVirtExUseNativeApi")->setAttribute("enabled", hw.fUseNativeApi);6932 6933 7320 if (m->sv >= SettingsVersion_v1_10) 6934 7321 { … … 6951 7338 } 6952 7339 6953 xml::ElementNode *pelmCpuIdTree = NULL; 6954 for (CpuIdLeafsList::const_iterator it = hw.llCpuIdLeafs.begin(); 6955 it != hw.llCpuIdLeafs.end(); 6956 ++it) 6957 { 6958 const CpuIdLeaf &leaf = *it; 6959 6960 if (pelmCpuIdTree == NULL) 6961 pelmCpuIdTree = pelmCPU->createChild("CpuIdTree"); 6962 6963 xml::ElementNode *pelmCpuIdLeaf = pelmCpuIdTree->createChild("CpuIdLeaf"); 6964 pelmCpuIdLeaf->setAttribute("id", leaf.idx); 6965 if (leaf.idxSub != 0) 6966 pelmCpuIdLeaf->setAttribute("subleaf", leaf.idxSub); 6967 pelmCpuIdLeaf->setAttribute("eax", leaf.uEax); 6968 pelmCpuIdLeaf->setAttribute("ebx", leaf.uEbx); 6969 pelmCpuIdLeaf->setAttribute("ecx", leaf.uEcx); 6970 pelmCpuIdLeaf->setAttribute("edx", leaf.uEdx); 6971 } 7340 /* We only store specific stuff for the selected platform. */ 7341 if (plat.architectureType == PlatformArchitecture_x86) 7342 buildPlatformX86XML(*pelmPlatformOrHardware, *pelmCPU, plat.x86); 7343 /** @todo BUGBUG Put ARM stuff here. */ 7344 } 7345 7346 /** 7347 * Creates a \<Hardware\> node under elmParent and then writes out the XML 7348 * keys under that. Called for both the \<Machine\> node and for snapshots. 7349 * 7350 * @param elmParent Parent element. 7351 * @param hw Hardware settings to use for building the XML. 7352 * @param fl Flags. 7353 * @param pllElementsWithUuidAttributes Document me. 7354 */ 7355 void MachineConfigFile::buildHardwareXML(xml::ElementNode &elmParent, 7356 const Hardware &hw, 7357 uint32_t fl, 7358 std::list<xml::ElementNode*> *pllElementsWithUuidAttributes) 7359 { 7360 xml::ElementNode *pelmHardware = elmParent.createChild("Hardware"); 7361 7362 if ( m->sv >= SettingsVersion_v1_4 7363 && (m->sv < SettingsVersion_v1_7 ? hw.strVersion != "1" : hw.strVersion != "2")) 7364 pelmHardware->setAttribute("version", hw.strVersion); 7365 7366 if ((m->sv >= SettingsVersion_v1_9) 7367 && !hw.uuid.isZero() 7368 && hw.uuid.isValid() 7369 ) 7370 pelmHardware->setAttribute("uuid", hw.uuid.toStringCurly()); 6972 7371 6973 7372 xml::ElementNode *pelmMemory = pelmHardware->createChild("Memory"); … … 6977 7376 if (hw.fPageFusionEnabled) 6978 7377 pelmMemory->setAttribute("PageFusion", hw.fPageFusionEnabled); 6979 }6980 6981 if ( (m->sv >= SettingsVersion_v1_9)6982 && (hw.firmwareType >= FirmwareType_EFI)6983 )6984 {6985 xml::ElementNode *pelmFirmware = pelmHardware->createChild("Firmware");6986 const char *pcszFirmware;6987 6988 switch (hw.firmwareType)6989 {6990 case FirmwareType_EFI: pcszFirmware = "EFI"; break;6991 case FirmwareType_EFI32: pcszFirmware = "EFI32"; break;6992 case FirmwareType_EFI64: pcszFirmware = "EFI64"; break;6993 case FirmwareType_EFIDUAL: pcszFirmware = "EFIDUAL"; break;6994 default: pcszFirmware = "None"; break;6995 }6996 pelmFirmware->setAttribute("type", pcszFirmware);6997 7378 } 6998 7379 … … 7034 7415 } 7035 7416 7036 if ( (m->sv >= SettingsVersion_v1_10) 7037 && hw.fHPETEnabled 7038 ) 7039 { 7040 xml::ElementNode *pelmHPET = pelmHardware->createChild("HPET"); 7041 pelmHPET->setAttribute("enabled", hw.fHPETEnabled); 7042 } 7043 7044 if ( (m->sv >= SettingsVersion_v1_11) 7045 ) 7046 { 7047 if (hw.chipsetType != ChipsetType_PIIX3) 7048 { 7049 xml::ElementNode *pelmChipset = pelmHardware->createChild("Chipset"); 7050 const char *pcszChipset; 7051 7052 switch (hw.chipsetType) 7053 { 7054 case ChipsetType_PIIX3: pcszChipset = "PIIX3"; break; 7055 case ChipsetType_ICH9: pcszChipset = "ICH9"; break; 7056 default: Assert(false); pcszChipset = "PIIX3"; break; 7057 } 7058 pelmChipset->setAttribute("type", pcszChipset); 7059 } 7060 } 7417 7061 7418 7062 7419 if ( (m->sv >= SettingsVersion_v1_15) … … 7082 7439 && hw.strParavirtDebug.isNotEmpty()) 7083 7440 pelmParavirt->setAttribute("debug", hw.strParavirtDebug); 7084 }7085 7086 if ( m->sv >= SettingsVersion_v1_197087 && hw.iommuType != IommuType_None)7088 {7089 const char *pcszIommuType;7090 switch (hw.iommuType)7091 {7092 case IommuType_None: pcszIommuType = "None"; break;7093 case IommuType_Automatic: pcszIommuType = "Automatic"; break;7094 case IommuType_AMD: pcszIommuType = "AMD"; break;7095 case IommuType_Intel: pcszIommuType = "Intel"; break;7096 default: Assert(false); pcszIommuType = "None"; break;7097 }7098 7099 xml::ElementNode *pelmIommu = pelmHardware->createChild("Iommu");7100 pelmIommu->setAttribute("type", pcszIommuType);7101 7441 } 7102 7442 … … 7245 7585 } 7246 7586 7247 if (!hw.biosSettings.areDefaultSettings() || !hw.nvramSettings.areDefaultSettings()) 7248 { 7249 xml::ElementNode *pelmBIOS = pelmHardware->createChild("BIOS"); 7250 if (!hw.biosSettings.fACPIEnabled) 7251 pelmBIOS->createChild("ACPI")->setAttribute("enabled", hw.biosSettings.fACPIEnabled); 7252 if (hw.biosSettings.fIOAPICEnabled) 7253 pelmBIOS->createChild("IOAPIC")->setAttribute("enabled", hw.biosSettings.fIOAPICEnabled); 7254 if (hw.biosSettings.apicMode != APICMode_APIC) 7587 if ( !hw.firmwareSettings.areDefaultSettings( hw.platformSettings.architectureType == PlatformArchitecture_ARM 7588 /* Good enough for now (we don't support ARMv7). */ 7589 ? CPUArchitecture_ARMv8_64 : CPUArchitecture_x86) 7590 || !hw.nvramSettings.areDefaultSettings()) 7591 { 7592 xml::ElementNode *pelmFirmwareOrBIOS; 7593 if (m->sv >= SettingsVersion_v1_20) /* Since settings v1.20 the element was renamed to "Firmware". */ 7594 pelmFirmwareOrBIOS = pelmHardware->createChild("Firmware"); 7595 else 7596 pelmFirmwareOrBIOS = pelmHardware->createChild("BIOS"); 7597 7598 if ( (m->sv >= SettingsVersion_v1_9) 7599 && (hw.firmwareSettings.firmwareType >= FirmwareType_EFI) 7600 ) 7601 { 7602 const char *pcszFirmware; 7603 7604 switch (hw.firmwareSettings.firmwareType) 7605 { 7606 case FirmwareType_EFI: pcszFirmware = "EFI"; break; 7607 case FirmwareType_EFI32: pcszFirmware = "EFI32"; break; 7608 case FirmwareType_EFI64: pcszFirmware = "EFI64"; break; 7609 case FirmwareType_EFIDUAL: pcszFirmware = "EFIDUAL"; break; 7610 default: pcszFirmware = "None"; break; 7611 } 7612 pelmFirmwareOrBIOS->setAttribute("type", pcszFirmware); 7613 } 7614 7615 if (!hw.firmwareSettings.fACPIEnabled) 7616 pelmFirmwareOrBIOS->createChild("ACPI")->setAttribute("enabled", hw.firmwareSettings.fACPIEnabled); 7617 if (hw.firmwareSettings.fIOAPICEnabled) 7618 pelmFirmwareOrBIOS->createChild("IOAPIC")->setAttribute("enabled", hw.firmwareSettings.fIOAPICEnabled); 7619 if (hw.firmwareSettings.apicMode != APICMode_APIC) 7255 7620 { 7256 7621 const char *pcszAPIC; 7257 switch (hw. biosSettings.apicMode)7622 switch (hw.firmwareSettings.apicMode) 7258 7623 { 7259 7624 case APICMode_Disabled: … … 7268 7633 break; 7269 7634 } 7270 pelm BIOS->createChild("APIC")->setAttribute("mode", pcszAPIC);7271 } 7272 7273 if ( !hw. biosSettings.fLogoFadeIn7274 || !hw. biosSettings.fLogoFadeOut7275 || hw.biosSettings.ulLogoDisplayTime7276 || !hw. biosSettings.strLogoImagePath.isEmpty())7277 { 7278 xml::ElementNode *pelmLogo = pelm BIOS->createChild("Logo");7279 pelmLogo->setAttribute("fadeIn", hw. biosSettings.fLogoFadeIn);7280 pelmLogo->setAttribute("fadeOut", hw. biosSettings.fLogoFadeOut);7281 pelmLogo->setAttribute("displayTime", hw. biosSettings.ulLogoDisplayTime);7282 if (!hw. biosSettings.strLogoImagePath.isEmpty())7283 pelmLogo->setAttribute("imagePath", hw. biosSettings.strLogoImagePath);7284 } 7285 7286 if (hw. biosSettings.biosBootMenuMode != BIOSBootMenuMode_MessageAndMenu)7635 pelmFirmwareOrBIOS->createChild("APIC")->setAttribute("mode", pcszAPIC); 7636 } 7637 7638 if ( !hw.firmwareSettings.fLogoFadeIn 7639 || !hw.firmwareSettings.fLogoFadeOut 7640 || hw.firmwareSettings.ulLogoDisplayTime 7641 || !hw.firmwareSettings.strLogoImagePath.isEmpty()) 7642 { 7643 xml::ElementNode *pelmLogo = pelmFirmwareOrBIOS->createChild("Logo"); 7644 pelmLogo->setAttribute("fadeIn", hw.firmwareSettings.fLogoFadeIn); 7645 pelmLogo->setAttribute("fadeOut", hw.firmwareSettings.fLogoFadeOut); 7646 pelmLogo->setAttribute("displayTime", hw.firmwareSettings.ulLogoDisplayTime); 7647 if (!hw.firmwareSettings.strLogoImagePath.isEmpty()) 7648 pelmLogo->setAttribute("imagePath", hw.firmwareSettings.strLogoImagePath); 7649 } 7650 7651 if (hw.firmwareSettings.enmBootMenuMode != FirmwareBootMenuMode_MessageAndMenu) 7287 7652 { 7288 7653 const char *pcszBootMenu; 7289 switch (hw. biosSettings.biosBootMenuMode)7290 { 7291 case BIOSBootMenuMode_Disabled: pcszBootMenu = "Disabled"; break;7292 case BIOSBootMenuMode_MenuOnly: pcszBootMenu = "MenuOnly"; break;7293 default: /* BIOSBootMenuMode_MessageAndMenu*/ pcszBootMenu = "MessageAndMenu"; break;7294 } 7295 pelm BIOS->createChild("BootMenu")->setAttribute("mode", pcszBootMenu);7296 } 7297 if (hw. biosSettings.llTimeOffset)7298 pelm BIOS->createChild("TimeOffset")->setAttribute("value", hw.biosSettings.llTimeOffset);7299 if (hw. biosSettings.fPXEDebugEnabled)7300 pelm BIOS->createChild("PXEDebug")->setAttribute("enabled", hw.biosSettings.fPXEDebugEnabled);7654 switch (hw.firmwareSettings.enmBootMenuMode) 7655 { 7656 case FirmwareBootMenuMode_Disabled: pcszBootMenu = "Disabled"; break; 7657 case FirmwareBootMenuMode_MenuOnly: pcszBootMenu = "MenuOnly"; break; 7658 default: /*FirmwareBootMenuMode_MessageAndMenu*/ pcszBootMenu = "MessageAndMenu"; break; 7659 } 7660 pelmFirmwareOrBIOS->createChild("BootMenu")->setAttribute("mode", pcszBootMenu); 7661 } 7662 if (hw.firmwareSettings.llTimeOffset) 7663 pelmFirmwareOrBIOS->createChild("TimeOffset")->setAttribute("value", hw.firmwareSettings.llTimeOffset); 7664 if (hw.firmwareSettings.fPXEDebugEnabled) 7665 pelmFirmwareOrBIOS->createChild("PXEDebug")->setAttribute("enabled", hw.firmwareSettings.fPXEDebugEnabled); 7301 7666 if (!hw.nvramSettings.areDefaultSettings()) 7302 7667 { 7303 xml::ElementNode *pelmNvram = pelm BIOS->createChild("NVRAM");7668 xml::ElementNode *pelmNvram = pelmFirmwareOrBIOS->createChild("NVRAM"); 7304 7669 if (!hw.nvramSettings.strNvramPath.isEmpty()) 7305 7670 pelmNvram->setAttribute("path", hw.nvramSettings.strNvramPath); … … 7312 7677 } 7313 7678 } 7314 if (hw. biosSettings.fSmbiosUuidLittleEndian)7315 pelm BIOS->createChild("SmbiosUuidLittleEndian")->setAttribute("enabled", hw.biosSettings.fSmbiosUuidLittleEndian);7679 if (hw.firmwareSettings.fSmbiosUuidLittleEndian) 7680 pelmFirmwareOrBIOS->createChild("SmbiosUuidLittleEndian")->setAttribute("enabled", hw.firmwareSettings.fSmbiosUuidLittleEndian); 7316 7681 } 7317 7682 … … 7626 7991 pelmPort->setAttribute("slot", port.ulSlot); 7627 7992 pelmPort->setAttribute("enabled", port.fEnabled); 7628 pelmPort->setAttributeHex("IO Base", port.ulIOBase);7993 pelmPort->setAttributeHex("IOAddress", port.ulIOAddress); 7629 7994 pelmPort->setAttribute("IRQ", port.ulIRQ); 7630 7995 … … 7807 8172 } 7808 8173 } 7809 }7810 7811 if (m->sv >= SettingsVersion_v1_10 && machineUserData.fRTCUseUTC)7812 {7813 xml::ElementNode *pelmRTC = pelmHardware->createChild("RTC");7814 pelmRTC->setAttribute("localOrUTC", machineUserData.fRTCUseUTC ? "UTC" : "local");7815 8174 } 7816 8175 … … 8602 8961 buildRecordingXML(*pelmSnapshot, pSnap->recordingSettings); 8603 8962 // note: Groups exist only for Machine, not for Snapshot 8963 8964 if (m->sv < SettingsVersion_v1_20) /* Before settings v1.20 the platform stuff lived directly in the Hardware element. */ 8965 { 8966 xml::ElementNode *pelHardware = unconst(pelmSnapshot->findChildElement("Hardware")); 8967 if (pelHardware) 8968 buildPlatformXML(*pelHardware, pSnap->hardware, pSnap->hardware.platformSettings); 8969 } 8970 else /* Now lives outside of "Hardware", in "Platform". */ 8971 buildPlatformXML(*pelmSnapshot, pSnap->hardware, pSnap->hardware.platformSettings); 8604 8972 8605 8973 if (pSnap->llChildSnapshots.size()) … … 8780 9148 8781 9149 buildGroupsXML(elmMachine, machineUserData.llGroups); 9150 9151 /* Note: Must come *after* buildHardwareXML(), as the "Hardware" branch is needed. */ 9152 if (m->sv < SettingsVersion_v1_20) 9153 { 9154 xml::ElementNode *pelHardware = unconst(elmMachine.findChildElement("Hardware")); 9155 if (pelHardware) 9156 buildPlatformXML(*pelHardware, hardwareMachine, hardwareMachine.platformSettings); 9157 } 9158 else /* Now lives outside of "Hardware", in "Platform". */ 9159 buildPlatformXML(elmMachine, hardwareMachine, hardwareMachine.platformSettings); 8782 9160 } 8783 9161 … … 8994 9372 void MachineConfigFile::bumpSettingsVersionIfNeeded() 8995 9373 { 9374 if (m->sv < SettingsVersion_v1_20) 9375 { 9376 // VirtualBox 7.1 (settings v1.20) adds support for different VM platforms. 9377 if ( hardwareMachine.platformSettings.architectureType != PlatformArchitecture_None 9378 && hardwareMachine.platformSettings.architectureType != PlatformArchitecture_x86) 9379 { 9380 /* Note: The new chipset type ARMv8Virtual implies setting the platform architecture type to ARM. */ 9381 m->sv = SettingsVersion_v1_20; 9382 return; 9383 } 9384 } 9385 8996 9386 if (m->sv < SettingsVersion_v1_19) 8997 9387 { 8998 9388 // VirtualBox 7.0 adds iommu device and full VM encryption. 8999 if ( hardwareMachine. iommuType != IommuType_None9389 if ( hardwareMachine.platformSettings.iommuType != IommuType_None 9000 9390 || strKeyId.isNotEmpty() 9001 9391 || strKeyStore.isNotEmpty() … … 9067 9457 9068 9458 // VirtualBox 6.1 adds AMD-V virtualized VMSAVE/VMLOAD setting. 9069 if (hardwareMachine. fVirtVmsaveVmload == false)9459 if (hardwareMachine.platformSettings.x86.fHWVirtExVirtVmsaveVmload == false) 9070 9460 { 9071 9461 m->sv = SettingsVersion_v1_18; … … 9114 9504 9115 9505 // VirtualBox 6.0 adds nested hardware virtualization, using native API (NEM). 9116 if ( hardwareMachine. fNestedHWVirt9117 || hardwareMachine. fUseNativeApi)9506 if ( hardwareMachine.platformSettings.x86.fNestedHWVirt 9507 || hardwareMachine.platformSettings.x86.fHWVirtExUseNativeApi) 9118 9508 { 9119 9509 m->sv = SettingsVersion_v1_17; … … 9151 9541 // options, cpu profile, APIC settings (CPU capability and BIOS). 9152 9542 9153 if ( hardwareMachine.strParavirtDebug.isNotEmpty()9543 if ( hardwareMachine.strParavirtDebug.isNotEmpty() 9154 9544 || (!hardwareMachine.strCpuProfile.equals("host") && hardwareMachine.strCpuProfile.isNotEmpty()) 9155 || hardwareMachine.biosSettings.apicMode != APICMode_APIC9156 || !hardwareMachine. fAPIC9157 || hardwareMachine.fX2APIC9158 || hardwareMachine.fIBPBOnVMExit9159 || hardwareMachine.fIBPBOnVMEntry9160 || hardwareMachine.fSpecCtrl9161 || hardwareMachine.fSpecCtrlByHost9162 || !hardwareMachine. fL1DFlushOnSched9163 || hardwareMachine.fL1DFlushOnVMEntry9164 || !hardwareMachine. fMDSClearOnSched9165 || hardwareMachine.fMDSClearOnVMEntry)9545 || hardwareMachine.firmwareSettings.apicMode != APICMode_APIC 9546 || !hardwareMachine.platformSettings.x86.fAPIC 9547 || hardwareMachine.platformSettings.x86.fX2APIC 9548 || hardwareMachine.platformSettings.x86.fIBPBOnVMExit 9549 || hardwareMachine.platformSettings.x86.fIBPBOnVMEntry 9550 || hardwareMachine.platformSettings.x86.fSpecCtrl 9551 || hardwareMachine.platformSettings.x86.fSpecCtrlByHost 9552 || !hardwareMachine.platformSettings.x86.fL1DFlushOnSched 9553 || hardwareMachine.platformSettings.x86.fL1DFlushOnVMEntry 9554 || !hardwareMachine.platformSettings.x86.fMDSClearOnSched 9555 || hardwareMachine.platformSettings.x86.fMDSClearOnVMEntry) 9166 9556 { 9167 9557 m->sv = SettingsVersion_v1_16; … … 9182 9572 } 9183 9573 9184 for (CpuIdLeafs List::const_iterator it = hardwareMachine.llCpuIdLeafs.begin();9185 it != hardwareMachine. llCpuIdLeafs.end();9574 for (CpuIdLeafsX86List::const_iterator it = hardwareMachine.platformSettings.x86.llCpuIdLeafs.begin(); 9575 it != hardwareMachine.platformSettings.x86.llCpuIdLeafs.end(); 9186 9576 ++it) 9187 9577 if (it->idxSub != 0) … … 9280 9670 if ( !hardwareMachine.strDefaultFrontend.isEmpty() 9281 9671 || hardwareMachine.graphicsAdapter.graphicsControllerType != GraphicsControllerType_VBoxVGA 9282 || hardwareMachine. enmLongMode != Hardware::LongMode_Legacy9672 || hardwareMachine.platformSettings.x86.enmLongMode != PlatformX86::LongMode_Legacy 9283 9673 || machineUserData.ovIcon.size() > 0 9284 9674 || recordingSettings.common.fEnabled) … … 9408 9798 || machineUserData.strOsType == "JRockitVE" 9409 9799 || hardwareMachine.ioSettings.llBandwidthGroups.size() 9410 || hardwareMachine. chipsetType == ChipsetType_ICH99800 || hardwareMachine.platformSettings.chipsetType == ChipsetType_ICH9 9411 9801 ) 9412 9802 m->sv = SettingsVersion_v1_11; … … 9589 9979 || (hardwareMachine.fPageFusionEnabled) 9590 9980 // and CPU hotplug, RTC timezone control, HID type and HPET 9591 || machineUserData.fRTCUseUTC9981 || hardwareMachine.platformSettings.fRTCUseUTC 9592 9982 || hardwareMachine.fCpuHotPlug 9593 9983 || hardwareMachine.pointingHIDType != PointingHIDType_PS2Mouse 9594 9984 || hardwareMachine.keyboardHIDType != KeyboardHIDType_PS2Keyboard 9595 || hardwareMachine. fHPETEnabled9985 || hardwareMachine.platformSettings.x86.fHPETEnabled 9596 9986 ) 9597 9987 m->sv = SettingsVersion_v1_10; … … 9652 10042 // all the following require settings version 1.9 9653 10043 if ( (m->sv < SettingsVersion_v1_9) 9654 && ( (hardwareMachine.firmwareType >= FirmwareType_EFI)10044 && ( (hardwareMachine.firmwareSettings.firmwareType >= FirmwareType_EFI) 9655 10045 || machineUserData.fTeleporterEnabled 9656 10046 || machineUserData.uTeleporterPort -
trunk/src/VBox/Main/xml/VirtualBox-settings.xsd
r98108 r101035 218 218 </xsd:simpleType> 219 219 220 <xsd:simpleType name="T BIOSBootMenuModeType">220 <xsd:simpleType name="TFirmwareBootMenuModeType"> 221 221 <xsd:restriction base="xsd:string"> 222 222 <xsd:enumeration value="Disabled"/> … … 456 456 <xsd:attribute name="LogHistoryCount" type="xsd:unsignedInt" default="3"/> 457 457 <xsd:attribute name="defaultVRDEExtPack" type="xsd:string"/> 458 <xsd:attribute name="exclusiveHwVirt" type="xsd:boolean"/> 458 <xsd:attribute name="exclusiveHwVirt" type="xsd:boolean"/> <!-- deprecated since v1.20 --> 459 459 <xsd:attribute name="proxyMode" type="xsd:string"/> 460 460 </xsd:complexType> … … 582 582 </xsd:complexType> 583 583 584 <xsd:complexType name="THardwareVirtExUseNativeApi"> 585 <xsd:attribute name="enabled" type="xsd:boolean"/> 586 </xsd:complexType> 587 588 <xsd:complexType name="TIBPBOn"> 589 <xsd:attribute name="vmexit" type="xsd:boolean"/> 590 <xsd:attribute name="vmentry" type="xsd:boolean"/> 591 </xsd:complexType> 592 593 <xsd:complexType name="TSpecCtrl"> 594 <xsd:attribute name="enabled" type="xsd:boolean"/> 595 </xsd:complexType> 596 597 <xsd:complexType name="TSpecCtrlByHost"> 598 <xsd:attribute name="enabled" type="xsd:boolean"/> 599 </xsd:complexType> 600 601 <xsd:complexType name="TL1DFlushOn"> 602 <xsd:attribute name="scheduling" type="xsd:boolean"/> 603 <xsd:attribute name="vmentry" type="xsd:boolean"/> 604 </xsd:complexType> 605 606 <xsd:complexType name="TMDSClearOn"> 607 <xsd:attribute name="scheduling" type="xsd:boolean"/> 608 <xsd:attribute name="vmentry" type="xsd:boolean"/> 609 </xsd:complexType> 610 611 <xsd:complexType name="TNestedHWVirt"> 612 <xsd:attribute name="enabled" type="xsd:boolean"/> 613 </xsd:complexType> 614 615 <xsd:complexType name="THardwareVirtExVirtVmsaveVmload"> 616 <xsd:attribute name="enabled" type="xsd:boolean"/> 617 </xsd:complexType> 618 619 <xsd:complexType name="TTripleFaultReset"> 620 <xsd:attribute name="enabled" type="xsd:boolean"/> 621 </xsd:complexType> 622 623 <xsd:complexType name="TX2APIC"> 624 <xsd:attribute name="enabled" type="xsd:boolean"/> 625 </xsd:complexType> 626 627 <xsd:complexType name="TAPIC"> 628 <xsd:attribute name="enabled" type="xsd:boolean"/> 629 </xsd:complexType> 630 584 631 <xsd:simpleType name="TCPUCount"> 585 632 <xsd:restriction base="xsd:unsignedInt"> … … 589 636 </xsd:simpleType> 590 637 591 <xsd:complexType name="TCpuIdLeaf ">638 <xsd:complexType name="TCpuIdLeafX86"> 592 639 <xsd:attribute name="id" type="xsd:unsignedInt" use="required"/> 593 640 <xsd:attribute name="eax" type="xsd:unsignedInt" use="required"/> … … 597 644 </xsd:complexType> 598 645 599 <xsd:complexType name="TCpuIdTree ">600 <xsd:sequence> 601 <xsd:element name="CpuIdLeaf" type="TCpuIdLeaf "646 <xsd:complexType name="TCpuIdTreeX86"> 647 <xsd:sequence> 648 <xsd:element name="CpuIdLeaf" type="TCpuIdLeafX86" 602 649 minOccurs="0" maxOccurs="unbounded"/> 603 650 </xsd:sequence> 604 651 </xsd:complexType> 605 652 606 <xsd:complexType name="TCPU"> 607 <xsd:sequence> 653 <xsd:complexType name="TCPUX86"> <!-- Contains the "x86" sub element of the CPU element. New since v1.20. --> 654 <xsd:sequence> 655 <xsd:element name="HPET" type="THPET" minOccurs="0"/> 656 <xsd:element name="HardwareVirtExLargePages" type="THardwareVirtExLargePages" minOccurs="0"/> 657 <xsd:element name="HardwareVirtForce" type="THardwareVirtForce" minOccurs="0"/> 658 <xsd:element name="HardwareVirtExUseNativeApi" type="THardwareVirtExUseNativeApi" minOccurs="0"/> 608 659 <xsd:element name="HardwareVirtEx" type="THWVirtExType" minOccurs="0"/> 609 660 <xsd:element name="HardwareVirtExNestedPaging" type="THWVirtExNestedPagingType" minOccurs="0"/> … … 611 662 <xsd:element name="HardwareVirtExUX" type="THWVirtExUXType" minOccurs="0"/> 612 663 <xsd:element name="PAE" type="TPAEType" minOccurs="0"/> 664 <xsd:element name="IBPBOn" type="TIBPBOn" minOccurs="0"/> 665 <xsd:element name="SpecCtrl" type="TSpecCtrl" minOccurs="0"/> 666 <xsd:element name="SpecCtrlByHost" type="TSpecCtrlByHost" minOccurs="0"/> 667 <xsd:element name="L1DFlushOn" type="TL1DFlushOn" minOccurs="0"/> 668 <xsd:element name="MDSClearOn" type="TMDSClearOn" minOccurs="0"/> 669 <xsd:element name="NestedHWVirt" type="TNestedHWVirt" minOccurs="0"/> 670 <xsd:element name="HardwareVirtExVirtVmsaveVmload" type="THardwareVirtExVirtVmsaveVmload" minOccurs="0"/> 613 671 <xsd:element name="LongMode" type="TLongModeType" minOccurs="0"/> 614 <xsd:element name="HardwareVirtExLargePages" type="THardwareVirtExLargePages" minOccurs="0"/> 615 <xsd:element name="HardwareVirtForce" type="THardwareVirtForce" minOccurs="0"/> 672 <xsd:element name="TripleFaultReset" type="TTripleFaultReset" minOccurs="0"/> 673 <xsd:element name="X2APIC" type="TX2APIC" minOccurs="0"/> 674 <xsd:element name="APIC" type="TAPIC" minOccurs="0"/> 675 <xsd:element name="CpuIdTree" type="TCpuIdTreeX86" minOccurs="0"> 676 <xsd:unique name="TCPUX86-CpuIdTree-CpuIdLeaf"> 677 <xsd:selector xpath="vb:CpuIdLeaf"/> 678 <xsd:field xpath="@id"/> 679 </xsd:unique> 680 </xsd:element> 681 </xsd:sequence> 682 </xsd:complexType> 683 684 <xsd:complexType name="TCPU"> 685 <xsd:sequence> 686 <xsd:element name="HardwareVirtEx" type="THWVirtExType" minOccurs="0"/> <!-- deprecated since v1.20. --> 687 <xsd:element name="HardwareVirtExNestedPaging" type="THWVirtExNestedPagingType" minOccurs="0"/> <!-- deprecated since v1.20. --> 688 <xsd:element name="HardwareVirtExVPID" type="THWVirtExVPIDType" minOccurs="0"/> <!-- deprecated since v1.20. --> 689 <xsd:element name="HardwareVirtExUX" type="THWVirtExUXType" minOccurs="0"/> <!-- deprecated since v1.20. --> 690 <xsd:element name="PAE" type="TPAEType" minOccurs="0"/> <!-- deprecated since v1.20. --> 691 <xsd:element name="LongMode" type="TLongModeType" minOccurs="0"/> <!-- deprecated since v1.20. --> 692 <xsd:element name="HardwareVirtExLargePages" type="THardwareVirtExLargePages" minOccurs="0"/> <!-- deprecated since v1.20. --> 693 <xsd:element name="HardwareVirtForce" type="THardwareVirtForce" minOccurs="0"/> <!-- deprecated since v1.20. --> 616 694 <xsd:element name="SyntheticCpu" type="TSyntheticCpuType" minOccurs="0"/> 617 <xsd:element name="CpuIdTree" type="TCpuIdTree " minOccurs="0">695 <xsd:element name="CpuIdTree" type="TCpuIdTreeX86" minOccurs="0"> <!-- deprecated since v1.20. --> 618 696 <xsd:unique name="TCPU-CpuIdTree-CpuIdLeaf"> 619 697 <xsd:selector xpath="vb:CpuIdLeaf"/> … … 720 798 </xsd:complexType> 721 799 722 <xsd:complexType name="T BIOS">800 <xsd:complexType name="TFirmware"> <!-- Note: Is named as element "BIOS" for settings < v1.20. --> 723 801 <xsd:all> 724 802 <xsd:element name="ACPI" minOccurs="0"> … … 742 820 <xsd:element name="BootMenu" minOccurs="0"> 743 821 <xsd:complexType> 744 <xsd:attribute name="mode" type="T BIOSBootMenuModeType" default="MessageAndMenu"/>822 <xsd:attribute name="mode" type="TFirmwareBootMenuModeType" default="MessageAndMenu"/> 745 823 </xsd:complexType> 746 824 </xsd:element> … … 780 858 </xsd:element> 781 859 </xsd:all> 860 <xsd:attribute name="type" type="TFirmwareType" use="required"/> <!-- new since v1.20. --> 782 861 </xsd:complexType> 783 862 … … 1281 1360 </xsd:complexType> 1282 1361 1283 <xsd:complexType name="TFirmware"> 1284 <xsd:attribute name="type" use="required"> 1285 <xsd:simpleType> 1286 <xsd:restriction base="xsd:token"> 1287 <xsd:enumeration value="BIOS"/> 1288 <xsd:enumeration value="EFI"/> 1289 <xsd:enumeration value="EFI32"/> 1290 <xsd:enumeration value="EFI64"/> 1291 <xsd:enumeration value="EFIDUAL"/> 1292 </xsd:restriction> 1293 </xsd:simpleType> 1294 </xsd:attribute> 1295 </xsd:complexType> 1362 <xsd:simpleType name="TFirmwareType"> 1363 <xsd:restriction base="xsd:token"> 1364 <xsd:enumeration value="BIOS"/> 1365 <xsd:enumeration value="EFI"/> 1366 <xsd:enumeration value="EFI32"/> 1367 <xsd:enumeration value="EFI64"/> 1368 <xsd:enumeration value="EFIDUAL"/> 1369 </xsd:restriction> 1370 </xsd:simpleType> 1296 1371 1297 1372 <xsd:complexType name="THID"> … … 1327 1402 <xsd:enumeration value="PIIX3"/> 1328 1403 <xsd:enumeration value="ICH9"/> 1404 </xsd:restriction> 1405 </xsd:simpleType> 1406 </xsd:attribute> 1407 </xsd:complexType> 1408 1409 <xsd:complexType name="TIommu"> <!-- new since v1.19. --> 1410 <xsd:attribute name="type" use="required"> 1411 <xsd:simpleType> 1412 <xsd:restriction base="xsd:token"> 1413 <xsd:enumeration value="None"/> 1414 <xsd:enumeration value="Automatic"/> 1415 <xsd:enumeration value="AMD"/> 1416 <xsd:enumeration value="Intel"/> 1329 1417 </xsd:restriction> 1330 1418 </xsd:simpleType> … … 1355 1443 </xsd:complexType> 1356 1444 1445 <xsd:simpleType name="TPlatformArchitecture"> <!-- new since v1.20. --> 1446 <xsd:restriction base="xsd:token"> 1447 <xsd:enumeration value="None"/> 1448 <xsd:enumeration value="x86"/> 1449 <xsd:enumeration value="ARM"/> 1450 </xsd:restriction> 1451 </xsd:simpleType> 1452 1453 <xsd:complexType name="TPlatformProperties"> <!-- new since v1.20. --> 1454 <xsd:attribute name="exclusiveHwVirt" type="xsd:boolean"/> 1455 </xsd:complexType> 1456 1457 <xsd:complexType name="TPlatformX86"> <!-- new since v1.20. --> 1458 </xsd:complexType> 1459 1460 <xsd:complexType name="TPlatformARM"> <!-- new since v1.20. --> 1461 </xsd:complexType> 1462 1463 <xsd:complexType name="TPlatform"> <!-- new since v1.20. --> 1464 <xsd:all> 1465 <xsd:element name="Chipset" type="TChipset" minOccurs="0"/> 1466 <xsd:element name="Iommu" type="TIommu" minOccurs="0"/> 1467 <xsd:element name="RTC" type="TRTC" minOccurs="0"/> 1468 <xsd:element name="CPU" type="TCPU"/> 1469 <xsd:element name="x86" type="TPlatformX86" minOccurs="0"/> 1470 </xsd:all> 1471 <xsd:attribute name="architecture" type="TPlatformArchitecture" use="required"/> 1472 </xsd:complexType> 1473 1357 1474 <xsd:complexType name="THardware"> 1358 1475 <xsd:all> 1359 <xsd:element name="CPU" type="TCPU" minOccurs="0"/> 1476 <xsd:element name="CPU" type="TCPU" minOccurs="0"/> <!-- deprecated since v1.20. --> 1360 1477 <xsd:element name="Memory" type="TMemory"/> 1361 1478 <xsd:element name="Firmware" type="TFirmware" minOccurs="0"/> 1362 1479 <xsd:element name="HID" type="THID" minOccurs="0"/> 1363 <xsd:element name="HPET" type="THPET" minOccurs="0"/> 1364 <xsd:element name="Chipset" type="TChipset" minOccurs="0"/> 1480 <xsd:element name="HPET" type="THPET" minOccurs="0"/> <!-- deprecated since v1.20. --> 1481 <xsd:element name="Chipset" type="TChipset" minOccurs="0"/> <!-- deprecated since v1.20. --> 1365 1482 <xsd:element name="Paravirt" type="TParavirt" minOccurs="0"/> 1366 1483 <xsd:element name="Boot" type="TBoot" minOccurs="0"> … … 1374 1491 <xsd:element name="VideoCapture" type="TVideoCapture" minOccurs="0"/> 1375 1492 <xsd:element name="RemoteDisplay" type="TRemoteDisplay" minOccurs="0"/> 1376 <xsd:element name="BIOS" type="T BIOS" minOccurs="0"/>1493 <xsd:element name="BIOS" type="TFirmware" minOccurs="0"/> <!-- deprecated since v1.20. --> 1377 1494 <xsd:element name="DVDDrive" type="TDVDDrive" minOccurs="0"/> 1378 1495 <xsd:element name="FloppyDrive" type="TFloppyDrive" minOccurs="0"/> … … 1411 1528 </xsd:element> 1412 1529 <xsd:element name="AudioAdapter" type="TAudioAdapter" minOccurs="0"/> 1413 <xsd:element name="RTC" type="TRTC" minOccurs="0"/> 1530 <xsd:element name="RTC" type="TRTC" minOccurs="0"/> <!-- deprecated since v1.20. --> 1414 1531 <xsd:element name="SharedFolders" type="TSharedFolders" minOccurs="0"> 1415 1532 <xsd:unique name="THardware-SharedFolders-SharedFolder"> … … 1451 1568 <xsd:element name="Teleporter" type="TTeleporter" minOccurs="0"/> 1452 1569 <xsd:element name="Hardware" type="THardware"/> 1570 <xsd:element name="Platform" type="TPlatform" minOccurs="0"/> <!-- new since v1.20. --> 1453 1571 <xsd:element name="StorageControllers" type="TStorageControllers" minOccurs="0"/> 1454 1572 <xsd:element name="HardDiskAttachments" type="THardDiskAttachments" minOccurs="0"/> <!-- deprecated -->
Note:
See TracChangeset
for help on using the changeset viewer.