VirtualBox

Ignore:
Timestamp:
Sep 30, 2019 6:55:28 PM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
133693
Message:

Main/Machine+BIOSSettings: bare bones NVRAM logic, many parts missing (no snapshot handling, no move VM handling, no remove VM handling).
Main/Settings: adaptions to store NVRAM config in the settings file
Frontends/VBoxManage: support enabling and showing state

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/BIOSSettingsImpl.cpp

    r76592 r81087  
    224224}
    225225
    226 
    227226HRESULT BIOSSettings::setLogoFadeOut(BOOL enable)
    228227{
     
    256255}
    257256
    258 
    259257HRESULT BIOSSettings::setLogoDisplayTime(ULONG displayTime)
    260258{
     
    284282}
    285283
    286 
    287284HRESULT BIOSSettings::setLogoImagePath(const com::Utf8Str &imagePath)
    288285{
     
    311308}
    312309
    313 
    314310HRESULT BIOSSettings::setBootMenuMode(BIOSBootMenuMode_T bootMenuMode)
    315311{
     
    340336}
    341337
    342 
    343338HRESULT BIOSSettings::setACPIEnabled(BOOL enable)
    344339{
     
    369364}
    370365
    371 
    372366HRESULT BIOSSettings::setIOAPICEnabled(BOOL aIOAPICEnabled)
    373367{
     
    398392}
    399393
    400 
    401394HRESULT BIOSSettings::setAPICMode(APICMode_T aAPICMode)
    402395{
     
    427420}
    428421
    429 
    430422HRESULT BIOSSettings::setPXEDebugEnabled(BOOL enable)
    431423{
     
    446438}
    447439
     440
    448441HRESULT BIOSSettings::getTimeOffset(LONG64 *offset)
    449442{
     
    455448}
    456449
    457 
    458450HRESULT BIOSSettings::setTimeOffset(LONG64 offset)
    459451{
     
    474466}
    475467
     468
     469HRESULT 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
     478HRESULT 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
    476504HRESULT BIOSSettings::getNonVolatileStorageFile(com::Utf8Str &aNonVolatileStorageFile)
    477505{
    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);
    481513
    482514    return S_OK;
     
    504536    AssertComRCReturnRC(autoCaller.rc());
    505537
     538    AutoReadLock mlock(m->pMachine COMMA_LOCKVAL_SRC_POS);
    506539    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    507540
    508541    // simply copy
    509542    m->bd.assignCopy(&data);
     543
     544    Utf8Str strTmp(m->bd->strNVRAMPath);
     545    m->pMachine->i_copyPathRelativeToMachine(strTmp, m->bd->strNVRAMPath);
    510546
    511547    return S_OK;
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette