mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-21 21:25:25 +00:00
qemu_snapshot: call qemuSnapshotDeleteUpdateDisks only for external snapshots
Calling this function when deleting internal snapshot isn't required because with internal snapshots all changes are done within the file itself so there is no file deletion and no need to update snapshot metadata. Signed-off-by: Pavel Hrdina <phrdina@redhat.com> Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
parent
ca7d1bd5ee
commit
79654f425c
@ -3537,14 +3537,16 @@ qemuSnapshotDiscardMetadata(virDomainObj *vm,
|
||||
if (rep.err < 0)
|
||||
ret = -1;
|
||||
|
||||
data.snap = snap;
|
||||
data.vm = vm;
|
||||
data.error = 0;
|
||||
virDomainMomentForEachDescendant(snap,
|
||||
qemuSnapshotDeleteUpdateDisks,
|
||||
&data);
|
||||
if (data.error < 0)
|
||||
ret = -1;
|
||||
if (virDomainSnapshotIsExternal(snap)) {
|
||||
data.snap = snap;
|
||||
data.vm = vm;
|
||||
data.error = 0;
|
||||
virDomainMomentForEachDescendant(snap,
|
||||
qemuSnapshotDeleteUpdateDisks,
|
||||
&data);
|
||||
if (data.error < 0)
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
virDomainMomentMoveChildren(snap, snap->parent);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user