From 267982bde3d9356dfa784dd7840d6c28e8af0d56712a2da63626977e704f5c73 Mon Sep 17 00:00:00 2001 From: James Fehlig Date: Thu, 17 Dec 2020 15:20:10 +0000 Subject: [PATCH] Accepting request 856706 from home:jfehlig:branches:Virtualization - qemu: Fix logic bug in inactive snapshot deletion 0ddebdb4-qemu-snapshot-deletion.patch boo#1180049 OBS-URL: https://build.opensuse.org/request/show/856706 OBS-URL: https://build.opensuse.org/package/show/Virtualization/libvirt?expand=0&rev=866 --- 0ddebdb4-qemu-snapshot-deletion.patch | 30 +++++++++++++++++++++++++++ libvirt.changes | 7 +++++++ libvirt.spec | 1 + 3 files changed, 38 insertions(+) create mode 100644 0ddebdb4-qemu-snapshot-deletion.patch diff --git a/0ddebdb4-qemu-snapshot-deletion.patch b/0ddebdb4-qemu-snapshot-deletion.patch new file mode 100644 index 0000000..38e3ad7 --- /dev/null +++ b/0ddebdb4-qemu-snapshot-deletion.patch @@ -0,0 +1,30 @@ +commit 0ddebdb42e72a984d25793722a60b85c7c7d8f1f +Author: Peter Krempa +Date: Wed Dec 9 10:08:53 2020 +0100 + + 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 + +Index: libvirt-6.10.0/src/qemu/qemu_domain.c +=================================================================== +--- libvirt-6.10.0.orig/src/qemu/qemu_domain.c ++++ libvirt-6.10.0/src/qemu/qemu_domain.c +@@ -6594,7 +6594,8 @@ qemuDomainSnapshotDiscard(virQEMUDriverP + 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); diff --git a/libvirt.changes b/libvirt.changes index 66cb807..ce27e9e 100644 --- a/libvirt.changes +++ b/libvirt.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Dec 17 04:20:58 UTC 2020 - James Fehlig + +- qemu: Fix logic bug in inactive snapshot deletion + 0ddebdb4-qemu-snapshot-deletion.patch + boo#1180049 + ------------------------------------------------------------------- Wed Dec 9 00:07:16 UTC 2020 - James Fehlig diff --git a/libvirt.spec b/libvirt.spec index 465b447..3f102d8 100644 --- a/libvirt.spec +++ b/libvirt.spec @@ -293,6 +293,7 @@ Source100: %{name}-rpmlintrc # Upstream patches Patch0: 0d05d51b-apparmor-lxc-fix.patch Patch1: cf4e7e62-lxc-def-secmodel.patch +Patch2: 0ddebdb4-qemu-snapshot-deletion.patch # Patches pending upstream review Patch100: libxl-dom-reset.patch Patch101: network-don-t-use-dhcp-authoritative-on-static-netwo.patch