libvirt/SOURCES/libvirt-qemu-snapshot-go-through-cleanup-on-error.patch
2021-09-10 11:58:15 +00:00

42 lines
1.6 KiB
Diff

From 1196c633f969dd9457b9b431fbcd944e35249b5f Mon Sep 17 00:00:00 2001
Message-Id: <1196c633f969dd9457b9b431fbcd944e35249b5f@dist-git>
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
Date: Tue, 4 Feb 2020 15:07:58 +0100
Subject: [PATCH] qemu: snapshot: go through cleanup on error
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
A recent commit added an error check for too-nested backing chains
followed by a return, even though errors above jump to cleanup.
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Fixes: b168fa88b85dec181882816ab65a59a6c4500667
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
(cherry picked from commit c07ef7c563c7d661fd4b59bac190cd1db44bd3e5)
https://bugzilla.redhat.com/show_bug.cgi?id=1524278
Message-Id: <5903cd3cb7845ed3151492457a4e92e57a15fef0.1580824112.git.pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
---
src/qemu/qemu_driver.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index 833cf9f3d9..e19e1da0bb 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -14633,7 +14633,7 @@ qemuDomainSnapshotCreateInactiveExternal(virQEMUDriverPtr driver,
snapdisk->src->format = VIR_STORAGE_FILE_QCOW2;
if (qemuDomainStorageSourceValidateDepth(defdisk->src, 1, defdisk->dst) < 0)
- return -1;
+ goto cleanup;
/* creates cmd line args: qemu-img create -f qcow2 -o */
if (!(cmd = virCommandNewArgList(qemuImgPath,
--
2.25.0