VirtualBox

Changeset 91536 in vbox for trunk/src/VBox/Main/src-all


Ignore:
Timestamp:
Oct 4, 2021 9:46:04 AM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
147230
Message:

Main/NvramStore: Fix saving the tar bundle of the NVRAM state, bugref:10098

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-all/NvramStoreImpl.cpp

    r91535 r91536  
    610610 * Saves the NVRAM store as a tar archive.
    611611 */
    612 int NvramStore::i_saveStoreAsTar(void)
     612int NvramStore::i_saveStoreAsTar(const char *pszPath)
    613613{
    614614    uint32_t        offError = 0;
     
    616616    RTVFSIOSTREAM   hVfsIos;
    617617
    618     int rc = RTVfsChainOpenIoStream(m->bd->strNvramPath.c_str(), RTFILE_O_WRITE | RTFILE_O_DENY_WRITE | RTFILE_O_CREATE_REPLACE,
     618    int rc = RTVfsChainOpenIoStream(pszPath, RTFILE_O_WRITE | RTFILE_O_DENY_WRITE | RTFILE_O_CREATE_REPLACE,
    619619                                    &hVfsIos, &offError, RTErrInfoInitStatic(&ErrInfo));
    620620    if (RT_SUCCESS(rc))
     
    666666    int rc = VINF_SUCCESS;
    667667
     668    Utf8Str strTmp;
     669    NvramStore::getNonVolatileStorageFile(strTmp);
     670
    668671    AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS);
    669672    if (   m->bd->mapNvram.size() == 1
     
    674677        rc = RTVfsFileSeek(hVfsFileNvram, 0 /*offSeek*/, RTFILE_SEEK_BEGIN, NULL /*poffActual*/);
    675678        AssertRC(rc); RT_NOREF(rc);
    676 
    677         Utf8Str strTmp;
    678         NvramStore::getNonVolatileStorageFile(strTmp);
    679679
    680680        RTVFSIOSTREAM hVfsIosDst;
     
    693693    }
    694694    else if (m->bd->mapNvram.size())
    695         rc = i_saveStoreAsTar();
     695        rc = i_saveStoreAsTar(strTmp.c_str());
    696696    /* else: No NVRAM content to store so we are done here. */
    697697
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