Changeset 35175 in vbox for trunk/src/VBox/Main/SnapshotImpl.cpp
- Timestamp:
- Dec 16, 2010 12:36:00 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/SnapshotImpl.cpp
r35011 r35175 1367 1367 || mData->mMachineState == MachineState_Running 1368 1368 || mData->mMachineState == MachineState_Paused, E_FAIL); 1369 AssertReturn(m SnapshotData.mLastState == MachineState_Null, E_FAIL);1370 AssertReturn(m SnapshotData.mSnapshot.isNull(), E_FAIL);1369 AssertReturn(mConsoleTaskData.mLastState == MachineState_Null, E_FAIL); 1370 AssertReturn(mConsoleTaskData.mSnapshot.isNull(), E_FAIL); 1371 1371 1372 1372 if ( !fTakingSnapshotOnline … … 1422 1422 1423 1423 /* 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. 1426 1430 1427 1431 try … … 1436 1440 1437 1441 /* Console::fntTakeSnapshotWorker and friends expects this. */ 1438 if (m SnapshotData.mLastState == MachineState_Running)1442 if (mConsoleTaskData.mLastState == MachineState_Running) 1439 1443 setMachineState(MachineState_LiveSnapshotting); 1440 1444 else … … 1449 1453 throw rc; 1450 1454 1451 if (m SnapshotData.mLastState == MachineState_Saved)1455 if (mConsoleTaskData.mLastState == MachineState_Saved) 1452 1456 { 1453 1457 Utf8Str stateFrom = mSSData->mStateFilePath; 1454 Utf8Str stateTo = m SnapshotData.mSnapshot->stateFilePath();1458 Utf8Str stateTo = mConsoleTaskData.mSnapshot->stateFilePath(); 1455 1459 1456 1460 LogFlowThisFunc(("Copying the execution state from '%s' to '%s'...\n", … … 1484 1488 { 1485 1489 LogThisFunc(("Caught %Rhrc [%s]\n", hrc, Global::stringifyMachineState(mData->mMachineState) )); 1486 if ( m SnapshotData.mLastState != mData->mMachineState1487 && ( m SnapshotData.mLastState == MachineState_Running1490 if ( mConsoleTaskData.mLastState != mData->mMachineState 1491 && ( mConsoleTaskData.mLastState == MachineState_Running 1488 1492 ? mData->mMachineState == MachineState_LiveSnapshotting 1489 1493 : mData->mMachineState == MachineState_Saving) 1490 1494 ) 1491 setMachineState(m SnapshotData.mLastState);1495 setMachineState(mConsoleTaskData.mLastState); 1492 1496 1493 1497 pSnapshot->uninit(); 1494 1498 pSnapshot.setNull(); 1495 m SnapshotData.mLastState = MachineState_Null;1496 m SnapshotData.mSnapshot.setNull();1499 mConsoleTaskData.mLastState = MachineState_Null; 1500 mConsoleTaskData.mSnapshot.setNull(); 1497 1501 1498 1502 rc = hrc; … … 1540 1544 || ( ( mData->mMachineState == MachineState_Saving 1541 1545 || mData->mMachineState == MachineState_LiveSnapshotting) 1542 && m SnapshotData.mLastState != MachineState_Null1543 && !m SnapshotData.mSnapshot.isNull()1546 && mConsoleTaskData.mLastState != MachineState_Null 1547 && !mConsoleTaskData.mSnapshot.isNull() 1544 1548 ) 1545 1549 , E_FAIL); … … 1551 1555 * all to avoid races. 1552 1556 */ 1553 if ( mData->mMachineState != m SnapshotData.mLastState1554 && m SnapshotData.mLastState != MachineState_Running1557 if ( mData->mMachineState != mConsoleTaskData.mLastState 1558 && mConsoleTaskData.mLastState != MachineState_Running 1555 1559 ) 1556 setMachineState(m SnapshotData.mLastState);1560 setMachineState(mConsoleTaskData.mLastState); 1557 1561 1558 1562 ComObjPtr<Snapshot> pOldFirstSnap = mData->mFirstSnapshot; 1559 1563 ComObjPtr<Snapshot> pOldCurrentSnap = mData->mCurrentSnapshot; 1560 1564 1561 bool fOnline = Global::IsOnline(m SnapshotData.mLastState);1565 bool fOnline = Global::IsOnline(mConsoleTaskData.mLastState); 1562 1566 1563 1567 HRESULT rc = S_OK; … … 1566 1570 { 1567 1571 // new snapshot becomes the current one 1568 mData->mCurrentSnapshot = m SnapshotData.mSnapshot;1572 mData->mCurrentSnapshot = mConsoleTaskData.mSnapshot; 1569 1573 1570 1574 /* memorize the first snapshot if necessary */ … … 1591 1595 /* inform callbacks */ 1592 1596 mParent->onSnapshotTaken(mData->mUuid, 1593 m SnapshotData.mSnapshot->getId());1597 mConsoleTaskData.mSnapshot->getId()); 1594 1598 } 1595 1599 else … … 1603 1607 1604 1608 /* delete the saved state file (it might have been already created) */ 1605 if (m SnapshotData.mSnapshot->stateFilePath().length())1606 RTFileDelete(m SnapshotData.mSnapshot->stateFilePath().c_str());1607 1608 m SnapshotData.mSnapshot->uninit();1609 if (mConsoleTaskData.mSnapshot->stateFilePath().length()) 1610 RTFileDelete(mConsoleTaskData.mSnapshot->stateFilePath().c_str()); 1611 1612 mConsoleTaskData.mSnapshot->uninit(); 1609 1613 } 1610 1614 1611 1615 /* clear out the snapshot data */ 1612 m SnapshotData.mLastState = MachineState_Null;1613 m SnapshotData.mSnapshot.setNull();1616 mConsoleTaskData.mLastState = MachineState_Null; 1617 mConsoleTaskData.mSnapshot.setNull(); 1614 1618 1615 1619 // save VirtualBox.xml (media registry most probably changed with diff image);
Note:
See TracChangeset
for help on using the changeset viewer.