VirtualBox

Changeset 38153 in vbox


Ignore:
Timestamp:
Jul 25, 2011 12:25:40 PM (14 years ago)
Author:
vboxsync
Message:

Main/Machine: fix snapshot tree handling for cloning "machine and child states", previously it didn't update the snapshot tree correctly if current state was in the cloned subtree

File:
1 edited

Legend:

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

    r38145 r38153  
    815815                    if (fSubtreeIncludesCurrent)
    816816                    {
    817                         /* zap d->snapshotId because there is no need to
    818                          * create a new current state. */
    819                         d->snapshotId.clear();
    820817                        if (pCurrState.isNull())
    821818                            throw E_FAIL;
     
    949946                 && !sn.uuid.isEmpty())
    950947        {
    951             /* Copy the snapshot data to the current machine. */
    952             trgMCF.hardwareMachine = sn.hardware;
    953             trgMCF.storageMachine  = sn.storage;
    954 
     948            if (!d->pOldMachineState.isNull())
     949            {
     950                /* Copy the snapshot data to the current machine. */
     951                trgMCF.hardwareMachine = sn.hardware;
     952                trgMCF.storageMachine  = sn.storage;
     953
     954                /* Current state is under root snapshot. */
     955                trgMCF.uuidCurrentSnapshot = sn.uuid;
     956            }
    955957            /* The snapshot will be the root one. */
    956             trgMCF.uuidCurrentSnapshot = sn.uuid;
    957958            trgMCF.llFirstSnapshot.clear();
    958959            trgMCF.llFirstSnapshot.push_back(sn);
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