]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: block: Don't try to merge bitmaps into 'raw' images
authorPeter Krempa <pkrempa@redhat.com>
Thu, 23 Nov 2023 12:43:36 +0000 (13:43 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Fri, 24 Nov 2023 14:53:41 +0000 (15:53 +0100)
If any of the images in a chain above a raw image have bitmaps, libvirt
would attempt to merge them when doing a block commit or block copy
operation, which would result into a error in the logs as creating
persistent bitmaps in a raw image is not supported.

Since libvirt cares only about persistent bitmaps we can simply skip the
operation if the target of a block copy or block commit is a raw image.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/qemu/qemu_block.c

index fab122942a4b242089698d7347ea3b41af9e5baf..359595367b134801664f03f879d0a5882f6ce855 100644 (file)
@@ -3074,6 +3074,11 @@ qemuBlockBitmapsHandleBlockcopy(virStorageSource *src,
 {
     virStorageSource *base = NULL;
 
+    /* if copy destination is a 'raw' image there's no point in attempting to
+     * merge the bitmaps into it */
+    if (mirror->format == VIR_STORAGE_FILE_RAW)
+        return 0;
+
     if (shallow)
         base = src->backingStore;
 
@@ -3107,6 +3112,11 @@ qemuBlockBitmapsHandleCommitFinish(virStorageSource *topsrc,
 {
     virStorageSource *writebitmapsrc = NULL;
 
+    /* if base is a 'raw' image there's no point in attempting to merge the
+     * bitmaps into it */
+    if (basesrc->format == VIR_STORAGE_FILE_RAW)
+        return 0;
+
     if (active)
         writebitmapsrc = basesrc;