VirtualBox

Ignore:
Timestamp:
Jan 26, 2013 7:52:47 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
83369
Message:

Main/SnapshotImpl: Select merge direction based on the image size

File:
1 edited

Legend:

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

    r44327 r44395  
    24552455                // base disk. Here we need then to update the attachment that
    24562456                // refers to the child and have it point to the parent instead
    2457                 Assert(pHD->getParent().isNull());
    24582457                Assert(pHD->getChildren().size() == 1);
    24592458
     
    30053004    else
    30063005    {
    3007         /* forward merge */
    3008         aSource = aHD;
    3009         aTarget = pChild;
     3006        /* Determine best merge direction. */
     3007        bool fMergeForward = true;
     3008
     3009        childLock.release();
     3010        alock.release();
     3011        HRESULT rc = aHD->queryPreferredMergeDirection(pChild, fMergeForward);
     3012        alock.acquire();
     3013        childLock.acquire();
     3014
     3015        if (FAILED(rc) && rc != E_FAIL)
     3016            return rc;
     3017
     3018        if (fMergeForward)
     3019        {
     3020            aSource = aHD;
     3021            aTarget = pChild;
     3022            LogFlowFunc(("Forward merging selected\n"));
     3023        }
     3024        else
     3025        {
     3026            aSource = pChild;
     3027            aTarget = aHD;
     3028            LogFlowFunc(("Backward merging selected\n"));
     3029        }
    30103030    }
    30113031
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette