Changeset 81087 in vbox for trunk/src/VBox/Main
- Timestamp:
- Sep 30, 2019 6:55:28 PM (5 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/idl/VirtualBox.xidl
r81084 r81087 599 599 <desc>Settings version "1.17", written by VirtualBox 6.0.x.</desc> 600 600 <!-- 601 Machine changes: nested hardware virtualization, UART type selection. 601 Machine changes: nested hardware virtualization, hardware 602 virtualization using native APU, shared folder automount point, 603 UART type selection and VM process priority. 602 604 --> 603 605 </const> … … 605 607 <desc>Settings version "1.18", written by VirtualBox 6.1.x.</desc> 606 608 <!-- 607 Machine changes: nested hardware virtualization, UART type selection.609 Machine changes: virtio-scsi storage controller, NVRAM device. 608 610 --> 609 611 </const> … … 5257 5259 </attribute> 5258 5260 5261 <attribute name="nonVolatileStorageEnabled" type="boolean"> 5262 <desc> 5263 Controls the non-volatile memory device presence. If set, VirtualBox 5264 will store the content in a file whose path can be queried with the 5265 <link to="#nonVolatileStorageFile"/> attribute. 5266 </desc> 5267 </attribute> 5268 5259 5269 <attribute name="nonVolatileStorageFile" type="wstring" readonly="yes"> 5260 5270 <desc> -
trunk/src/VBox/Main/include/BIOSSettingsImpl.h
r76562 r81087 81 81 HRESULT getPXEDebugEnabled(BOOL *enabled); 82 82 HRESULT setPXEDebugEnabled(BOOL enable); 83 HRESULT getNonVolatileStorageEnabled(BOOL *enabled); 84 HRESULT setNonVolatileStorageEnabled(BOOL enable); 83 85 HRESULT getNonVolatileStorageFile(com::Utf8Str &aNonVolatileStorageFile); 84 86 -
trunk/src/VBox/Main/include/MachineImpl.h
r80824 r81087 542 542 Utf8Str i_getLogFilename(ULONG idx); 543 543 Utf8Str i_getHardeningLogFilename(void); 544 Utf8Str i_getDefaultNVRAMFilename(); 544 545 545 546 void i_composeSavedStateFilename(Utf8Str &strStateFilePath); -
trunk/src/VBox/Main/src-client/ConsoleImpl2.cpp
r80847 r81087 1831 1831 InsertConfigInteger(pCfg, "PermanentSave", 1); 1832 1832 #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 } 1833 1848 } 1834 1849 -
trunk/src/VBox/Main/src-server/BIOSSettingsImpl.cpp
r76592 r81087 224 224 } 225 225 226 227 226 HRESULT BIOSSettings::setLogoFadeOut(BOOL enable) 228 227 { … … 256 255 } 257 256 258 259 257 HRESULT BIOSSettings::setLogoDisplayTime(ULONG displayTime) 260 258 { … … 284 282 } 285 283 286 287 284 HRESULT BIOSSettings::setLogoImagePath(const com::Utf8Str &imagePath) 288 285 { … … 311 308 } 312 309 313 314 310 HRESULT BIOSSettings::setBootMenuMode(BIOSBootMenuMode_T bootMenuMode) 315 311 { … … 340 336 } 341 337 342 343 338 HRESULT BIOSSettings::setACPIEnabled(BOOL enable) 344 339 { … … 369 364 } 370 365 371 372 366 HRESULT BIOSSettings::setIOAPICEnabled(BOOL aIOAPICEnabled) 373 367 { … … 398 392 } 399 393 400 401 394 HRESULT BIOSSettings::setAPICMode(APICMode_T aAPICMode) 402 395 { … … 427 420 } 428 421 429 430 422 HRESULT BIOSSettings::setPXEDebugEnabled(BOOL enable) 431 423 { … … 446 438 } 447 439 440 448 441 HRESULT BIOSSettings::getTimeOffset(LONG64 *offset) 449 442 { … … 455 448 } 456 449 457 458 450 HRESULT BIOSSettings::setTimeOffset(LONG64 offset) 459 451 { … … 474 466 } 475 467 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 locking 498 m->pMachine->i_setModified(Machine::IsModified_BIOS); 499 500 return S_OK; 501 } 502 503 476 504 HRESULT BIOSSettings::getNonVolatileStorageFile(com::Utf8Str &aNonVolatileStorageFile) 477 505 { 478 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 479 480 aNonVolatileStorageFile = ""; 506 Utf8Str strTmp; 507 { 508 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 509 strTmp = m->bd->strNVRAMPath; 510 } 511 512 m->pMachine->i_calculateFullPath(strTmp, aNonVolatileStorageFile); 481 513 482 514 return S_OK; … … 504 536 AssertComRCReturnRC(autoCaller.rc()); 505 537 538 AutoReadLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS); 506 539 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 507 540 508 541 // simply copy 509 542 m->bd.assignCopy(&data); 543 544 Utf8Str strTmp(m->bd->strNVRAMPath); 545 m->pMachine->i_copyPathRelativeToMachine(strTmp, m->bd->strNVRAMPath); 510 546 511 547 return S_OK; -
trunk/src/VBox/Main/src-server/MachineImpl.cpp
r80849 r81087 7309 7309 strFilename.append(RTPATH_SLASH_STR "VBoxHardening.log"); 7310 7310 return strFilename; 7311 } 7312 7313 /** 7314 * Returns the default NVRAM filename based on the location of the VM config. 7315 * This intentionally works differently than the saved state file naming since 7316 * it is part of the current state. Taking a snapshot will use a similar naming 7317 * as for saved state, because these are actually read-only, retaining a 7318 * a specific state just like saved state. 7319 */ 7320 7321 Utf8Str Machine::i_getDefaultNVRAMFilename() 7322 { 7323 AutoCaller autoCaller(this); 7324 AssertComRCReturn(autoCaller.rc(), Utf8Str::Empty); 7325 7326 AutoReadLock alock(this COMMA_LOCKVAL_SRC_POS); 7327 Utf8Str strNVRAMFilePathAbs = mData->m_strConfigFileFull; 7328 strNVRAMFilePathAbs.stripSuffix(); 7329 strNVRAMFilePathAbs += ".nvram"; 7330 Utf8Str strNVRAMFilePath; 7331 i_copyPathRelativeToMachine(strNVRAMFilePathAbs, strNVRAMFilePath); 7332 7333 return strNVRAMFilePath; 7311 7334 } 7312 7335 -
trunk/src/VBox/Main/xml/Settings.cpp
r80074 r81087 2464 2464 fLogoFadeOut(true), 2465 2465 fPXEDebugEnabled(false), 2466 fNVRAMEnabled(false), 2466 2467 ulLogoDisplayTime(0), 2467 2468 biosBootMenuMode(BIOSBootMenuMode_MessageAndMenu), … … 2481 2482 && fLogoFadeOut 2482 2483 && !fPXEDebugEnabled 2484 && !fNVRAMEnabled 2483 2485 && ulLogoDisplayTime == 0 2484 2486 && biosBootMenuMode == BIOSBootMenuMode_MessageAndMenu 2485 2487 && apicMode == APICMode_APIC 2486 2488 && llTimeOffset == 0 2487 && strLogoImagePath.isEmpty(); 2489 && strLogoImagePath.isEmpty() 2490 && strNVRAMPath.isEmpty(); 2488 2491 } 2489 2492 … … 2501 2504 && fLogoFadeOut == d.fLogoFadeOut 2502 2505 && fPXEDebugEnabled == d.fPXEDebugEnabled 2506 && fNVRAMEnabled == d.fNVRAMEnabled 2503 2507 && ulLogoDisplayTime == d.ulLogoDisplayTime 2504 2508 && biosBootMenuMode == d.biosBootMenuMode 2505 2509 && apicMode == d.apicMode 2506 2510 && llTimeOffset == d.llTimeOffset 2507 && strLogoImagePath == d.strLogoImagePath); 2511 && strLogoImagePath == d.strLogoImagePath 2512 && strNVRAMPath == d.strNVRAMPath); 2508 2513 } 2509 2514 … … 4721 4726 if ((pelmBIOSChild = pelmHwChild->findChildElement("TimeOffset"))) 4722 4727 pelmBIOSChild->getAttributeValue("value", hw.biosSettings.llTimeOffset); 4728 if ((pelmBIOSChild = pelmHwChild->findChildElement("NVRAM"))) 4729 { 4730 pelmBIOSChild->getAttributeValue("enabled", hw.biosSettings.fNVRAMEnabled); 4731 pelmBIOSChild->getAttributeValue("path", hw.biosSettings.strNVRAMPath); 4732 } 4723 4733 4724 4734 // legacy BIOS/IDEController (pre 1.7) … … 6189 6199 if (hw.biosSettings.fPXEDebugEnabled) 6190 6200 pelmBIOS->createChild("PXEDebug")->setAttribute("enabled", hw.biosSettings.fPXEDebugEnabled); 6201 if ( hw.biosSettings.fNVRAMEnabled 6202 || !hw.biosSettings.strNVRAMPath.isEmpty()) 6203 { 6204 xml::ElementNode *pelmNVRAM = pelmBIOS->createChild("NVRAM"); 6205 if (hw.biosSettings.fNVRAMEnabled) 6206 pelmNVRAM->setAttribute("enabled", hw.biosSettings.fNVRAMEnabled); 6207 if (!hw.biosSettings.strNVRAMPath.isEmpty()) 6208 pelmNVRAM->setAttribute("path", hw.biosSettings.strNVRAMPath); 6209 } 6191 6210 } 6192 6211 … … 7450 7469 if (m->sv < SettingsVersion_v1_18) 7451 7470 { 7471 if ( hardwareMachine.biosSettings.fNVRAMEnabled 7472 || !hardwareMachine.biosSettings.strNVRAMPath.isEmpty()) 7473 { 7474 m->sv = SettingsVersion_v1_18; 7475 return; 7476 } 7477 7452 7478 // VirtualBox 6.1 adds a virtio-scsi storage controller. 7453 7479 for (StorageControllersList::const_iterator it = hardwareMachine.storage.llStorageControllers.begin(); -
trunk/src/VBox/Main/xml/VirtualBox-settings.xsd
r80074 r81087 715 715 <xsd:complexType> 716 716 <xsd:attribute name="enabled" type="xsd:boolean" default="false"/> 717 </xsd:complexType> 718 </xsd:element> 719 <xsd:element name="NVRAM" minOccurs="0"> 720 <xsd:complexType> 721 <xsd:attribute name="enabled" type="xsd:boolean" default="false"/> 722 <xsd:attribute name="path" type="xsd:string"/> 717 723 </xsd:complexType> 718 724 </xsd:element>
Note:
See TracChangeset
for help on using the changeset viewer.