Qemu's bitmap APIs don't reopen the appropriate images read-write for
modification. It's libvirt's duty to reopen them via blockdev-reopen
if we wish to modify the bitmaps.

Use the new helpers to reopen the images for bitmap manipulation.

Signed-off-by: Peter Krempa <pkre...@redhat.com>
---
 src/qemu/qemu_checkpoint.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/qemu/qemu_checkpoint.c b/src/qemu/qemu_checkpoint.c
index a387e7dfe7..32b0ab0faf 100644
--- a/src/qemu/qemu_checkpoint.c
+++ b/src/qemu/qemu_checkpoint.c
@@ -299,6 +299,9 @@ qemuCheckpointDiscardBitmaps(virDomainObjPtr vm,
         if (qemuDomainStorageSourceAccessAllow(driver, vm, src, false, false) 
< 0)
             goto relabel;

+        if (qemuBlockReopenReadWrite(vm, src, QEMU_ASYNC_JOB_NONE) < 0)
+            goto relabel;
+
         relabelimages = g_slist_prepend(relabelimages, src);
     }

@@ -311,6 +314,7 @@ qemuCheckpointDiscardBitmaps(virDomainObjPtr vm,
     for (next = relabelimages; next; next = next->next) {
         virStorageSourcePtr src = next->data;

+        ignore_value(qemuBlockReopenReadOnly(vm, src, QEMU_ASYNC_JOB_NONE));
         ignore_value(qemuDomainStorageSourceAccessAllow(driver, vm, src, true, 
false));
     }

-- 
2.24.1

Reply via email to