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