VirtualBox

Changeset 21173 in vbox for trunk


Ignore:
Timestamp:
Jul 2, 2009 3:31:20 PM (16 years ago)
Author:
vboxsync
Message:

Console could not load two or more temporary shared folders from saved state.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/ConsoleImpl.cpp

    r21079 r21173  
    852852        {
    853853            if (VBOX_SUCCESS (vrc))
    854                 vrc = loadStateFileExec (ssm, this, 0);
     854                vrc = loadStateFileExecInternal (ssm, version);
    855855            else if (vrc == VERR_SSM_UNIT_NOT_FOUND)
    856856                vrc = VINF_SUCCESS;
     
    926926/**
    927927 *  Callback handler to load various console data from the state file.
    928  *  When \a u32Version is 0, this method is called from #loadDataFromSavedState,
    929  *  otherwise it is called when the VM is being restored from the saved state.
     928 *  Called when the VM is being restored from the saved state.
    930929 *
    931930 *  @param pvUser       pointer to Console
    932931 *  @param u32Version   Console unit version.
    933  *                      When not 0, should match sSSMConsoleVer.
    934  *
    935  *  @note Locks the Console object for writing.
     932 *                      Should match sSSMConsoleVer.
     933 *
     934 *  @note Should locks the Console object for writing, if necessary.
    936935 */
    937936//static
     
    941940    LogFlowFunc (("\n"));
    942941
    943     if (u32Version != 0 && SSM_VERSION_MAJOR_CHANGED(u32Version, sSSMConsoleVer))
     942    if (SSM_VERSION_MAJOR_CHANGED(u32Version, sSSMConsoleVer))
    944943        return VERR_VERSION_MISMATCH;
    945 
    946     if (u32Version != 0)
    947     {
    948         /* currently, nothing to do when we've been called from VMR3Load */
    949         return VINF_SUCCESS;
    950     }
    951944
    952945    Console *that = static_cast <Console *> (pvUser);
    953946    AssertReturn (that, VERR_INVALID_PARAMETER);
    954947
    955     AutoCaller autoCaller (that);
     948    /* Currently, nothing to do when we've been called from VMR3Load. */
     949
     950    return VINF_SUCCESS;
     951}
     952
     953/**
     954 *  Method to load various console data from the state file.
     955 *  Called from #loadDataFromSavedState.
     956 *
     957 *  @param pvUser       pointer to Console
     958 *  @param u32Version   Console unit version.
     959 *                      Should match sSSMConsoleVer.
     960 *
     961 *  @note Locks the Console object for writing.
     962 */
     963int
     964Console::loadStateFileExecInternal (PSSMHANDLE pSSM, uint32_t u32Version)
     965{
     966    AutoCaller autoCaller (this);
    956967    AssertComRCReturn (autoCaller.rc(), VERR_ACCESS_DENIED);
    957968
    958     AutoWriteLock alock (that);
    959 
    960     AssertReturn (that->mSharedFolders.size() == 0, VERR_INTERNAL_ERROR);
     969    AutoWriteLock alock (this);
     970
     971    AssertReturn (mSharedFolders.size() == 0, VERR_INTERNAL_ERROR);
    961972
    962973    uint32_t size = 0;
     
    9941005        ComObjPtr <SharedFolder> sharedFolder;
    9951006        sharedFolder.createObject();
    996         HRESULT rc = sharedFolder->init (that, name, hostPath, writable);
     1007        HRESULT rc = sharedFolder->init (this, name, hostPath, writable);
    9971008        AssertComRCReturn (rc, VERR_INTERNAL_ERROR);
    9981009
    999         that->mSharedFolders.insert (std::make_pair (name, sharedFolder));
     1010        mSharedFolders.insert (std::make_pair (name, sharedFolder));
    10001011    }
    10011012
  • trunk/src/VBox/Main/include/ConsoleImpl.h

    r20928 r21173  
    495495
    496496    HRESULT loadDataFromSavedState();
     497    int loadStateFileExecInternal (PSSMHANDLE pSSM, uint32_t u32Version);
    497498
    498499    static DECLCALLBACK(void)   saveStateFileExec (PSSMHANDLE pSSM, void *pvUser);
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