Changeset 91326 in vbox
- Timestamp:
- Sep 22, 2021 3:10:38 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/log.h
r91213 r91326 537 537 /** Main group, INetworkAdapter. */ 538 538 LOG_GROUP_MAIN_NETWORKADAPTER, 539 /** Main group, INvramStore. */ 540 LOG_GROUP_MAIN_NVRAMSTORE, 539 541 /** Main group, IParallelPort. */ 540 542 LOG_GROUP_MAIN_PARALLELPORT, … … 1037 1039 "MAIN_NATNETWORK", \ 1038 1040 "MAIN_NETWORKADAPTER", \ 1041 "MAIN_NVRAMSTORE", \ 1039 1042 "MAIN_PARALLELPORT", \ 1040 1043 "MAIN_PCIADDRESS", \ -
trunk/include/VBox/settings.h
r91213 r91326 543 543 int64_t llTimeOffset; 544 544 com::Utf8Str strLogoImagePath; 545 com::Utf8Str strNVRAMPath;546 545 }; 547 546 … … 561 560 TpmType_T tpmType; 562 561 com::Utf8Str strLocation; 562 }; 563 564 /** 565 * NOTE: If you add any fields in here, you must update a) the constructor and b) 566 * the operator== which is used by MachineConfigFile::operator==(), or otherwise 567 * your settings might never get saved. 568 */ 569 struct NvramSettings 570 { 571 NvramSettings(); 572 573 bool areDefaultSettings() const; 574 575 bool operator==(const NvramSettings &d) const; 576 577 com::Utf8Str strNvramPath; 563 578 }; 564 579 … … 1171 1186 1172 1187 BIOSSettings biosSettings; 1188 NvramSettings nvramSettings; 1173 1189 RecordingSettings recordingSettings; 1174 1190 GraphicsAdapter graphicsAdapter; -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
r88086 r91326 877 877 CHECK_ERROR2I_RET(machine, COMGETTER(BIOSSettings)(biosSettings.asOutParam()), hrcCheck); 878 878 879 ComPtr<INvramStore> nvramStore; 880 CHECK_ERROR2I_RET(machine, COMGETTER(NonVolatileStore)(nvramStore.asOutParam()), hrcCheck); 881 879 882 BIOSBootMenuMode_T bootMenuMode; 880 883 CHECK_ERROR2I_RET(biosSettings, COMGETTER(BootMenuMode)(&bootMenuMode), hrcCheck); … … 954 957 SHOW_LONG64_PROP(biosSettings, TimeOffset, "biossystemtimeoffset", "Time offset:", "ms"); 955 958 Bstr bstrNVRAMFile; 956 CHECK_ERROR2I_RET( biosSettings, COMGETTER(NonVolatileStorageFile)(bstrNVRAMFile.asOutParam()), hrcCheck);959 CHECK_ERROR2I_RET(nvramStore, COMGETTER(NonVolatileStorageFile)(bstrNVRAMFile.asOutParam()), hrcCheck); 957 960 if (bstrNVRAMFile.isNotEmpty()) 958 961 SHOW_BSTR_STRING("BIOS NVRAM File", "BIOS NVRAM File:", bstrNVRAMFile); -
trunk/src/VBox/Main/Makefile.kmk
r91312 r91326 552 552 src-all/HashedPw.cpp \ 553 553 src-all/Logging.cpp \ 554 src-all/NvramStoreImpl.cpp \ 554 555 src-all/PCIDeviceAttachmentImpl.cpp \ 555 556 src-all/ProgressImpl.cpp \ … … 1007 1008 src-all/HashedPw.cpp \ 1008 1009 src-all/Logging.cpp \ 1010 src-all/NvramStoreImpl.cpp \ 1009 1011 src-all/PCIDeviceAttachmentImpl.cpp \ 1010 1012 src-all/ProgressImpl.cpp \ -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r91213 r91326 5338 5338 <interface 5339 5339 name="IBIOSSettings" extends="$unknown" 5340 uuid=" 73af4152-7e67-4144-bf34-41c38e8b4cc7"5340 uuid="a0a7f210-b857-4468-be26-c29f36a84345" 5341 5341 wsmap="managed" 5342 5342 reservedMethods="2" reservedAttributes="8" … … 5400 5400 PXE debug logging flag. If set, VirtualBox will write extensive 5401 5401 PXE trace information to the release log. 5402 </desc>5403 </attribute>5404 5405 <attribute name="nonVolatileStorageFile" type="wstring" readonly="yes">5406 <desc>5407 The location of the file storing the non-volatile memory content when5408 the VM is powered off. The file does not always exist.5409 5402 </desc> 5410 5403 </attribute> … … 5890 5883 </interface> 5891 5884 5885 <interface 5886 name="INvramStore" extends="$unknown" 5887 uuid="31283924-604c-44f5-b9d7-ac082531ffb7" 5888 wsmap="managed" 5889 > 5890 5891 <desc> 5892 Provides access to the NVRAM store collecting all permanent states from different sources 5893 (UEFI, TPM, etc.). 5894 </desc> 5895 5896 <attribute name="nonVolatileStorageFile" type="wstring" readonly="yes"> 5897 <desc> 5898 The location of the file storing the non-volatile memory content when 5899 the VM is powered off. The file does not always exist. 5900 </desc> 5901 </attribute> 5902 5903 </interface> 5904 5892 5905 <enum 5893 5906 name="GraphicsControllerType" … … 6067 6080 <interface 6068 6081 name="IMachine" extends="$unknown" 6069 uuid=" 9764b032-9f0f-4b3f-a6a3-e1630c8384bd"6082 uuid="8d2e6ace-0162-4985-9424-37d17fd87657" 6070 6083 wsmap="managed" 6071 6084 wrap-hint-server-addinterfaces="IInternalMachineControl" … … 6328 6341 <attribute name="TrustedPlatformModule" type="ITrustedPlatformModule" readonly="yes"> 6329 6342 <desc>Object containing all TPM settings.</desc> 6343 </attribute> 6344 6345 <attribute name="nonVolatileStore" type="INvramStore" readonly="yes"> 6346 <desc>Object to manipulate data in the non volatile storage file.</desc> 6330 6347 </attribute> 6331 6348 -
trunk/src/VBox/Main/include/BIOSSettingsImpl.h
r90828 r91326 58 58 void i_applyDefaults(GuestOSType *aOsType); 59 59 60 com::Utf8Str i_getNonVolatileStorageFile();61 void i_updateNonVolatileStorageFile(const com::Utf8Str &aNonVolatileStorageFile);62 63 60 private: 64 61 … … 84 81 HRESULT getPXEDebugEnabled(BOOL *enabled); 85 82 HRESULT setPXEDebugEnabled(BOOL enable); 86 HRESULT getNonVolatileStorageFile(com::Utf8Str &aNonVolatileStorageFile);87 83 HRESULT getSMBIOSUuidLittleEndian(BOOL *enabled); 88 84 HRESULT setSMBIOSUuidLittleEndian(BOOL enable); -
trunk/src/VBox/Main/include/ConsoleImpl.h
r91312 r91326 64 64 class VMPowerUpTask; 65 65 class VMPowerDownTask; 66 class NvramStore; 66 67 67 68 #include <iprt/uuid.h> … … 935 936 #endif 936 937 const ComObjPtr<EmulatedUSB> mEmulatedUSB; 938 const ComObjPtr<NvramStore> mptrNvramStore; 937 939 938 940 USBDeviceList mUSBDevices; -
trunk/src/VBox/Main/include/MachineImpl.h
r91213 r91326 42 42 #include "BandwidthGroupImpl.h" 43 43 #include "TrustedPlatformModuleImpl.h" 44 #include "NvramStoreImpl.h" 44 45 #ifdef VBOX_WITH_RESOURCE_USAGE_API 45 46 # include "Performance.h" … … 473 474 enum 474 475 { 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, 476 IsModified_MachineData = 0x000001, 477 IsModified_Storage = 0x000002, 478 IsModified_NetworkAdapters = 0x000008, 479 IsModified_SerialPorts = 0x000010, 480 IsModified_ParallelPorts = 0x000020, 481 IsModified_VRDEServer = 0x000040, 482 IsModified_AudioAdapter = 0x000080, 483 IsModified_USB = 0x000100, 484 IsModified_BIOS = 0x000200, 485 IsModified_SharedFolders = 0x000400, 486 IsModified_Snapshots = 0x000800, 487 IsModified_BandwidthControl = 0x001000, 488 IsModified_Recording = 0x002000, 489 IsModified_GraphicsAdapter = 0x004000, 490 IsModified_TrustedPlatformModule = 0x008000, 491 IsModified_NvramStore = 0x010000, 490 492 }; 491 493 … … 798 800 799 801 const ComObjPtr<TrustedPlatformModule> mTrustedPlatformModule; 802 const ComObjPtr<NvramStore> mNvramStore; 800 803 801 804 typedef std::vector<ComObjPtr<NetworkAdapter> > NetworkAdapterVector; … … 891 894 HRESULT getBIOSSettings(ComPtr<IBIOSSettings> &aBIOSSettings); 892 895 HRESULT getTrustedPlatformModule(ComPtr<ITrustedPlatformModule> &aTrustedPlatformModule); 896 HRESULT getNonVolatileStore(ComPtr<INvramStore> &aNvramStore); 893 897 HRESULT getRecordingSettings(ComPtr<IRecordingSettings> &aRecordingSettings); 894 898 HRESULT getFirmwareType(FirmwareType_T *aFirmwareType); -
trunk/src/VBox/Main/src-client/ConsoleImpl.cpp
r90828 r91326 77 77 #include "PCIDeviceAttachmentImpl.h" 78 78 #include "EmulatedUSBImpl.h" 79 #include "NvramStoreImpl.h" 79 80 80 81 #include "VBoxEvents.h" … … 547 548 AssertComRCReturnRC(rc); 548 549 550 /* Init the NVRAM store. */ 551 ComPtr<INvramStore> pNvramStore; 552 rc = aMachine->COMGETTER(NonVolatileStore)(pNvramStore.asOutParam()); 553 AssertComRCReturnRC(rc); 554 555 Bstr strNonVolatilePath; 556 pNvramStore->COMGETTER(NonVolatileStorageFile)(strNonVolatilePath.asOutParam()); 557 558 unconst(mptrNvramStore).createObject(); 559 rc = mptrNvramStore->init(this, strNonVolatilePath); 560 AssertComRCReturnRC(rc); 561 549 562 /* Grab global and machine shared folder lists */ 550 563 … … 803 816 delete mConsoleVRDPServer; 804 817 unconst(mConsoleVRDPServer) = NULL; 818 } 819 820 if (mptrNvramStore) 821 { 822 mptrNvramStore->uninit(); 823 unconst(mptrNvramStore).setNull(); 805 824 } 806 825 … … 10749 10768 } 10750 10769 10770 if (UuidCopy == COM_IIDOF(INvramStore)) 10771 { 10772 NvramStore *pNvramStore = static_cast<NvramStore *>(pConsole->mptrNvramStore); 10773 return pNvramStore; 10774 } 10775 10751 10776 if (UuidCopy == VMMDEV_OID) 10752 10777 return pConsole->m_pVMMDev; -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r91213 r91326 36 36 #include "ConsoleImpl.h" 37 37 #include "DisplayImpl.h" 38 #include "NvramStoreImpl.h" 38 39 #ifdef VBOX_WITH_DRAG_AND_DROP 39 40 # include "GuestImpl.h" … … 808 809 ComPtr<IBIOSSettings> biosSettings; 809 810 hrc = pMachine->COMGETTER(BIOSSettings)(biosSettings.asOutParam()); H(); 811 812 ComPtr<INvramStore> nvramStore; 813 hrc = pMachine->COMGETTER(NonVolatileStore)(nvramStore.asOutParam()); H(); 810 814 811 815 hrc = pMachine->COMGETTER(HardwareUUID)(bstr.asOutParam()); H(); … … 1934 1938 1935 1939 /* Get NVRAM file name */ 1936 Bstr bstrNVRAM; 1937 hrc = biosSettings->COMGETTER(NonVolatileStorageFile)(bstrNVRAM.asOutParam()); H(); 1940 Utf8Str strNvram = mptrNvramStore->i_getNonVolatileStorageFile(); 1938 1941 1939 1942 BOOL fUuidLe; … … 2004 2007 InsertConfigInteger(pCfg, "UuidLe", fUuidLe); 2005 2008 InsertConfigInteger(pCfg, "64BitEntry", f64BitEntry); /* boolean */ 2006 InsertConfigString(pCfg, "NvramFile", bstrNVRAM);2009 InsertConfigString(pCfg, "NvramFile", strNvram); 2007 2010 if (u32GraphicsMode != UINT32_MAX) 2008 2011 InsertConfigInteger(pCfg, "GraphicsMode", u32GraphicsMode); … … 2016 2019 InsertConfigInteger(pCfg, "DmiExposeMemoryTable", 1); 2017 2020 } 2021 2022 /* Attach the NVRAM storage driver. */ 2023 InsertConfigNode(pInst, "LUN#0", &pLunL0); 2024 InsertConfigString(pLunL0, "Driver", "NvramStore"); 2018 2025 } 2019 2026 … … 3420 3427 InsertConfigNode(pLunL0, "Config", &pCfg); 3421 3428 InsertConfigInteger(pCfg, "TpmVersion", enmTpmType == TpmType_v1_2 ? 1 : 2); 3429 InsertConfigNode(pLunL0, "AttachedDriver", &pLunL1); 3430 InsertConfigString(pLunL1, "Driver", "NvramStore"); 3422 3431 break; 3423 3432 } -
trunk/src/VBox/Main/src-client/VBoxDriversRegister.cpp
r82968 r91326 28 28 #include "DisplayImpl.h" 29 29 #include "VMMDev.h" 30 #include "NvramStoreImpl.h" 30 31 #ifdef VBOX_WITH_AUDIO_VRDE 31 32 # include "DrvAudioVRDE.h" … … 105 106 #endif 106 107 108 rc = pCallbacks->pfnRegister(pCallbacks, &NvramStore::DrvReg); 109 if (RT_FAILURE(rc)) 110 return rc; 111 107 112 return VINF_SUCCESS; 108 113 } -
trunk/src/VBox/Main/src-server/BIOSSettingsImpl.cpp
r82968 r91326 153 153 m->bd.attachCopy(that->m->bd); 154 154 155 // Intentionally "forget" the NVRAM file since it must be unique and set156 // to the correct value before the copy of the settings makes sense.157 m->bd->strNVRAMPath.setNull();158 159 155 autoInitSpan.setSucceeded(); 160 156 … … 466 462 AutoWriteLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS); // mParent is const, needs no locking 467 463 m->pMachine->i_setModified(Machine::IsModified_BIOS); 468 469 return S_OK;470 }471 472 473 HRESULT BIOSSettings::getNonVolatileStorageFile(com::Utf8Str &aNonVolatileStorageFile)474 {475 Utf8Str strTmp;476 {477 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);478 strTmp = m->bd->strNVRAMPath;479 }480 481 AutoReadLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS);482 if (strTmp.isEmpty())483 strTmp = m->pMachine->i_getDefaultNVRAMFilename();484 if (strTmp.isNotEmpty())485 m->pMachine->i_calculateFullPath(strTmp, aNonVolatileStorageFile);486 464 487 465 return S_OK; … … 541 519 // simply copy 542 520 m->bd.assignCopy(&data); 543 544 Utf8Str strTmp(m->bd->strNVRAMPath);545 if (strTmp.isNotEmpty())546 m->pMachine->i_copyPathRelativeToMachine(strTmp, m->bd->strNVRAMPath);547 if ( m->pMachine->i_getFirmwareType() == FirmwareType_BIOS548 || m->bd->strNVRAMPath == m->pMachine->i_getDefaultNVRAMFilename())549 m->bd->strNVRAMPath.setNull();550 551 521 return S_OK; 552 522 } … … 622 592 /* this will back up current data */ 623 593 m->bd.assignCopy(aThat->m->bd); 624 625 // Intentionally "forget" the NVRAM file since it must be unique and set626 // to the correct value before the copy of the settings makes sense.627 m->bd->strNVRAMPath.setNull();628 629 594 } 630 595 … … 644 609 } 645 610 646 Utf8Str BIOSSettings::i_getNonVolatileStorageFile()647 {648 AutoCaller autoCaller(this);649 AssertComRCReturn(autoCaller.rc(), Utf8Str::Empty);650 651 Utf8Str strTmp;652 BIOSSettings::getNonVolatileStorageFile(strTmp);653 return strTmp;654 }655 656 void BIOSSettings::i_updateNonVolatileStorageFile(const Utf8Str &aNonVolatileStorageFile)657 {658 /* sanity */659 AutoCaller autoCaller(this);660 AssertComRCReturnVoid(autoCaller.rc());661 662 AutoReadLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS);663 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);664 665 Utf8Str strTmp(aNonVolatileStorageFile);666 if (strTmp == m->pMachine->i_getDefaultNVRAMFilename())667 strTmp.setNull();668 669 if (strTmp == m->bd->strNVRAMPath)670 return;671 672 m->bd.backup();673 m->bd->strNVRAMPath = strTmp;674 }675 676 611 /* vi: set tabstop=4 shiftwidth=4 expandtab: */ -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r91213 r91326 1145 1145 alock.release(); 1146 1146 1147 m BIOSSettings->i_updateNonVolatileStorageFile(strNVRAM);1147 mNvramStore->i_updateNonVolatileStorageFile(strNVRAM); 1148 1148 1149 1149 return S_OK; … … 1856 1856 } 1857 1857 1858 HRESULT Machine::getNonVolatileStore(ComPtr<INvramStore> &aNvramStore) 1859 { 1860 /* mNvramStore is constant during life time, no need to lock */ 1861 aNvramStore = mNvramStore; 1862 1863 return S_OK; 1864 } 1865 1858 1866 HRESULT Machine::getRecordingSettings(ComPtr<IRecordingSettings> &aRecordingSettings) 1859 1867 { … … 4942 4950 mData->llFilesToDelete.push_back(mSSData->strStateFilePath); 4943 4951 4944 Utf8Str strNVRAMFile = m BIOSSettings->i_getNonVolatileStorageFile();4952 Utf8Str strNVRAMFile = mNvramStore->i_getNonVolatileStorageFile(); 4945 4953 if (!strNVRAMFile.isEmpty() && RTFileExists(strNVRAMFile.c_str())) 4946 4954 mData->llFilesToDelete.push_back(strNVRAMFile); … … 8175 8183 mTrustedPlatformModule->init(this); 8176 8184 8185 /* create associated NVRAM store object */ 8186 unconst(mNvramStore).createObject(); 8187 mNvramStore->init(this); 8188 8177 8189 /* create associated record settings object */ 8178 8190 unconst(mRecordingSettings).createObject(); … … 8310 8322 mTrustedPlatformModule->uninit(); 8311 8323 unconst(mTrustedPlatformModule).setNull(); 8324 } 8325 8326 if (mNvramStore) 8327 { 8328 mNvramStore->uninit(); 8329 unconst(mNvramStore).setNull(); 8312 8330 } 8313 8331 … … 8839 8857 /* Trusted Platform Module */ 8840 8858 rc = mTrustedPlatformModule->i_loadSettings(data.tpmSettings); 8859 if (FAILED(rc)) return rc; 8860 8861 rc = mNvramStore->i_loadSettings(data.nvramSettings); 8841 8862 if (FAILED(rc)) return rc; 8842 8863 … … 9698 9719 newConfigFilePrev += "-prev"; 9699 9720 RTFileRename(configFilePrev.c_str(), newConfigFilePrev.c_str(), 0); 9700 NVRAMFile = m BIOSSettings->i_getNonVolatileStorageFile();9721 NVRAMFile = mNvramStore->i_getNonVolatileStorageFile(); 9701 9722 if (NVRAMFile.isNotEmpty()) 9702 9723 { … … 9738 9759 } 9739 9760 if (newNVRAMFile.isNotEmpty()) 9740 m BIOSSettings->i_updateNonVolatileStorageFile(newNVRAMFile);9761 mNvramStore->i_updateNonVolatileStorageFile(newNVRAMFile); 9741 9762 9742 9763 // and do the same thing for the saved state file paths of all the online snapshots and NVRAM files of all snapshots … … 10190 10211 /* Trusted Platform Module settings (required) */ 10191 10212 rc = mTrustedPlatformModule->i_saveSettings(data.tpmSettings); 10213 if (FAILED(rc)) throw rc; 10214 10215 /* NVRAM settings (required) */ 10216 rc = mNvramStore->i_saveSettings(data.nvramSettings); 10192 10217 if (FAILED(rc)) throw rc; 10193 10218 … … 11709 11734 mTrustedPlatformModule->i_rollback(); 11710 11735 11736 if (mNvramStore) 11737 mNvramStore->i_rollback(); 11738 11711 11739 if (mRecordingSettings && (mData->flModifications & IsModified_Recording)) 11712 11740 mRecordingSettings->i_rollback(); … … 11835 11863 mBIOSSettings->i_commit(); 11836 11864 mTrustedPlatformModule->i_commit(); 11865 mNvramStore->i_commit(); 11837 11866 mRecordingSettings->i_commit(); 11838 11867 mGraphicsAdapter->i_commit(); … … 12090 12119 mBIOSSettings->i_copyFrom(aThat->mBIOSSettings); 12091 12120 mTrustedPlatformModule->i_copyFrom(aThat->mTrustedPlatformModule); 12121 mNvramStore->i_copyFrom(aThat->mNvramStore); 12092 12122 mRecordingSettings->i_copyFrom(aThat->mRecordingSettings); 12093 12123 mGraphicsAdapter->i_copyFrom(aThat->mGraphicsAdapter); … … 12469 12499 mTrustedPlatformModule->init(this, aMachine->mTrustedPlatformModule); 12470 12500 12501 unconst(mNvramStore).createObject(); 12502 mNvramStore->init(this, aMachine->mNvramStore); 12503 12471 12504 unconst(mRecordingSettings).createObject(); 12472 12505 mRecordingSettings->init(this, aMachine->mRecordingSettings); -
trunk/src/VBox/Main/src-server/MachineImplCloneVM.cpp
r91312 r91326 244 244 { 245 245 Bstr bstrSrcNVRAMPath; 246 ComPtr<I BIOSSettings> pBIOSSettings;247 HRESULT rc = machine->COMGETTER( BIOSSettings)(pBIOSSettings.asOutParam());246 ComPtr<INvramStore> pNvramStore; 247 HRESULT rc = machine->COMGETTER(NonVolatileStore)(pNvramStore.asOutParam()); 248 248 if (FAILED(rc)) return rc; 249 rc = p BIOSSettings->COMGETTER(NonVolatileStorageFile)(bstrSrcNVRAMPath.asOutParam());249 rc = pNvramStore->COMGETTER(NonVolatileStorageFile)(bstrSrcNVRAMPath.asOutParam()); 250 250 if (FAILED(rc)) return rc; 251 251 if (!bstrSrcNVRAMPath.isEmpty()) … … 755 755 { 756 756 if (it->uuid == id) 757 it->hardware. biosSettings.strNVRAMPath = strFile;757 it->hardware.nvramSettings.strNvramPath = strFile; 758 758 else if (!it->llChildSnapshots.empty()) 759 759 updateNVRAMFile(it->llChildSnapshots, id, strFile); … … 1555 1555 * machine state or the snapshots. */ 1556 1556 if (!fct.snapshotUuid.isValid() || fct.snapshotUuid.isZero()) 1557 trgMCF.hardwareMachine. biosSettings.strNVRAMPath = strTrgNVRAM;1557 trgMCF.hardwareMachine.nvramSettings.strNvramPath = strTrgNVRAM; 1558 1558 else 1559 1559 d->updateNVRAMFile(trgMCF.llFirstSnapshot, fct.snapshotUuid, strTrgNVRAM); -
trunk/src/VBox/Main/src-server/MachineImplMoveVM.cpp
r90828 r91326 1262 1262 pSnapshot->i_updateNVRAMPaths(sourcePath.c_str(), 1263 1263 targetPath.c_str()); 1264 ComObjPtr< BIOSSettings> pBIOSSettings(m_pMachine->mBIOSSettings);1265 const Utf8Str NVRAMFile(p BIOSSettings->i_getNonVolatileStorageFile());1264 ComObjPtr<NvramStore> pNvramStore(m_pMachine->mNvramStore); 1265 const Utf8Str NVRAMFile(pNvramStore->i_getNonVolatileStorageFile()); 1266 1266 if (NVRAMFile.isNotEmpty()) 1267 1267 { … … 1271 1271 else 1272 1272 newNVRAMFile = Utf8StrFmt("%s%c%s", targetPath.c_str(), RTPATH_DELIMITER, RTPathFilename(newNVRAMFile.c_str())); 1273 p BIOSSettings->i_updateNonVolatileStorageFile(newNVRAMFile);1273 pNvramStore->i_updateNonVolatileStorageFile(newNVRAMFile); 1274 1274 } 1275 1275 } … … 1583 1583 HRESULT MachineMoveVM::addNVRAM(const ComObjPtr<Machine> &machine) 1584 1584 { 1585 ComPtr<I BIOSSettings> pBIOSSettings;1586 HRESULT rc = machine->COMGETTER( BIOSSettings)(pBIOSSettings.asOutParam());1585 ComPtr<INvramStore> pNvramStore; 1586 HRESULT rc = machine->COMGETTER(NonVolatileStore)(pNvramStore.asOutParam()); 1587 1587 if (FAILED(rc)) return rc; 1588 1588 Bstr bstrSrcNVRAMPath; 1589 rc = p BIOSSettings->COMGETTER(NonVolatileStorageFile)(bstrSrcNVRAMPath.asOutParam());1589 rc = pNvramStore->COMGETTER(NonVolatileStorageFile)(bstrSrcNVRAMPath.asOutParam()); 1590 1590 if (FAILED(rc)) return rc; 1591 1591 Utf8Str strSrcNVRAMPath(bstrSrcNVRAMPath); -
trunk/src/VBox/Main/src-server/SnapshotImpl.cpp
r91213 r91326 749 749 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 750 750 751 const Utf8Str path = m->pMachine->m BIOSSettings->i_getNonVolatileStorageFile();751 const Utf8Str path = m->pMachine->mNvramStore->i_getNonVolatileStorageFile(); 752 752 LogFlowThisFunc(("Snap[%s].nvramPath={%s}\n", m->strName.c_str(), path.c_str())); 753 753 … … 757 757 ) 758 758 { 759 m->pMachine->m BIOSSettings->i_updateNonVolatileStorageFile(Utf8StrFmt("%s%s",759 m->pMachine->mNvramStore->i_updateNonVolatileStorageFile(Utf8StrFmt("%s%s", 760 760 strNewPath.c_str(), 761 761 path.c_str() + strOldPath.length())); 762 LogFlowThisFunc(("-> updated: {%s}\n", m->pMachine->m BIOSSettings->i_getNonVolatileStorageFile().c_str()));762 LogFlowThisFunc(("-> updated: {%s}\n", m->pMachine->mNvramStore->i_getNonVolatileStorageFile().c_str())); 763 763 } 764 764 … … 921 921 } 922 922 923 Utf8Str strNVRAMFile = m->pMachine->m BIOSSettings->i_getNonVolatileStorageFile();923 Utf8Str strNVRAMFile = m->pMachine->mNvramStore->i_getNonVolatileStorageFile(); 924 924 if (strNVRAMFile.isNotEmpty() && RTFileExists(strNVRAMFile.c_str())) 925 925 llFilenames.push_back(strNVRAMFile); … … 1151 1151 unconst(mTrustedPlatformModule).createObject(); 1152 1152 rc = mTrustedPlatformModule->initCopy(this, pMachine->mTrustedPlatformModule); 1153 if (FAILED(rc)) return rc; 1154 1155 unconst(mNvramStore).createObject(); 1156 rc = mNvramStore->initCopy(this, pMachine->mNvramStore); 1153 1157 if (FAILED(rc)) return rc; 1154 1158 … … 1285 1289 unconst(mTrustedPlatformModule).createObject(); 1286 1290 mTrustedPlatformModule->init(this); 1291 1292 unconst(mNvramStore).createObject(); 1293 mNvramStore->init(this); 1287 1294 1288 1295 unconst(mRecordingSettings).createObject(); … … 1867 1874 1868 1875 // Handle NVRAM file snapshotting 1869 Utf8Str strNVRAM = m BIOSSettings->i_getNonVolatileStorageFile();1876 Utf8Str strNVRAM = mNvramStore->i_getNonVolatileStorageFile(); 1870 1877 Utf8Str strNVRAMSnap = pSnapshotMachine->i_getSnapshotNVRAMFilename(); 1871 1878 if (strNVRAM.isNotEmpty() && strNVRAMSnap.isNotEmpty() && RTFileExists(strNVRAM.c_str())) … … 1881 1888 tr("Could not copy NVRAM file '%s' to '%s' (%Rrc)"), 1882 1889 strNVRAM.c_str(), strNVRAMSnapAbs.c_str(), vrc); 1883 pSnapshotMachine->m BIOSSettings->i_updateNonVolatileStorageFile(strNVRAMSnap);1890 pSnapshotMachine->mNvramStore->i_updateNonVolatileStorageFile(strNVRAMSnap); 1884 1891 } 1885 1892 … … 2376 2383 mSSData->strStateFilePath = strSnapshotStateFile; 2377 2384 2378 const Utf8Str srcNVRAM(pSnapshotMachine->m BIOSSettings->i_getNonVolatileStorageFile());2379 const Utf8Str dstNVRAM(m BIOSSettings->i_getNonVolatileStorageFile());2385 const Utf8Str srcNVRAM(pSnapshotMachine->mNvramStore->i_getNonVolatileStorageFile()); 2386 const Utf8Str dstNVRAM(mNvramStore->i_getNonVolatileStorageFile()); 2380 2387 if (dstNVRAM.isNotEmpty() && RTFileExists(dstNVRAM.c_str())) 2381 2388 RTFileDelete(dstNVRAM.c_str()); … … 3500 3507 /* 3a: delete NVRAM file if present. */ 3501 3508 { 3502 Utf8Str NVRAMPath = pSnapMachine->m BIOSSettings->i_getNonVolatileStorageFile();3509 Utf8Str NVRAMPath = pSnapMachine->mNvramStore->i_getNonVolatileStorageFile(); 3503 3510 if (NVRAMPath.isNotEmpty() && RTFileExists(NVRAMPath.c_str())) 3504 3511 RTFileDelete(NVRAMPath.c_str()); -
trunk/src/VBox/Main/xml/Settings.cpp
r91213 r91326 2584 2584 && apicMode == APICMode_APIC 2585 2585 && llTimeOffset == 0 2586 && strLogoImagePath.isEmpty() 2587 && strNVRAMPath.isEmpty(); 2586 && strLogoImagePath.isEmpty(); 2588 2587 } 2589 2588 … … 2606 2605 && apicMode == d.apicMode 2607 2606 && llTimeOffset == d.llTimeOffset 2608 && strLogoImagePath == d.strLogoImagePath 2609 && strNVRAMPath == d.strNVRAMPath); 2607 && strLogoImagePath == d.strLogoImagePath); 2610 2608 } 2611 2609 … … 2855 2853 && strLocation == g.strLocation); 2856 2854 } 2855 2856 /** 2857 * Constructor. Needs to set sane defaults which stand the test of time. 2858 */ 2859 NvramSettings::NvramSettings() 2860 { 2861 } 2862 2863 /** 2864 * Check if all settings have default values. 2865 */ 2866 bool NvramSettings::areDefaultSettings() const 2867 { 2868 return strNvramPath.isEmpty(); 2869 } 2870 2871 /** 2872 * Comparison operator. This gets called from MachineConfigFile::operator==, 2873 * which in turn gets called from Machine::saveSettings to figure out whether 2874 * machine settings have really changed and thus need to be written out to disk. 2875 */ 2876 bool NvramSettings::operator==(const NvramSettings &g) const 2877 { 2878 return (this == &g) 2879 || (strNvramPath == g.strNvramPath); 2880 } 2881 2857 2882 2858 2883 /** … … 3531 3556 && vrdeSettings == h.vrdeSettings 3532 3557 && biosSettings == h.biosSettings 3558 && nvramSettings == h.nvramSettings 3533 3559 && graphicsAdapter == h.graphicsAdapter 3534 3560 && usbSettings == h.usbSettings … … 4924 4950 pelmBIOSChild->getAttributeValue("value", hw.biosSettings.llTimeOffset); 4925 4951 if ((pelmBIOSChild = pelmHwChild->findChildElement("NVRAM"))) 4926 pelmBIOSChild->getAttributeValue("path", hw. biosSettings.strNVRAMPath);4952 pelmBIOSChild->getAttributeValue("path", hw.nvramSettings.strNvramPath); 4927 4953 if ((pelmBIOSChild = pelmHwChild->findChildElement("SmbiosUuidLittleEndian"))) 4928 4954 pelmBIOSChild->getAttributeValue("enabled", hw.biosSettings.fSmbiosUuidLittleEndian); … … 6443 6469 if (hw.biosSettings.fPXEDebugEnabled) 6444 6470 pelmBIOS->createChild("PXEDebug")->setAttribute("enabled", hw.biosSettings.fPXEDebugEnabled); 6445 if (!hw. biosSettings.strNVRAMPath.isEmpty())6446 pelmBIOS->createChild("NVRAM")->setAttribute("path", hw. biosSettings.strNVRAMPath);6471 if (!hw.nvramSettings.strNvramPath.isEmpty()) 6472 pelmBIOS->createChild("NVRAM")->setAttribute("path", hw.nvramSettings.strNvramPath); 6447 6473 if (hw.biosSettings.fSmbiosUuidLittleEndian) 6448 6474 pelmBIOS->createChild("SmbiosUuidLittleEndian")->setAttribute("enabled", hw.biosSettings.fSmbiosUuidLittleEndian); … … 7781 7807 if (m->sv < SettingsVersion_v1_18) 7782 7808 { 7783 if (!hardwareMachine. biosSettings.strNVRAMPath.isEmpty())7809 if (!hardwareMachine.nvramSettings.strNvramPath.isEmpty()) 7784 7810 { 7785 7811 m->sv = SettingsVersion_v1_18;
Note:
See TracChangeset
for help on using the changeset viewer.