render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
d89b3e
From 826bf4c001e1190982e500c6d88c0513d3e507ce Mon Sep 17 00:00:00 2001
d89b3e
Message-Id: <826bf4c001e1190982e500c6d88c0513d3e507ce@dist-git>
d89b3e
From: Peter Krempa <pkrempa@redhat.com>
d89b3e
Date: Tue, 17 Mar 2015 13:13:54 +0100
d89b3e
Subject: [PATCH] qemu: block-commit: Mark disk in block jobs only on
d89b3e
 successful command
d89b3e
d89b3e
https://bugzilla.redhat.com/show_bug.cgi?id=1202719
d89b3e
d89b3e
Patch 51f9f03a4ca50b070c0fbfb29748d49f583e15e1 introduces a regression
d89b3e
where if a blockCommit operation fails the disk is still marked as being
d89b3e
part of a block job but can't be unmarked later.
d89b3e
d89b3e
(cherry picked from commit ee744b5b387b5123ee40683c52ab40783ffc3020)
d89b3e
d89b3e
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
d89b3e
---
d89b3e
 src/qemu/qemu_driver.c | 3 ++-
d89b3e
 1 file changed, 2 insertions(+), 1 deletion(-)
d89b3e
d89b3e
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
d89b3e
index 2bd4a1d..9dc243a 100644
d89b3e
--- a/src/qemu/qemu_driver.c
d89b3e
+++ b/src/qemu/qemu_driver.c
d89b3e
@@ -16354,7 +16354,8 @@ qemuDomainBlockCommit(virDomainPtr dom,
d89b3e
                                  bandwidth);
d89b3e
     qemuDomainObjExitMonitor(driver, vm);
d89b3e
 
d89b3e
-    disk->blockjob = true;
d89b3e
+    if (ret == 0)
d89b3e
+        disk->blockjob = true;
d89b3e
 
d89b3e
     if (mirror) {
d89b3e
         if (ret == 0) {
d89b3e
-- 
d89b3e
2.3.3
d89b3e