Changeset 91213 in vbox
- Timestamp:
- Sep 10, 2021 5:58:08 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/doc/manual/en_US/man_VBoxManage-modifyvm.xml
r91204 r91213 184 184 <arg choice="plain">intel</arg> 185 185 </group></arg> 186 <arg>--tpm-type=<group choice="plain"> 187 <arg choice="plain">none</arg> 188 <arg choice="plain">1.2</arg> 189 <arg choice="plain">2.0</arg> 190 <arg choice="plain">host</arg> 191 <arg choice="plain">swtpm</arg> 192 </group></arg> 193 <arg>--tpm-location=<group choice="plain"> 194 <arg choice="plain"><replaceable>location</replaceable></arg> 195 </group></arg> 186 196 <arg>--bioslogofadein=<group choice="plain"> 187 197 <arg choice="plain">on</arg> … … 1082 1092 </varlistentry> 1083 1093 <varlistentry> 1094 <term><option>--tpm-type=none | 1.2 | 2.0 | host | swtpm</option></term> 1095 <listitem><para> 1096 Specifies the TPM type for &product-name; to emulate. 1097 </para><para> 1098 Valid values are as follows: 1099 </para><itemizedlist> 1100 <listitem><para> 1101 <literal>none</literal> – No TPM is present 1102 and is the default value. 1103 </para></listitem> 1104 <listitem><para> 1105 <literal>1.2</literal> – A TPM conforming to the TCG specification 1106 version 1.2 is present. 1107 </para></listitem> 1108 <listitem><para> 1109 <literal>2.0</literal> – A TPM conforming to the TCG specification 1110 version 2.0 is present. 1111 </para></listitem> 1112 <listitem><para> 1113 <literal>host</literal> – The host TPM is passed through to the guest. 1114 May not be available on all supported host platforms. 1115 </para></listitem> 1116 <listitem><para> 1117 <literal>swtpm</literal> – The VM connects to an external TPM emulation 1118 compliant to swtpm. Requires to set the TPM location to connect to (see 1119 <option>--tpm-location</option> option). 1120 </para></listitem> 1121 </itemizedlist></listitem> 1122 </varlistentry> 1123 <varlistentry> 1084 1124 <term><option>--bioslogofadein=on | off</option></term> 1085 1125 <listitem><para> -
trunk/include/VBox/log.h
r91137 r91213 585 585 /** Main group, IToken. */ 586 586 LOG_GROUP_MAIN_TOKEN, 587 /** Main group, ITrustedPlatformModule. */ 588 LOG_GROUP_MAIN_TRUSTEDPLATFORMMODULE, 587 589 /** Main group, IUnattended. */ 588 590 LOG_GROUP_MAIN_UNATTENDED, … … 1059 1061 "MAIN_THREAD_TASK", \ 1060 1062 "MAIN_TOKEN", \ 1063 "MAIN_TRUSTEDPLATFORMMODULE", \ 1061 1064 "MAIN_UNATTENDED", \ 1062 1065 "MAIN_USBCONTROLLER", \ -
trunk/include/VBox/settings.h
r90828 r91213 544 544 com::Utf8Str strLogoImagePath; 545 545 com::Utf8Str strNVRAMPath; 546 }; 547 548 /** 549 * NOTE: If you add any fields in here, you must update a) the constructor and b) 550 * the operator== which is used by MachineConfigFile::operator==(), or otherwise 551 * your settings might never get saved. 552 */ 553 struct TpmSettings 554 { 555 TpmSettings(); 556 557 bool areDefaultSettings() const; 558 559 bool operator==(const TpmSettings &d) const; 560 561 TpmType_T tpmType; 562 com::Utf8Str strLocation; 546 563 }; 547 564 … … 1157 1174 GraphicsAdapter graphicsAdapter; 1158 1175 USB usbSettings; 1176 TpmSettings tpmSettings; // requires settings version 1.19 (VirtualBox 6.2) 1159 1177 NetworkAdaptersList llNetworkAdapters; 1160 1178 SerialPortsList llSerialPorts; -
trunk/src/VBox/Frontends/VBoxManage/Makefile.kmk
r91204 r91213 52 52 $(if $(VBOX_WITH_IOMMU_INTEL),VBOX_WITH_IOMMU_INTEL) \ 53 53 $(if $(VBOX_WITH_VMSVGA),VBOX_WITH_VMSVGA) \ 54 $(if $(VBOX_WITH_MAIN_NLS),VBOX_WITH_MAIN_NLS) 54 $(if $(VBOX_WITH_MAIN_NLS),VBOX_WITH_MAIN_NLS) \ 55 $(if $(VBOX_WITH_TPM),VBOX_WITH_TPM) 55 56 56 57 -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r91204 r91213 239 239 MODIFYVM_IOMMU, 240 240 #endif 241 #if defined(VBOX_WITH_TPM) 242 MODIFYVM_TPM_LOCATION, 243 MODIFYVM_TPM_TYPE, 244 #endif 241 245 MODIFYVM_DEFAULTFRONTEND, 242 246 MODIFYVM_VMPROC_PRIORITY … … 415 419 { "--iommu", MODIFYVM_IOMMU, RTGETOPT_REQ_STRING }, 416 420 #endif 421 #if defined(VBOX_WITH_TPM) 422 { "--tpm-type", MODIFYVM_TPM_TYPE, RTGETOPT_REQ_STRING }, 423 { "--tpm-location", MODIFYVM_TPM_LOCATION, RTGETOPT_REQ_STRING }, 424 #endif 417 425 #ifdef VBOX_WITH_RECORDING 418 426 { "--recording", MODIFYVM_RECORDING, RTGETOPT_REQ_BOOL_ONOFF }, … … 3056 3064 } 3057 3065 #endif 3066 #if defined(VBOX_WITH_TPM) 3067 case MODIFYVM_TPM_TYPE: 3068 { 3069 ComPtr<ITrustedPlatformModule> tpm; 3070 sessionMachine->COMGETTER(TrustedPlatformModule)(tpm.asOutParam()); 3071 3072 if ( !RTStrICmp(ValueUnion.psz, "none") 3073 || !RTStrICmp(ValueUnion.psz, "disabled")) 3074 CHECK_ERROR(tpm, COMSETTER(Type)(TpmType_None)); 3075 else if (!RTStrICmp(ValueUnion.psz, "1.2")) 3076 CHECK_ERROR(tpm, COMSETTER(Type)(TpmType_v1_2)); 3077 else if (!RTStrICmp(ValueUnion.psz, "2.0")) 3078 CHECK_ERROR(tpm, COMSETTER(Type)(TpmType_v2_0)); 3079 else if (!RTStrICmp(ValueUnion.psz, "host")) 3080 CHECK_ERROR(tpm, COMSETTER(Type)(TpmType_Host)); 3081 else if (!RTStrICmp(ValueUnion.psz, "swtpm")) 3082 CHECK_ERROR(tpm, COMSETTER(Type)(TpmType_Swtpm)); 3083 else 3084 { 3085 errorArgument("Invalid --tpm-type argument '%s'", ValueUnion.psz); 3086 rc = E_FAIL; 3087 } 3088 break; 3089 } 3090 3091 case MODIFYVM_TPM_LOCATION: 3092 { 3093 ComPtr<ITrustedPlatformModule> tpm; 3094 sessionMachine->COMGETTER(TrustedPlatformModule)(tpm.asOutParam()); 3095 3096 CHECK_ERROR(tpm, COMSETTER(Location)(Bstr(ValueUnion.psz).raw())); 3097 break; 3098 } 3099 #endif 3058 3100 #ifdef VBOX_WITH_RECORDING 3059 3101 case MODIFYVM_RECORDING: -
trunk/src/VBox/Main/Makefile.kmk
r90828 r91213 488 488 $(if $(VBOX_WITH_IOMMU_AMD),VBOX_WITH_IOMMU_AMD,) \ 489 489 $(if $(VBOX_WITH_IOMMU_INTEL),VBOX_WITH_IOMMU_INTEL,) \ 490 $(if $(VBOX_WITH_TPM),VBOX_WITH_TPM,) \ 490 491 $(if-expr defined(VBOX_WITH_SDS),VBOX_WITH_SDS,) 491 492 ifdef VBOX_WITH_USB … … 612 613 src-server/SystemPropertiesImpl.cpp \ 613 614 src-server/TokenImpl.cpp \ 615 src-server/TrustedPlatformModuleImpl.cpp \ 614 616 $(if $(VBOX_WITH_UNATTENDED), \ 615 617 src-server/UnattendedImpl.cpp \ … … 903 905 $(if $(VBOX_WITH_LIBCURL), VBOX_WITH_PROXY_INFO) \ 904 906 $(if $(VBOX_WITH_IOMMU_AMD),VBOX_WITH_IOMMU_AMD,) \ 905 $(if $(VBOX_WITH_IOMMU_INTEL),VBOX_WITH_IOMMU_INTEL,) 907 $(if $(VBOX_WITH_IOMMU_INTEL),VBOX_WITH_IOMMU_INTEL,) \ 908 $(if $(VBOX_WITH_TPM),VBOX_WITH_TPM,) 906 909 ifdef VBOX_WITH_NETSHAPER 907 910 VBoxC_DEFS += VBOX_WITH_NETSHAPER -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r91130 r91213 5423 5423 5424 5424 <enum 5425 name="TpmType" 5426 uuid="c669b9f7-a547-42b6-8464-636aa53401eb" 5427 > 5428 <desc> 5429 TPM type enumeration. 5430 </desc> 5431 5432 <const name="None" value="0"> 5433 <desc>No TPM present in the virtual machine.</desc> 5434 </const> 5435 <const name="v1_2" value="1"> 5436 <desc>A TPM compliant to the 1.2 TCG specification is emulated.</desc> 5437 </const> 5438 <const name="v2_0" value="2"> 5439 <desc>A TPM compliant to the 2.0 TCG specification is emulated.</desc> 5440 </const> 5441 <const name="Host" value="3"> 5442 <desc>The host TPM is passed through, might not be available on all host platforms.</desc> 5443 </const> 5444 <const name="Swtpm" value="4"> 5445 <desc>The VM will attach to an external software TPM emulation compliant to swtpm.</desc> 5446 </const> 5447 </enum> 5448 5449 <interface 5450 name="ITrustedPlatformModule" extends="$unknown" 5451 uuid="cf11d345-0241-4ea9-ac4c-c69ed3d674e3" 5452 wsmap="managed" 5453 reservedMethods="2" reservedAttributes="8" 5454 > 5455 <desc> 5456 The ITrustedPlatformModule interface represents the settings of the virtual 5457 machine's trusted platform module. This is used only in the <link to="IMachine::TrustedPlatformModule"/> attribute. 5458 </desc> 5459 5460 <attribute name="type" type="TpmType"> 5461 <desc> 5462 Type of TPM configured for the virtual machine. 5463 </desc> 5464 </attribute> 5465 5466 <attribute name="location" type="wstring"> 5467 <desc> 5468 Location of the TPM. This is only used for the TpmType_Swtpm type of TPM 5469 where the location denotes a <b>hostname:port</b> where to connect to. 5470 </desc> 5471 </attribute> 5472 5473 </interface> 5474 5475 <enum 5425 5476 name="RecordingDestination" 5426 5477 uuid="11E3F06B-DEC1-48B9-BDC4-1E618D72893C" … … 6016 6067 <interface 6017 6068 name="IMachine" extends="$unknown" 6018 uuid=" 621a4d3f-97a5-4f64-89eb-e0a9b2b79e23"6069 uuid="9764b032-9f0f-4b3f-a6a3-e1630c8384bd" 6019 6070 wsmap="managed" 6020 6071 wrap-hint-server-addinterfaces="IInternalMachineControl" … … 6273 6324 <attribute name="BIOSSettings" type="IBIOSSettings" readonly="yes"> 6274 6325 <desc>Object containing all BIOS settings.</desc> 6326 </attribute> 6327 6328 <attribute name="TrustedPlatformModule" type="ITrustedPlatformModule" readonly="yes"> 6329 <desc>Object containing all TPM settings.</desc> 6275 6330 </attribute> 6276 6331 -
trunk/src/VBox/Main/include/MachineImpl.h
r90828 r91213 41 41 #include "BandwidthControlImpl.h" 42 42 #include "BandwidthGroupImpl.h" 43 #include "TrustedPlatformModuleImpl.h" 43 44 #ifdef VBOX_WITH_RESOURCE_USAGE_API 44 45 # include "Performance.h" … … 472 473 enum 473 474 { 474 IsModified_MachineData = 0x0001, 475 IsModified_Storage = 0x0002, 476 IsModified_NetworkAdapters = 0x0008, 477 IsModified_SerialPorts = 0x0010, 478 IsModified_ParallelPorts = 0x0020, 479 IsModified_VRDEServer = 0x0040, 480 IsModified_AudioAdapter = 0x0080, 481 IsModified_USB = 0x0100, 482 IsModified_BIOS = 0x0200, 483 IsModified_SharedFolders = 0x0400, 484 IsModified_Snapshots = 0x0800, 485 IsModified_BandwidthControl = 0x1000, 486 IsModified_Recording = 0x2000, 487 IsModified_GraphicsAdapter = 0x4000, 475 IsModified_MachineData = 0x0001, 476 IsModified_Storage = 0x0002, 477 IsModified_NetworkAdapters = 0x0008, 478 IsModified_SerialPorts = 0x0010, 479 IsModified_ParallelPorts = 0x0020, 480 IsModified_VRDEServer = 0x0040, 481 IsModified_AudioAdapter = 0x0080, 482 IsModified_USB = 0x0100, 483 IsModified_BIOS = 0x0200, 484 IsModified_SharedFolders = 0x0400, 485 IsModified_Snapshots = 0x0800, 486 IsModified_BandwidthControl = 0x1000, 487 IsModified_Recording = 0x2000, 488 IsModified_GraphicsAdapter = 0x4000, 489 IsModified_TrustedPlatformModule = 0x8000, 488 490 }; 489 491 … … 794 796 const ComObjPtr<GraphicsAdapter> mGraphicsAdapter; 795 797 const ComObjPtr<BandwidthControl> mBandwidthControl; 798 799 const ComObjPtr<TrustedPlatformModule> mTrustedPlatformModule; 796 800 797 801 typedef std::vector<ComObjPtr<NetworkAdapter> > NetworkAdapterVector; … … 886 890 HRESULT getGraphicsAdapter(ComPtr<IGraphicsAdapter> &aGraphicsAdapter); 887 891 HRESULT getBIOSSettings(ComPtr<IBIOSSettings> &aBIOSSettings); 892 HRESULT getTrustedPlatformModule(ComPtr<ITrustedPlatformModule> &aTrustedPlatformModule); 888 893 HRESULT getRecordingSettings(ComPtr<IRecordingSettings> &aRecordingSettings); 889 894 HRESULT getFirmwareType(FirmwareType_T *aFirmwareType); -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r91074 r91213 3395 3395 #endif /* VBOX_WITH_DRAG_AND_DROP */ 3396 3396 3397 #if defined(VBOX_WITH_TPM) 3398 /* 3399 * Configure the Trusted Platform Module. 3400 */ 3401 ComObjPtr<ITrustedPlatformModule> ptrTpm; 3402 TpmType_T enmTpmType = TpmType_None; 3403 3404 hrc = pMachine->COMGETTER(TrustedPlatformModule)(ptrTpm.asOutParam()); H(); 3405 hrc = ptrTpm->COMGETTER(Type)(&enmTpmType); H(); 3406 if (enmTpmType != TpmType_None) 3407 { 3408 InsertConfigNode(pDevices, "tpm", &pDev); 3409 InsertConfigNode(pDev, "0", &pInst); 3410 InsertConfigInteger(pInst, "Trusted", 1); /* boolean */ 3411 InsertConfigNode(pInst, "Config", &pCfg); 3412 InsertConfigNode(pInst, "LUN#0", &pLunL0); 3413 3414 switch (enmTpmType) 3415 { 3416 case TpmType_v1_2: 3417 case TpmType_v2_0: 3418 { 3419 InsertConfigString(pLunL0, "Driver", "TpmEmuTpms"); 3420 InsertConfigNode(pLunL0, "Config", &pCfg); 3421 InsertConfigInteger(pCfg, "TpmVersion", enmTpmType == TpmType_v1_2 ? 1 : 2); 3422 break; 3423 } 3424 case TpmType_Host: 3425 { 3426 #if defined(RT_OS_LINUX) || defined(RT_OS_WINDOWS) 3427 InsertConfigString(pLunL0, "Driver", "TpmHost"); 3428 InsertConfigNode(pLunL0, "Config", &pCfg); 3429 #endif 3430 break; 3431 } 3432 case TpmType_Swtpm: 3433 { 3434 Bstr location; 3435 hrc = ptrTpm->COMGETTER(Location)(location.asOutParam()); H(); 3436 3437 InsertConfigString(pLunL0, "Driver", "TpmEmu"); 3438 InsertConfigNode(pLunL0, "Config", &pCfg); 3439 InsertConfigString(pCfg, "Location", location); 3440 break; 3441 } 3442 default: 3443 AssertFailedBreak(); 3444 } 3445 } 3446 #endif 3447 3397 3448 /* 3398 3449 * ACPI … … 3528 3579 InsertConfigInteger(pCfg, "Parallel1IoPortBase", auParallelIoPortBase[1]); 3529 3580 InsertConfigInteger(pCfg, "Parallel1Irq", auParallelIrq[1]); 3581 3582 #if defined(VBOX_WITH_TPM) 3583 switch (enmTpmType) 3584 { 3585 case TpmType_v1_2: 3586 InsertConfigString(pCfg, "TpmMode", "tis1.2"); 3587 break; 3588 case TpmType_v2_0: 3589 InsertConfigString(pCfg, "TpmMode", "fifo2.0"); 3590 break; 3591 /** @todo Host and swtpm. */ 3592 default: 3593 break; 3594 } 3595 #endif 3530 3596 3531 3597 InsertConfigNode(pInst, "LUN#0", &pLunL0); -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r91130 r91213 1848 1848 } 1849 1849 1850 HRESULT Machine::getTrustedPlatformModule(ComPtr<ITrustedPlatformModule> &aTrustedPlatformModule) 1851 { 1852 /* mTrustedPlatformModule is constant during life time, no need to lock */ 1853 aTrustedPlatformModule = mTrustedPlatformModule; 1854 1855 return S_OK; 1856 } 1857 1850 1858 HRESULT Machine::getRecordingSettings(ComPtr<IRecordingSettings> &aRecordingSettings) 1851 1859 { … … 8163 8171 mBIOSSettings->init(this); 8164 8172 8173 /* create associated trusted platform module object */ 8174 unconst(mTrustedPlatformModule).createObject(); 8175 mTrustedPlatformModule->init(this); 8176 8165 8177 /* create associated record settings object */ 8166 8178 unconst(mRecordingSettings).createObject(); … … 8292 8304 mBIOSSettings->uninit(); 8293 8305 unconst(mBIOSSettings).setNull(); 8306 } 8307 8308 if (mTrustedPlatformModule) 8309 { 8310 mTrustedPlatformModule->uninit(); 8311 unconst(mTrustedPlatformModule).setNull(); 8294 8312 } 8295 8313 … … 8817 8835 /* BIOS */ 8818 8836 rc = mBIOSSettings->i_loadSettings(data.biosSettings); 8837 if (FAILED(rc)) return rc; 8838 8839 /* Trusted Platform Module */ 8840 rc = mTrustedPlatformModule->i_loadSettings(data.tpmSettings); 8819 8841 if (FAILED(rc)) return rc; 8820 8842 … … 10166 10188 if (FAILED(rc)) throw rc; 10167 10189 10190 /* Trusted Platform Module settings (required) */ 10191 rc = mTrustedPlatformModule->i_saveSettings(data.tpmSettings); 10192 if (FAILED(rc)) throw rc; 10193 10168 10194 /* Recording settings (required) */ 10169 10195 rc = mRecordingSettings->i_saveSettings(data.recordingSettings); … … 11680 11706 mBIOSSettings->i_rollback(); 11681 11707 11708 if (mTrustedPlatformModule) 11709 mTrustedPlatformModule->i_rollback(); 11710 11682 11711 if (mRecordingSettings && (mData->flModifications & IsModified_Recording)) 11683 11712 mRecordingSettings->i_rollback(); … … 11805 11834 11806 11835 mBIOSSettings->i_commit(); 11836 mTrustedPlatformModule->i_commit(); 11807 11837 mRecordingSettings->i_commit(); 11808 11838 mGraphicsAdapter->i_commit(); … … 12059 12089 12060 12090 mBIOSSettings->i_copyFrom(aThat->mBIOSSettings); 12091 mTrustedPlatformModule->i_copyFrom(aThat->mTrustedPlatformModule); 12061 12092 mRecordingSettings->i_copyFrom(aThat->mRecordingSettings); 12062 12093 mGraphicsAdapter->i_copyFrom(aThat->mGraphicsAdapter); … … 12434 12465 unconst(mBIOSSettings).createObject(); 12435 12466 mBIOSSettings->init(this, aMachine->mBIOSSettings); 12467 12468 unconst(mTrustedPlatformModule).createObject(); 12469 mTrustedPlatformModule->init(this, aMachine->mTrustedPlatformModule); 12470 12436 12471 unconst(mRecordingSettings).createObject(); 12437 12472 mRecordingSettings->init(this, aMachine->mRecordingSettings); -
trunk/src/VBox/Main/src-server/SnapshotImpl.cpp
r90790 r91213 1147 1147 unconst(mBIOSSettings).createObject(); 1148 1148 rc = mBIOSSettings->initCopy(this, pMachine->mBIOSSettings); 1149 if (FAILED(rc)) return rc; 1150 1151 unconst(mTrustedPlatformModule).createObject(); 1152 rc = mTrustedPlatformModule->initCopy(this, pMachine->mTrustedPlatformModule); 1149 1153 if (FAILED(rc)) return rc; 1150 1154 … … 1278 1282 unconst(mBIOSSettings).createObject(); 1279 1283 mBIOSSettings->init(this); 1284 1285 unconst(mTrustedPlatformModule).createObject(); 1286 mTrustedPlatformModule->init(this); 1280 1287 1281 1288 unconst(mRecordingSettings).createObject(); -
trunk/src/VBox/Main/xml/Settings.cpp
r90828 r91213 2830 2830 * Constructor. Needs to set sane defaults which stand the test of time. 2831 2831 */ 2832 TpmSettings::TpmSettings() : 2833 tpmType(TpmType_None) 2834 { 2835 } 2836 2837 /** 2838 * Check if all settings have default values. 2839 */ 2840 bool TpmSettings::areDefaultSettings() const 2841 { 2842 return tpmType == TpmType_None 2843 && strLocation.isEmpty(); 2844 } 2845 2846 /** 2847 * Comparison operator. This gets called from MachineConfigFile::operator==, 2848 * which in turn gets called from Machine::saveSettings to figure out whether 2849 * machine settings have really changed and thus need to be written out to disk. 2850 */ 2851 bool TpmSettings::operator==(const TpmSettings &g) const 2852 { 2853 return (this == &g) 2854 || ( tpmType == g.tpmType 2855 && strLocation == g.strLocation); 2856 } 2857 2858 /** 2859 * Constructor. Needs to set sane defaults which stand the test of time. 2860 */ 2832 2861 USBController::USBController() : 2833 2862 enmType(USBControllerType_Null) … … 3504 3533 && graphicsAdapter == h.graphicsAdapter 3505 3534 && usbSettings == h.usbSettings 3535 && tpmSettings == h.tpmSettings 3506 3536 && llNetworkAdapters == h.llNetworkAdapters 3507 3537 && llSerialPorts == h.llSerialPorts … … 4924 4954 hw.storage.llStorageControllers.push_back(sctl); 4925 4955 } 4956 } 4957 else if (pelmHwChild->nameEquals("TrustedPlatformModule")) 4958 { 4959 Utf8Str strTpmType; 4960 if (pelmHwChild->getAttributeValue("type", strTpmType)) 4961 { 4962 if (strTpmType == "None") 4963 hw.tpmSettings.tpmType = TpmType_None; 4964 else if (strTpmType == "v1_2") 4965 hw.tpmSettings.tpmType = TpmType_v1_2; 4966 else if (strTpmType == "v2_0") 4967 hw.tpmSettings.tpmType = TpmType_v2_0; 4968 else if (strTpmType == "Host") 4969 hw.tpmSettings.tpmType = TpmType_Host; 4970 else if (strTpmType == "Swtpm") 4971 hw.tpmSettings.tpmType = TpmType_Swtpm; 4972 else 4973 throw ConfigFileError(this, 4974 pelmHwChild, 4975 N_("Invalid value '%s' in TrustedPlatformModule/@type"), 4976 strTpmType.c_str()); 4977 } 4978 4979 pelmHwChild->getAttributeValue("location", hw.tpmSettings.strLocation); 4926 4980 } 4927 4981 else if ( (m->sv <= SettingsVersion_v1_14) … … 6393 6447 if (hw.biosSettings.fSmbiosUuidLittleEndian) 6394 6448 pelmBIOS->createChild("SmbiosUuidLittleEndian")->setAttribute("enabled", hw.biosSettings.fSmbiosUuidLittleEndian); 6449 } 6450 6451 if (!hw.tpmSettings.areDefaultSettings()) 6452 { 6453 xml::ElementNode *pelmTpm = pelmHardware->createChild("TrustedPlatformModule"); 6454 6455 const char *pcszTpm; 6456 switch (hw.tpmSettings.tpmType) 6457 { 6458 default: 6459 case TpmType_None: 6460 pcszTpm = "None"; 6461 break; 6462 case TpmType_v1_2: 6463 pcszTpm = "v1_2"; 6464 break; 6465 case TpmType_v2_0: 6466 pcszTpm = "v2_0"; 6467 break; 6468 case TpmType_Host: 6469 pcszTpm = "Host"; 6470 break; 6471 case TpmType_Swtpm: 6472 pcszTpm = "Swtpm"; 6473 break; 6474 } 6475 pelmTpm->setAttribute("type", pcszTpm); 6476 pelmTpm->setAttribute("location", hw.tpmSettings.strLocation); 6395 6477 } 6396 6478 … … 7687 7769 return; 7688 7770 } 7771 7772 // VirtualBox 6.2 adds a Trusted Platform Module. 7773 if ( hardwareMachine.tpmSettings.tpmType != TpmType_None 7774 || hardwareMachine.tpmSettings.strLocation.isNotEmpty()) 7775 { 7776 m->sv = SettingsVersion_v1_19; 7777 return; 7778 } 7689 7779 } 7690 7780
Note:
See TracChangeset
for help on using the changeset viewer.