VirtualBox

Ignore:
Timestamp:
Dec 16, 2010 12:36:00 PM (14 years ago)
Author:
vboxsync
Message:

Main/Machine: rename mSnapshotData to mConsoleTaskData (together with the struct name), since in the future this will hold information for all long-term operations triggered via Console methods

File:
1 edited

Legend:

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

    r35011 r35175  
    13671367                  || mData->mMachineState == MachineState_Running
    13681368                  || mData->mMachineState == MachineState_Paused, E_FAIL);
    1369     AssertReturn(mSnapshotData.mLastState == MachineState_Null, E_FAIL);
    1370     AssertReturn(mSnapshotData.mSnapshot.isNull(), E_FAIL);
     1369    AssertReturn(mConsoleTaskData.mLastState == MachineState_Null, E_FAIL);
     1370    AssertReturn(mConsoleTaskData.mSnapshot.isNull(), E_FAIL);
    13711371
    13721372    if (    !fTakingSnapshotOnline
     
    14221422
    14231423    /* fill in the snapshot data */
    1424     mSnapshotData.mLastState = mData->mMachineState;
    1425     mSnapshotData.mSnapshot = pSnapshot;
     1424    mConsoleTaskData.mLastState = mData->mMachineState;
     1425    mConsoleTaskData.mSnapshot = pSnapshot;
     1426    /// @todo in the long run the progress object should be moved to
     1427    // VBoxSVC to avoid trouble with monitoring the progress object state
     1428    // when the process where it lives is terminating shortly after the
     1429    // operation completed.
    14261430
    14271431    try
     
    14361440
    14371441        /* Console::fntTakeSnapshotWorker and friends expects this. */
    1438         if (mSnapshotData.mLastState == MachineState_Running)
     1442        if (mConsoleTaskData.mLastState == MachineState_Running)
    14391443            setMachineState(MachineState_LiveSnapshotting);
    14401444        else
     
    14491453            throw rc;
    14501454
    1451         if (mSnapshotData.mLastState == MachineState_Saved)
     1455        if (mConsoleTaskData.mLastState == MachineState_Saved)
    14521456        {
    14531457            Utf8Str stateFrom = mSSData->mStateFilePath;
    1454             Utf8Str stateTo = mSnapshotData.mSnapshot->stateFilePath();
     1458            Utf8Str stateTo = mConsoleTaskData.mSnapshot->stateFilePath();
    14551459
    14561460            LogFlowThisFunc(("Copying the execution state from '%s' to '%s'...\n",
     
    14841488    {
    14851489        LogThisFunc(("Caught %Rhrc [%s]\n", hrc, Global::stringifyMachineState(mData->mMachineState) ));
    1486         if (    mSnapshotData.mLastState != mData->mMachineState
    1487              && (   mSnapshotData.mLastState == MachineState_Running
     1490        if (    mConsoleTaskData.mLastState != mData->mMachineState
     1491             && (   mConsoleTaskData.mLastState == MachineState_Running
    14881492                  ? mData->mMachineState == MachineState_LiveSnapshotting
    14891493                  : mData->mMachineState == MachineState_Saving)
    14901494           )
    1491             setMachineState(mSnapshotData.mLastState);
     1495            setMachineState(mConsoleTaskData.mLastState);
    14921496
    14931497        pSnapshot->uninit();
    14941498        pSnapshot.setNull();
    1495         mSnapshotData.mLastState = MachineState_Null;
    1496         mSnapshotData.mSnapshot.setNull();
     1499        mConsoleTaskData.mLastState = MachineState_Null;
     1500        mConsoleTaskData.mSnapshot.setNull();
    14971501
    14981502        rc = hrc;
     
    15401544                 || (    (    mData->mMachineState == MachineState_Saving
    15411545                           || mData->mMachineState == MachineState_LiveSnapshotting)
    1542                       && mSnapshotData.mLastState != MachineState_Null
    1543                       && !mSnapshotData.mSnapshot.isNull()
     1546                      && mConsoleTaskData.mLastState != MachineState_Null
     1547                      && !mConsoleTaskData.mSnapshot.isNull()
    15441548                    )
    15451549                 , E_FAIL);
     
    15511555     * all to avoid races.
    15521556     */
    1553     if (    mData->mMachineState != mSnapshotData.mLastState
    1554          && mSnapshotData.mLastState != MachineState_Running
     1557    if (    mData->mMachineState != mConsoleTaskData.mLastState
     1558         && mConsoleTaskData.mLastState != MachineState_Running
    15551559       )
    1556         setMachineState(mSnapshotData.mLastState);
     1560        setMachineState(mConsoleTaskData.mLastState);
    15571561
    15581562    ComObjPtr<Snapshot> pOldFirstSnap = mData->mFirstSnapshot;
    15591563    ComObjPtr<Snapshot> pOldCurrentSnap = mData->mCurrentSnapshot;
    15601564
    1561     bool fOnline = Global::IsOnline(mSnapshotData.mLastState);
     1565    bool fOnline = Global::IsOnline(mConsoleTaskData.mLastState);
    15621566
    15631567    HRESULT rc = S_OK;
     
    15661570    {
    15671571        // new snapshot becomes the current one
    1568         mData->mCurrentSnapshot = mSnapshotData.mSnapshot;
     1572        mData->mCurrentSnapshot = mConsoleTaskData.mSnapshot;
    15691573
    15701574        /* memorize the first snapshot if necessary */
     
    15911595        /* inform callbacks */
    15921596        mParent->onSnapshotTaken(mData->mUuid,
    1593                                  mSnapshotData.mSnapshot->getId());
     1597                                 mConsoleTaskData.mSnapshot->getId());
    15941598    }
    15951599    else
     
    16031607
    16041608        /* delete the saved state file (it might have been already created) */
    1605         if (mSnapshotData.mSnapshot->stateFilePath().length())
    1606             RTFileDelete(mSnapshotData.mSnapshot->stateFilePath().c_str());
    1607 
    1608         mSnapshotData.mSnapshot->uninit();
     1609        if (mConsoleTaskData.mSnapshot->stateFilePath().length())
     1610            RTFileDelete(mConsoleTaskData.mSnapshot->stateFilePath().c_str());
     1611
     1612        mConsoleTaskData.mSnapshot->uninit();
    16091613    }
    16101614
    16111615    /* clear out the snapshot data */
    1612     mSnapshotData.mLastState = MachineState_Null;
    1613     mSnapshotData.mSnapshot.setNull();
     1616    mConsoleTaskData.mLastState = MachineState_Null;
     1617    mConsoleTaskData.mSnapshot.setNull();
    16141618
    16151619    // save VirtualBox.xml (media registry most probably changed with diff image);
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