Changeset 81299 in vbox
- Timestamp:
- Oct 16, 2019 7:32:48 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/VBox/settings.h
r81286 r81299 506 506 fLogoFadeIn, 507 507 fLogoFadeOut, 508 fPXEDebugEnabled, 509 fNVRAMEnabled; 508 fPXEDebugEnabled; 510 509 uint32_t ulLogoDisplayTime; 511 510 BIOSBootMenuMode_T biosBootMenuMode; -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp
r81087 r81299 870 870 871 871 SHOW_LONG64_PROP(biosSettings, TimeOffset, "biossystemtimeoffset", "Time offset:", "ms"); 872 SHOW_BOOLEAN_PROP(biosSettings, NonVolatileStorageEnabled, "biosnvram", "BIOS NVRAM:");873 872 Bstr bstrNVRAMFile; 874 873 CHECK_ERROR2I_RET(biosSettings, COMGETTER(NonVolatileStorageFile)(bstrNVRAMFile.asOutParam()), hrcCheck); -
trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp
r81289 r81299 107 107 MODIFYVM_BIOSSYSTEMTIMEOFFSET, 108 108 MODIFYVM_BIOSPXEDEBUG, 109 MODIFYVM_BIOSNVRAM,110 109 MODIFYVM_BOOT, 111 110 MODIFYVM_HDA, // deprecated … … 301 300 { "--biosapic", MODIFYVM_BIOSAPIC, RTGETOPT_REQ_STRING }, 302 301 { "--biospxedebug", MODIFYVM_BIOSPXEDEBUG, RTGETOPT_REQ_BOOL_ONOFF }, 303 { "--biosnvram", MODIFYVM_BIOSNVRAM, RTGETOPT_REQ_BOOL_ONOFF },304 302 { "--boot", MODIFYVM_BOOT, RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX }, 305 303 { "--hda", MODIFYVM_HDA, RTGETOPT_REQ_STRING }, … … 1016 1014 } 1017 1015 1018 case MODIFYVM_BIOSNVRAM:1019 {1020 CHECK_ERROR(biosSettings, COMSETTER(NonVolatileStorageEnabled)(ValueUnion.f));1021 break;1022 }1023 1024 1016 case MODIFYVM_BOOT: 1025 1017 { -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r81286 r81299 5197 5197 <interface 5198 5198 name="IBIOSSettings" extends="$unknown" 5199 uuid=" f13f667d-3624-4ac5-99c1-3d982ebd8d98"5199 uuid="73af4152-7e67-4144-bf34-41c38e8b4cc7" 5200 5200 wsmap="managed" 5201 5201 reservedMethods="1" reservedAttributes="8" … … 5262 5262 </attribute> 5263 5263 5264 <attribute name="nonVolatileStorageEnabled" type="boolean">5265 <desc>5266 Controls the non-volatile memory device presence. If set, VirtualBox5267 will store the content in a file whose path can be queried with the5268 <link to="#nonVolatileStorageFile"/> attribute.5269 </desc>5270 </attribute>5271 5272 5264 <attribute name="nonVolatileStorageFile" type="wstring" readonly="yes"> 5273 5265 <desc> 5274 5266 The location of the file storing the non-volatile memory content when 5275 5267 the VM is powered off. The file does not always exist. 5276 5277 This feature will be realized after VirtualBox v4.3.0.5278 5268 </desc> 5279 5269 </attribute> -
trunk/src/VBox/Main/include/BIOSSettingsImpl.h
r81087 r81299 58 58 void i_applyDefaults(GuestOSType *aOsType); 59 59 60 void i_updateNonVolatileStorageFile(const com::Utf8Str &aNonVolatileStorageFile); 61 60 62 private: 61 63 … … 81 83 HRESULT getPXEDebugEnabled(BOOL *enabled); 82 84 HRESULT setPXEDebugEnabled(BOOL enable); 83 HRESULT getNonVolatileStorageEnabled(BOOL *enabled);84 HRESULT setNonVolatileStorageEnabled(BOOL enable);85 85 HRESULT getNonVolatileStorageFile(com::Utf8Str &aNonVolatileStorageFile); 86 86 -
trunk/src/VBox/Main/include/MachineImpl.h
r81286 r81299 498 498 Utf8Str i_getOSTypeId() const { return mUserData->s.strOsType; } 499 499 ChipsetType_T i_getChipsetType() const { return mHWData->mChipsetType; } 500 FirmwareType_T i_getFirmwareType() const { return mHWData->mFirmwareType; } 500 501 ULONG i_getMonitorCount() const { return mHWData->mMonitorCount; } 501 502 ParavirtProvider_T i_getParavirtProvider() const { return mHWData->mParavirtProvider; } -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r81087 r81299 1750 1750 GetExtraDataBoth(virtualBox, pMachine, "VBoxInternal2/EfiDeviceProps", &deviceProps); 1751 1751 1752 /* Get NVRAM file name */ 1753 Bstr bstrNVRAM; 1754 hrc = biosSettings->COMGETTER(NonVolatileStorageFile)(bstrNVRAM.asOutParam()); H(); 1755 1752 1756 /* Get graphics mode settings */ 1753 1757 uint32_t u32GraphicsMode = UINT32_MAX; … … 1813 1817 InsertConfigBytes(pCfg, "UUID", &HardwareUuid,sizeof(HardwareUuid)); 1814 1818 InsertConfigInteger(pCfg, "64BitEntry", f64BitEntry); /* boolean */ 1819 InsertConfigString(pCfg, "NvramFile", bstrNVRAM); 1815 1820 if (u32GraphicsMode != UINT32_MAX) 1816 1821 InsertConfigInteger(pCfg, "GraphicsMode", u32GraphicsMode); … … 1831 1836 InsertConfigInteger(pCfg, "PermanentSave", 1); 1832 1837 #endif 1833 1834 BOOL fNVRAM = FALSE;1835 hrc = biosSettings->COMGETTER(NonVolatileStorageEnabled)(&fNVRAM); H();1836 if (fNVRAM)1837 {1838 hrc = biosSettings->COMGETTER(NonVolatileStorageFile)(bstr.asOutParam()); H();1839 1840 /*1841 * NVRAM device subtree.1842 */1843 InsertConfigNode(pDevices, "flash", &pDev);1844 InsertConfigNode(pDev, "0", &pInst);1845 InsertConfigNode(pInst, "Config", &pCfg);1846 InsertConfigString(pCfg, "FlashFile", bstr);1847 }1848 1838 } 1849 1839 -
trunk/src/VBox/Main/src-server/BIOSSettingsImpl.cpp
r81222 r81299 467 467 468 468 469 HRESULT BIOSSettings::getNonVolatileStorageEnabled(BOOL *enabled)470 {471 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS);472 473 *enabled = m->bd->fNVRAMEnabled;474 475 return S_OK;476 }477 478 HRESULT BIOSSettings::setNonVolatileStorageEnabled(BOOL enable)479 {480 /* the machine needs to be mutable */481 AutoMutableStateDependency adep(m->pMachine);482 if (FAILED(adep.rc())) return adep.rc();483 484 AutoCaller autoMachineCaller(m->pMachine);485 AssertComRCReturnRC(autoMachineCaller.rc());486 487 {488 AutoReadLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS);489 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);490 491 m->bd.backup();492 m->bd->fNVRAMEnabled = RT_BOOL(enable);493 if (enable && m->bd->strNVRAMPath.isEmpty())494 m->bd->strNVRAMPath = m->pMachine->i_getDefaultNVRAMFilename();495 }496 497 AutoWriteLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS); // mParent is const, needs no locking498 m->pMachine->i_setModified(Machine::IsModified_BIOS);499 500 return S_OK;501 }502 503 504 469 HRESULT BIOSSettings::getNonVolatileStorageFile(com::Utf8Str &aNonVolatileStorageFile) 505 470 { … … 510 475 } 511 476 477 AutoReadLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS); 478 if (strTmp.isEmpty()) 479 strTmp = m->pMachine->i_getDefaultNVRAMFilename(); 512 480 if (strTmp.isNotEmpty()) 513 481 m->pMachine->i_calculateFullPath(strTmp, aNonVolatileStorageFile); … … 544 512 545 513 Utf8Str strTmp(m->bd->strNVRAMPath); 546 m->pMachine->i_copyPathRelativeToMachine(strTmp, m->bd->strNVRAMPath); 514 if (strTmp.isNotEmpty()) 515 m->pMachine->i_copyPathRelativeToMachine(strTmp, m->bd->strNVRAMPath); 516 if ( m->pMachine->i_getFirmwareType() == FirmwareType_BIOS 517 || m->bd->strNVRAMPath == m->pMachine->i_getDefaultNVRAMFilename()) 518 m->bd->strNVRAMPath.setNull(); 547 519 548 520 return S_OK; … … 636 608 } 637 609 610 void BIOSSettings::i_updateNonVolatileStorageFile(const Utf8Str &aNonVolatileStorageFile) 611 { 612 /* sanity */ 613 AutoCaller autoCaller(this); 614 AssertComRCReturnVoid(autoCaller.rc()); 615 616 AutoReadLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS); 617 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 618 619 Utf8Str strTmp(aNonVolatileStorageFile); 620 if (strTmp == m->pMachine->i_getDefaultNVRAMFilename()) 621 strTmp.setNull(); 622 623 if (strTmp == m->bd->strNVRAMPath) 624 return; 625 626 m->bd.backup(); 627 m->bd->strNVRAMPath = strTmp; 628 } 629 638 630 /* vi: set tabstop=4 shiftwidth=4 expandtab: */ -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r81286 r81299 1145 1145 mHWData.backup(); 1146 1146 mHWData->mFirmwareType = aFirmwareType; 1147 Utf8Str strNVRAM = i_getDefaultNVRAMFilename(); 1148 alock.release(); 1149 1150 mBIOSSettings->i_updateNonVolatileStorageFile(strNVRAM); 1147 1151 1148 1152 return S_OK; … … 7353 7357 * it is part of the current state. Taking a snapshot will use a similar naming 7354 7358 * as for saved state, because these are actually read-only, retaining a 7355 * a specific state just like saved state. 7359 * a specific state just like saved state. Note that this is a relative path. 7356 7360 */ 7357 7361 … … 7362 7366 7363 7367 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 7364 Utf8Str strNVRAMFilePathAbs = mData->m_strConfigFileFull; 7365 strNVRAMFilePathAbs.stripSuffix(); 7366 strNVRAMFilePathAbs += ".nvram"; 7367 Utf8Str strNVRAMFilePath; 7368 i_copyPathRelativeToMachine(strNVRAMFilePathAbs, strNVRAMFilePath); 7368 7369 if (mHWData->mFirmwareType == FirmwareType_BIOS) 7370 return Utf8Str::Empty; 7371 7372 Utf8Str strNVRAMFilePath = mData->m_strConfigFileFull; 7373 strNVRAMFilePath.stripPath(); 7374 strNVRAMFilePath.stripSuffix(); 7375 strNVRAMFilePath += ".nvram"; 7369 7376 7370 7377 return strNVRAMFilePath; -
trunk/src/VBox/Main/xml/Settings.cpp
r81286 r81299 2464 2464 fLogoFadeOut(true), 2465 2465 fPXEDebugEnabled(false), 2466 fNVRAMEnabled(false),2467 2466 ulLogoDisplayTime(0), 2468 2467 biosBootMenuMode(BIOSBootMenuMode_MessageAndMenu), … … 2482 2481 && fLogoFadeOut 2483 2482 && !fPXEDebugEnabled 2484 && !fNVRAMEnabled2485 2483 && ulLogoDisplayTime == 0 2486 2484 && biosBootMenuMode == BIOSBootMenuMode_MessageAndMenu … … 2504 2502 && fLogoFadeOut == d.fLogoFadeOut 2505 2503 && fPXEDebugEnabled == d.fPXEDebugEnabled 2506 && fNVRAMEnabled == d.fNVRAMEnabled2507 2504 && ulLogoDisplayTime == d.ulLogoDisplayTime 2508 2505 && biosBootMenuMode == d.biosBootMenuMode … … 4729 4726 pelmBIOSChild->getAttributeValue("value", hw.biosSettings.llTimeOffset); 4730 4727 if ((pelmBIOSChild = pelmHwChild->findChildElement("NVRAM"))) 4731 {4732 pelmBIOSChild->getAttributeValue("enabled", hw.biosSettings.fNVRAMEnabled);4733 4728 pelmBIOSChild->getAttributeValue("path", hw.biosSettings.strNVRAMPath); 4734 }4735 4729 4736 4730 // legacy BIOS/IDEController (pre 1.7) … … 6203 6197 if (hw.biosSettings.fPXEDebugEnabled) 6204 6198 pelmBIOS->createChild("PXEDebug")->setAttribute("enabled", hw.biosSettings.fPXEDebugEnabled); 6205 if ( hw.biosSettings.fNVRAMEnabled6206 || !hw.biosSettings.strNVRAMPath.isEmpty())6207 {6208 xml::ElementNode *pelmNVRAM = pelmBIOS->createChild("NVRAM");6209 if (hw.biosSettings.fNVRAMEnabled)6210 pelmNVRAM->setAttribute("enabled", hw.biosSettings.fNVRAMEnabled);6211 6199 if (!hw.biosSettings.strNVRAMPath.isEmpty()) 6212 pelmNVRAM->setAttribute("path", hw.biosSettings.strNVRAMPath); 6213 } 6200 pelmBIOS->createChild("NVRAM")->setAttribute("path", hw.biosSettings.strNVRAMPath); 6214 6201 } 6215 6202 … … 7479 7466 if (m->sv < SettingsVersion_v1_18) 7480 7467 { 7481 if ( hardwareMachine.biosSettings.fNVRAMEnabled 7482 || !hardwareMachine.biosSettings.strNVRAMPath.isEmpty()) 7468 if (!hardwareMachine.biosSettings.strNVRAMPath.isEmpty()) 7483 7469 { 7484 7470 m->sv = SettingsVersion_v1_18;
Note:
See TracChangeset
for help on using the changeset viewer.