render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
a41c76
From 74ee4616dd3159f4456ec9d4fd22b4604394440b Mon Sep 17 00:00:00 2001
a41c76
Message-Id: <74ee4616dd3159f4456ec9d4fd22b4604394440b@dist-git>
a41c76
From: Peter Krempa <pkrempa@redhat.com>
a41c76
Date: Mon, 16 Mar 2020 22:12:17 +0100
a41c76
Subject: [PATCH] qemuCheckpointDiscardBitmaps: Reopen images for bitmap
a41c76
 modifications
a41c76
MIME-Version: 1.0
a41c76
Content-Type: text/plain; charset=UTF-8
a41c76
Content-Transfer-Encoding: 8bit
a41c76
a41c76
Qemu's bitmap APIs don't reopen the appropriate images read-write for
a41c76
modification. It's libvirt's duty to reopen them via blockdev-reopen
a41c76
if we wish to modify the bitmaps.
a41c76
a41c76
Use the new helpers to reopen the images for bitmap manipulation.
a41c76
a41c76
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
a41c76
Reviewed-by: Eric Blake <eblake@redhat.com>
a41c76
(cherry picked from commit c6d117528cc0ddb325abd67d69b6d4ebc1bfe608)
a41c76
https://bugzilla.redhat.com/show_bug.cgi?id=1799013
a41c76
Message-Id: <c5378d64ab79d29e62b5b65d1566825b5bc88eff.1584391727.git.pkrempa@redhat.com>
a41c76
Reviewed-by: Ján Tomko <jtomko@redhat.com>
a41c76
---
a41c76
 src/qemu/qemu_checkpoint.c | 7 +++++++
a41c76
 1 file changed, 7 insertions(+)
a41c76
a41c76
diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c
a41c76
index fe54af74ec..6e3a432022 100644
a41c76
--- a/src/qemu/qemu_checkpoint.c
a41c76
+++ b/src/qemu/qemu_checkpoint.c
a41c76
@@ -302,6 +302,10 @@ qemuCheckpointDiscardBitmaps(virDomainObjPtr vm,
a41c76
                                                false, false, false) < 0)
a41c76
             goto relabel;
a41c76
 
a41c76
+        if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_REOPEN) &&
a41c76
+            qemuBlockReopenReadWrite(vm, src, QEMU_ASYNC_JOB_NONE) < 0)
a41c76
+            goto relabel;
a41c76
+
a41c76
         relabelimages = g_slist_prepend(relabelimages, src);
a41c76
     }
a41c76
 
a41c76
@@ -314,6 +318,9 @@ qemuCheckpointDiscardBitmaps(virDomainObjPtr vm,
a41c76
     for (next = relabelimages; next; next = next->next) {
a41c76
         virStorageSourcePtr src = next->data;
a41c76
 
a41c76
+        if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_BLOCKDEV_REOPEN))
a41c76
+            ignore_value(qemuBlockReopenReadOnly(vm, src, QEMU_ASYNC_JOB_NONE));
a41c76
+
a41c76
         ignore_value(qemuDomainStorageSourceAccessAllow(driver, vm, src,
a41c76
                                                         true, false, false));
a41c76
     }
a41c76
-- 
a41c76
2.25.1
a41c76