From: Peter Krempa Date: Wed, 9 Dec 2020 09:08:53 +0000 (+0100) Subject: qemu: Fix logic bug in inactive snapshot deletion X-Git-Tag: v7.0.0-rc1~257 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0ddebdb42e72a984d25793722a60b85c7c7d8f1f;p=thirdparty%2Flibvirt.git qemu: Fix logic bug in inactive snapshot deletion Commit 926563dc3a6 which refactored the function call deleting the snapshot's on disk state introduced a logic bug, which skips over the deletion of libvirt metadata after the disk state deletion is done. To fix it we must not return early. Resolves: https://gitlab.com/libvirt/libvirt/-/issues/109 Signed-off-by: Peter Krempa Reviewed-by: Erik Skultety --- diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c index 6781fb6cf0..766f76020c 100644 --- a/src/qemu/qemu_domain.c +++ b/src/qemu/qemu_domain.c @@ -6666,7 +6666,8 @@ qemuDomainSnapshotDiscard(virQEMUDriverPtr driver, if (!def) def = vm->def; - return qemuDomainSnapshotForEachQcow2(driver, def, snap, "-d", true); + if (qemuDomainSnapshotForEachQcow2(driver, def, snap, "-d", true) < 0) + return -1; } else { priv = vm->privateData; qemuDomainObjEnterMonitor(driver, vm);