VirtualBox

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


Ignore:
Timestamp:
Sep 25, 2009 2:58:47 PM (15 years ago)
Author:
vboxsync
Message:

ConsoleImpl,MachineImpl: Re-did the live snapshot bits.

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

Legend:

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

    r23223 r23335  
    24012401                        mMachineState);
    24022402
    2403     /* memorize the current machine state */
    2404     MachineState_T lastMachineState = mMachineState;
    2405 
    2406 #ifndef VBOX_WITH_LIVE_MIGRATION /** @todo update the API docs. */
    2407     if (mMachineState == MachineState_Running)
    2408     {
    2409         HRESULT rc = Pause();
    2410         CheckComRCReturnRC(rc);
    2411     }
    2412 #endif
    2413 
    24142403    HRESULT rc = S_OK;
    24152404
     
    24972486        pTask->fTakingSnapshotOnline = fTakingSnapshotOnline;
    24982487
     2488#ifndef VBOX_WITH_LIVE_MIGRATION /** @todo update the API docs. */
    24992489        if (mMachineState == MachineState_Running)
    25002490        {
     
    25022492            if (FAILED(rc)) throw rc;
    25032493        }
     2494#endif
    25042495
    25052496        int vrc = RTThreadCreate(NULL,
     
    70567047/**
    70577048 * Worker thread created by Console::TakeSnapshot.
    7058  * @param Thread
    7059  * @param pvUser
    7060  * @return
     7049 * @param Thread The current thread (ignored).
     7050 * @param pvUser The task.
     7051 * @return VINF_SUCCESS (ignored).
    70617052 */
    70627053/*static*/
     
    71247115            int vrc = VMR3Save(that->mpVM,
    71257116                               strSavedStateFile.c_str(),
    7126                                false,       // bool fContinueAfterwards; @todo r=dj Knut, what needs to be put here now?
     7117                               true /*fContinueAfterwards*/,
    71277118                               Console::stateProgressCallback,
    71287119                               (void*)pTask);
  • trunk/src/VBox/Main/MachineImpl.cpp

    r23331 r23335  
    82818281
    82828282#ifdef VBOX_WITH_LIVE_MIGRATION
    8283     AssertReturn(    (    !Global::IsOnlineOrTransient (mData->mMachineState)
    8284                        || mData->mMachineState == MachineState_Paused
    8285                        || mData->mMachineState == MachineState_Running
    8286                      )
    8287                   && mSnapshotData.mLastState == MachineState_Null
    8288                   && mSnapshotData.mSnapshot.isNull()
    8289                   && mSnapshotData.mServerProgress.isNull()
    8290                   && mSnapshotData.mCombinedProgress.isNull(), E_FAIL);
     8283    AssertReturn(    !Global::IsOnlineOrTransient(mData->mMachineState)
     8284                  || mData->mMachineState == MachineState_Running
     8285                  || mData->mMachineState == MachineState_Paused, E_FAIL);
    82918286#else
    82928287    AssertReturn(    !Global::IsOnlineOrTransient(mData->mMachineState)
    82938288                  || mData->mMachineState == MachineState_Paused, E_FAIL);
     8289#endif
    82948290    AssertReturn(mSnapshotData.mLastState == MachineState_Null, E_FAIL);
    82958291    AssertReturn(mSnapshotData.mSnapshot.isNull(), E_FAIL);
    8296 #endif
    82978292
    82988293    if (    !fTakingSnapshotOnline
     
    84298424                  E_FAIL);
    84308425
    8431     /* set the state to the state we had when BeginTakingSnapshot() was called
    8432      * (this is expected by Console::TakeSnapshot() and
    8433      * Console::saveStateThread()) */
    8434     if (mData->mMachineState != mSnapshotData.mLastState)
     8426    /*
     8427     * Restore the state we had when BeginTakingSnapshot() was called,
     8428     * Console::fntTakeSnapshotWorker restores its local copy when we return.
     8429     * If the state was Running, then let Console::fntTakeSnapshotWorker it
     8430     * all via Console::Resume().
     8431     */
     8432    if (   mData->mMachineState != mSnapshotData.mLastState
     8433        && mSnapshotData.mLastState != MachineState_Running)
    84358434        setMachineState(mSnapshotData.mLastState);
    84368435
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