VirtualBox

Changeset 24955 in vbox


Ignore:
Timestamp:
Nov 25, 2009 2:20:25 PM (15 years ago)
Author:
vboxsync
Message:

Main: do not reset diff images for immutable disks if the machine's current snapshot is online

File:
1 edited

Legend:

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

    r24954 r24955  
    48534853    task->mTeleporterEnabled = fTeleporterEnabled;
    48544854
    4855     ULONG cSnapshots;
    4856     rc = mMachine->COMGETTER(SnapshotCount)(&cSnapshots);
     4855    /* Reset differencing hard disks for which autoReset is true,
     4856     * but only if the machine has no snapshots OR the current snapshot
     4857     * is an OFFLINE snapshot; otherwise we would reset the current differencing
     4858     * image of an ONLINE snapshot which contains the disk state of the machine
     4859     * while it was previously running, but without the corresponding machine
     4860     * state, which is equivalent to powering off a running machine and not
     4861     * good idea
     4862     */
     4863    ComPtr<ISnapshot> pCurrentSnapshot;
     4864    rc = mMachine->COMGETTER(CurrentSnapshot)(pCurrentSnapshot.asOutParam());
    48574865    CheckComRCReturnRC(rc);
    48584866
    4859     /* Reset differencing hard disks for which autoReset is true,
    4860      * but only if the machine does not have any snapshots (otherwise
    4861      * the behavior of differencing images would get very confusing)
    4862      */
    4863     if (0 == cSnapshots)
    4864     {
    4865         LogFlowThisFunc(("Machine has no snapshots, looking for immutable images to reset\n"));
     4867    BOOL fCurrentSnapshotIsOnline = false;
     4868    if (pCurrentSnapshot)
     4869    {
     4870        rc = pCurrentSnapshot->COMGETTER(Online)(&fCurrentSnapshotIsOnline);
     4871        CheckComRCReturnRC(rc);
     4872    }
     4873
     4874    if (!fCurrentSnapshotIsOnline)
     4875    {
     4876        LogFlowThisFunc(("Looking for immutable images to reset\n"));
    48664877
    48674878        com::SafeIfaceArray<IMediumAttachment> atts;
     
    49034914    }
    49044915    else
    4905         LogFlowThisFunc(("Machine has %d snapshots, skipping immutable images reset\n", cSnapshots));
     4916        LogFlowThisFunc(("Machine has a current snapshot which is online, skipping immutable images reset\n"));
    49064917
    49074918    rc = consoleInitReleaseLog(mMachine);
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