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