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(a)redhat.com>
---
src/qemu/qemu_snapshot.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)
diff --git a/src/qemu/qemu_snapshot.c b/src/qemu/qemu_snapshot.c
index 0cac0c4146..be089a31db 100644
--- a/src/qemu/qemu_snapshot.c
+++ b/src/qemu/qemu_snapshot.c
@@ -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);
}
--
2.43.2