VirtualBox

Changeset 103532 in vbox for trunk/src/VBox/Main


Ignore:
Timestamp:
Feb 22, 2024 2:05:31 PM (9 months ago)
Author:
vboxsync
Message:

VBoxManage: Add subcommand for enabling UEFI secure boot (and show the status in the VM infos).
Main/NVRAMStore+UefiVariableStore: Tweaks to allow reading the UEFI secure boot state when the VM isn't mutable.
doc/manual: Update VBoxManage manpage.

Location:
trunk/src/VBox/Main
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/include/AutoStateDep.h

    r98263 r103532  
    7373              mRegistered(FALSE)
    7474        {
    75             Assert(aThat);
    76             mRC = aThat->i_addStateDependency(taDepType, &mMachineState,
    77                                             &mRegistered);
     75            if (RT_VALID_PTR(aThat))
     76                mRC = aThat->i_addStateDependency(taDepType, &mMachineState,
     77                                                  &mRegistered);
    7878        }
    7979        ~AutoStateDependency()
    8080        {
    81             if (SUCCEEDED(mRC))
     81            if (RT_VALID_PTR(mThat) && SUCCEEDED(mRC))
    8282                mThat->i_releaseStateDependency();
    8383        }
     
    8888        {
    8989            AssertReturnVoid(SUCCEEDED(mRC));
    90             mThat->i_releaseStateDependency();
     90            if (RT_VALID_PTR(mThat))
     91                mThat->i_releaseStateDependency();
    9192            mRC = E_FAIL;
    9293        }
     
    9899        {
    99100            AssertReturnVoid(!SUCCEEDED(mRC));
    100             mRC = mThat->i_addStateDependency(taDepType, &mMachineState,
    101                                             &mRegistered);
     101            if (RT_VALID_PTR(mThat))
     102                mRC = mThat->i_addStateDependency(taDepType, &mMachineState,
     103                                                  &mRegistered);
     104            else
     105                mRC = S_OK;
    102106        }
    103107
  • trunk/src/VBox/Main/src-all/NvramStoreImpl.cpp

    r99739 r103532  
    380380{
    381381#ifndef VBOX_COM_INPROC
    382     /* the machine needs to be mutable */
    383     AutoMutableStateDependency adep(m->pParent);
    384     if (FAILED(adep.hrc())) return adep.hrc();
    385 
    386382    Utf8Str strPath;
    387383    NvramStore::getNonVolatileStorageFile(strPath);
     
    418414    {
    419415        m->pUefiVarStore.queryInterfaceTo(aUefiVarStore.asOutParam());
    420 
    421         /* Mark the NVRAM store as potentially modified. */
    422         m->pParent->i_setModified(Machine::IsModified_NvramStore);
     416        /* The "modified" state is handled by i_retainUefiVarStore. */
    423417    }
    424418
     
    10661060HRESULT NvramStore::i_retainUefiVarStore(PRTVFS phVfs, bool fReadonly)
    10671061{
    1068     /* the machine needs to be mutable */
    1069     AutoMutableStateDependency adep(m->pParent);
     1062    /* the machine needs to be mutable unless fReadonly is set */
     1063    AutoMutableStateDependency adep(fReadonly ? NULL : m->pParent);
    10701064    if (FAILED(adep.hrc())) return adep.hrc();
    10711065
  • trunk/src/VBox/Main/src-server/UefiVariableStoreImpl.cpp

    r99739 r103532  
    152152HRESULT UefiVariableStore::getSecureBootEnabled(BOOL *pfEnabled)
    153153{
    154     /* the machine needs to be mutable */
    155     AutoMutableStateDependency adep(m->pMachine);
    156     if (FAILED(adep.hrc())) return adep.hrc();
    157 
    158154    HRESULT hrc = i_retainUefiVariableStore(true /*fReadonly*/);
    159155    if (FAILED(hrc)) return hrc;
     
    324320                                               std::vector<BYTE> &aData)
    325321{
    326     /* the machine needs to be mutable */
    327     AutoMutableStateDependency adep(m->pMachine);
    328     if (FAILED(adep.hrc())) return adep.hrc();
    329 
    330322    HRESULT hrc = i_retainUefiVariableStore(true /*fReadonly*/);
    331323    if (FAILED(hrc)) return hrc;
     
    370362                                          std::vector<com::Guid> &aOwnerUuids)
    371363{
    372     /* the machine needs to be mutable */
    373     AutoMutableStateDependency adep(m->pMachine);
    374     if (FAILED(adep.hrc())) return adep.hrc();
    375 
    376364    HRESULT hrc = i_retainUefiVariableStore(true /*fReadonly*/);
    377365    if (FAILED(hrc)) return hrc;
     
    522510HRESULT UefiVariableStore::enrollDefaultMsSignatures(void)
    523511{
     512    /* the machine needs to be mutable */
    524513    AutoMutableStateDependency adep(m->pMachine);
    525514    if (FAILED(adep.hrc())) return adep.hrc();
Note: See TracChangeset for help on using the changeset viewer.

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