]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuBlockStorageSourceCreateDetectSize: Propagate 'extended_l2' feature to new overlays
authorPeter Krempa <pkrempa@redhat.com>
Thu, 16 Dec 2021 17:35:34 +0000 (18:35 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 21 Dec 2021 12:23:09 +0000 (13:23 +0100)
In cases where the qcow2 image is using subclusters/extended_l2 entries
we should propagate them to the new images which are based on such
images.

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

index bff93e96eeb25f580b89e7ab975fa6ccf39ca916..2e606e99b4c3a3971ba900f4edee6377c05cd5c6 100644 (file)
@@ -2941,11 +2941,18 @@ qemuBlockStorageSourceCreateDetectSize(GHashTable *blockNamedNodeData,
         return -1;
     }
 
-    /* propagate cluster size if the images are compatible */
+    /* propagate properties of qcow2 images if possible*/
     if (templ->format == VIR_STORAGE_FILE_QCOW2 &&
-        src->format == VIR_STORAGE_FILE_QCOW2 &&
-        src->clusterSize == 0)
-        src->clusterSize = entry->clusterSize;
+        src->format == VIR_STORAGE_FILE_QCOW2) {
+        if (src->clusterSize == 0)
+            src->clusterSize = entry->clusterSize;
+
+        if (entry->qcow2extendedL2) {
+            if (!src->features)
+                src->features = virBitmapNew(VIR_STORAGE_FILE_FEATURE_LAST);
+            ignore_value(virBitmapSetBit(src->features, VIR_STORAGE_FILE_FEATURE_EXTENDED_L2));
+        }
+    }
 
     if (src->format == VIR_STORAGE_FILE_RAW) {
         src->physical = entry->capacity;