render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
fbe740
From 830d5044f0069e3e34e826d27478c9a19503adcf Mon Sep 17 00:00:00 2001
fbe740
Message-Id: <830d5044f0069e3e34e826d27478c9a19503adcf@dist-git>
fbe740
From: Peter Krempa <pkrempa@redhat.com>
fbe740
Date: Tue, 4 Feb 2020 15:07:36 +0100
fbe740
Subject: [PATCH] qemu: blockcopy: Actually unplug unused images when mirror
fbe740
 job fails to start
fbe740
MIME-Version: 1.0
fbe740
Content-Type: text/plain; charset=UTF-8
fbe740
Content-Transfer-Encoding: 8bit
fbe740
fbe740
If a mirror job fails to start in -blockdev mode we'd not unplug the
fbe740
backing files we added first because the code on the error path checked
fbe740
the wrong value. 'rc' is used as status of the code which added the
fbe740
images, but the state of the 'block(dev)-mirror' call is stored in 'ret'
fbe740
at that point.
fbe740
fbe740
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
fbe740
Reviewed-by: Eric Blake <eblake@redhat.com>
fbe740
(cherry picked from commit 623366d13066174e60067fa763ddc2c3d1db20ef)
fbe740
fbe740
https://bugzilla.redhat.com/show_bug.cgi?id=1792195
fbe740
Message-Id: <5e9e1dd3db0f3137079f2fb29974778f8cf32879.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 6163b13e91..83f24d7231 100644
fbe740
--- a/src/qemu/qemu_driver.c
fbe740
+++ b/src/qemu/qemu_driver.c
fbe740
@@ -18415,7 +18415,7 @@ qemuDomainBlockCopyCommon(virDomainObjPtr vm,
fbe740
     qemuBlockJobStarted(job, vm);
fbe740
 
fbe740
  endjob:
fbe740
-    if (rc < 0 &&
fbe740
+    if (ret < 0 &&
fbe740
         virDomainObjIsActive(vm) &&
fbe740
         (data || crdata)) {
fbe740
         qemuDomainObjEnterMonitor(driver, vm);
fbe740
-- 
fbe740
2.25.0
fbe740