[PATCH] qemu: Fix logic bug in inactive snapshot deletion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_domain.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index d6fded9dd1..1af1e4dac8 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -6667,7 +6667,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);
-- 
2.29.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux