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:
Pavel Hrdina 2024-02-21 17:45:08 +01:00
parent ca7d1bd5ee
commit 79654f425c

View File

@ -3537,14 +3537,16 @@ qemuSnapshotDiscardMetadata(virDomainObj *vm,
if (rep.err < 0) if (rep.err < 0)
ret = -1; ret = -1;
data.snap = snap; if (virDomainSnapshotIsExternal(snap)) {
data.vm = vm; data.snap = snap;
data.error = 0; data.vm = vm;
virDomainMomentForEachDescendant(snap, data.error = 0;
qemuSnapshotDeleteUpdateDisks, virDomainMomentForEachDescendant(snap,
&data); qemuSnapshotDeleteUpdateDisks,
if (data.error < 0) &data);
ret = -1; if (data.error < 0)
ret = -1;
}
virDomainMomentMoveChildren(snap, snap->parent); virDomainMomentMoveChildren(snap, snap->parent);
} }