render / rpms / libvirt

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