VirtualBox

Changeset 24954 in vbox for trunk/src


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

Main: do not reset diff images for immutable disks if the machine has snapshots

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

Legend:

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

    r24949 r24954  
    47274727
    47284728    /* the network cards will undergo a quick consistency check */
    4729     for (ULONG slot = 0; slot < SchemaDefs::NetworkAdapterCount; slot ++)
     4729    for (ULONG slot = 0;
     4730         slot < SchemaDefs::NetworkAdapterCount;
     4731         ++slot)
    47304732    {
    47314733        ComPtr<INetworkAdapter> adapter;
     
    48514853    task->mTeleporterEnabled = fTeleporterEnabled;
    48524854
    4853     /* Reset differencing hard disks for which autoReset is true */
    4854     {
     4855    ULONG cSnapshots;
     4856    rc = mMachine->COMGETTER(SnapshotCount)(&cSnapshots);
     4857    CheckComRCReturnRC(rc);
     4858
     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"));
     4866
    48554867        com::SafeIfaceArray<IMediumAttachment> atts;
    48564868        rc = mMachine->COMGETTER(MediumAttachments)(ComSafeArrayAsOutParam(atts));
    48574869        CheckComRCReturnRC(rc);
    48584870
    4859         for (size_t i = 0; i < atts.size(); ++ i)
     4871        for (size_t i = 0;
     4872             i < atts.size();
     4873             ++i)
    48604874        {
    48614875            DeviceType_T devType;
     
    48884902        }
    48894903    }
     4904    else
     4905        LogFlowThisFunc(("Machine has %d snapshots, skipping immutable images reset\n", cSnapshots));
    48904906
    48914907    rc = consoleInitReleaseLog(mMachine);
  • trunk/src/VBox/Main/MediumImpl.cpp

    r24933 r24954  
    11031103    }
    11041104
    1105     /* optional, only for diffs, default is false */
     1105    /* optional, only for diffs, default is false;
     1106     * we can only auto-reset diff images, so they
     1107     * must not have a parent */
    11061108    if (aParent != NULL)
    11071109        m->autoReset = data.fAutoReset;
     
    25222524    AutoWriteLock alock(this);
    25232525
     2526    LogFlowThisFunc(("ENTER for medium %s\n", m->strLocationFull.c_str()));
     2527
    25242528    if (mParent.isNull())
    25252529        return setError(VBOX_E_NOT_SUPPORTED,
     
    25472551         * asynchronously */
    25482552
    2549         std::auto_ptr <Task> task(new Task(this, progress, Task::Reset));
     2553        std::auto_ptr<Task> task(new Task(this, progress, Task::Reset));
    25502554        AssertComRCThrowRC(task->autoCaller.rc());
    25512555
     
    25722576        progress.queryInterfaceTo(aProgress);
    25732577    }
     2578
     2579    LogFlowThisFunc(("LEAVE, rc=%Rhrc\n", rc));
    25742580
    25752581    return rc;
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