Blame SOURCES/libvirt-qemu-blockjob-Don-t-base-bitmap-handling-of-active-layer-block-commit-on-QEMU_CAPS_BLOCKDEV_REOPEN.patch

79b470
From 3c9641730c62ffae735d7984b3bc0632a9194b03 Mon Sep 17 00:00:00 2001
79b470
Message-Id: <3c9641730c62ffae735d7984b3bc0632a9194b03@dist-git>
79b470
From: Peter Krempa <pkrempa@redhat.com>
79b470
Date: Tue, 21 Jul 2020 13:56:21 +0200
79b470
Subject: [PATCH] qemu: blockjob: Don't base bitmap handling of active-layer
79b470
 block commit on QEMU_CAPS_BLOCKDEV_REOPEN
79b470
79b470
The handler finalizing the active layer block commit doesn't actually
79b470
reopen the file for active layer block commit, so the comment and check
79b470
are invalid.
79b470
79b470
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
79b470
Reviewed-by: Eric Blake <eblake@redhat.com>
79b470
(cherry picked from commit d73f107469c8882a47ffbf1a55bd0b0370d6969e)
79b470
79b470
rhel-8.3: https://bugzilla.redhat.com/show_bug.cgi?id=1857779
79b470
rhel-av-8.2.1: not cloned yet
79b470
Message-Id: <6946fb2535038e24dcef4884806c11c258f0fc70.1595332476.git.pkrempa@redhat.com>
79b470
79b470
Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
79b470
---
79b470
 src/qemu/qemu_blockjob.c | 3 ++-
79b470
 src/qemu/qemu_driver.c   | 6 +-----
79b470
 2 files changed, 3 insertions(+), 6 deletions(-)
79b470
79b470
diff --git a/src/qemu/qemu_blockjob.c b/src/qemu/qemu_blockjob.c
79b470
index 6e33f8666c..7e2df1445d 100644
79b470
--- a/src/qemu/qemu_blockjob.c
79b470
+++ b/src/qemu/qemu_blockjob.c
79b470
@@ -1063,7 +1063,8 @@ qemuBlockJobProcessEventCompletedCommitBitmaps(virDomainObjPtr vm,
79b470
     g_autoptr(virJSONValue) actions = NULL;
79b470
     bool active = job->type == QEMU_BLOCKJOB_TYPE_ACTIVE_COMMIT;
79b470
 
79b470
-    if (!virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_REOPEN))
79b470
+    if (!active &&
79b470
+        !virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_REOPEN))
79b470
         return 0;
79b470
 
79b470
     if (!(blockNamedNodeData = qemuBlockGetNamedNodeData(vm, asyncJob)))
79b470
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
79b470
index 9e3a455814..ad5ef7d67d 100644
79b470
--- a/src/qemu/qemu_driver.c
79b470
+++ b/src/qemu/qemu_driver.c
79b470
@@ -17631,11 +17631,7 @@ qemuDomainBlockPivot(virQEMUDriverPtr driver,
79b470
         break;
79b470
 
79b470
     case QEMU_BLOCKJOB_TYPE_ACTIVE_COMMIT:
79b470
-        /* we technically don't need reopen here, but we couldn't prepare
79b470
-         * the bitmaps if it wasn't present thus must skip this */
79b470
-        if (blockdev &&
79b470
-            virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_REOPEN)) {
79b470
-
79b470
+        if (blockdev) {
79b470
             actions = virJSONValueNewArray();
79b470
 
79b470
             if (qemuMonitorTransactionBitmapAdd(actions,
79b470
-- 
79b470
2.27.0
79b470