Changeset 33318 in vbox
- Timestamp:
- Oct 21, 2010 4:16:03 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 66894
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/SnapshotImpl.cpp
r33307 r33318 2677 2677 childSnapshotId = pChildSnapshot->getId(); 2678 2678 } 2679 // If this is an online deletion the attachment was updated 2680 // already as it is required to continue execution immediately. 2681 // Needs a bit of special treatment due to this difference. 2682 if (it->mfNeedsOnlineMerge) 2679 pAtt = findAttachment(pMachine->mMediaData->mAttachments, it->mpSource); 2680 if (pAtt) 2683 2681 { 2682 AutoWriteLock attLock(pAtt COMMA_LOCKVAL_SRC_POS); 2683 pAtt->updateMedium(it->mpTarget); 2684 2684 it->mpTarget->addBackReference(pMachine->mData->mUuid, childSnapshotId); 2685 2685 } 2686 2686 else 2687 2687 { 2688 pAtt = findAttachment(pMachine->mMediaData->mAttachments, it->mpSource);2689 2688 // If no attachment is found do not change anything. Maybe 2690 2689 // the source medium was not attached to the snapshot. 2691 if (pAtt)2692 {2693 AutoWriteLock attLock(pAtt COMMA_LOCKVAL_SRC_POS);2694 pAtt->updateMedium(it->mpTarget);2690 // If this is an online deletion the attachment was updated 2691 // already to allow the VM continue execution immediately. 2692 // Needs a bit of special treatment due to this difference. 2693 if (it->mfNeedsOnlineMerge) 2695 2694 it->mpTarget->addBackReference(pMachine->mData->mUuid, childSnapshotId); 2696 }2697 2695 } 2698 2696 } … … 3260 3258 ComObjPtr<Medium> pTarget(static_cast<Medium *>(aTarget)); 3261 3259 ComObjPtr<Medium> pParentForTarget(static_cast<Medium *>(aParentForTarget)); 3260 bool fSourceHasChildren = false; 3262 3261 3263 3262 // all hard disks but the target were successfully deleted by … … 3302 3301 if (childrenToReparent.size() > 0) 3303 3302 { 3303 fSourceHasChildren = true; 3304 3304 // Fix the parent UUID of the images which needs to be moved to 3305 3305 // underneath target. The running machine has the images opened, … … 3407 3407 } 3408 3408 3409 /* If this is a backwards merge update the medium associated with the 3410 * attachment, as the previously associated one is now deleted. */ 3411 if (!aMergeForward) 3409 /* If this is a backwards merge of the only remaining snapshot (i.e. the 3410 * source has no children) then update the medium associated with the 3411 * attachment, as the previously associated one (source) is now deleted. 3412 * Without the immediate update the VM could not continue running. */ 3413 if (!aMergeForward && !fSourceHasChildren) 3412 3414 { 3413 3415 AutoWriteLock attLock(pMediumAttachment COMMA_LOCKVAL_SRC_POS);
Note:
See TracChangeset
for help on using the changeset viewer.