[RFC PATCH 3/3] qemuBlockStorageSourceCreateDetectSize: Propagate cluster size for 'qcow2'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Propagate the cluster size from the original image as the user might
have configured a custom cluster size for performance reasons. Propagate
the cluster size of a qcow2 image to the new overlay or copy.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_block.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index 0113c64f0f..6e8fe545b4 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -2789,6 +2789,11 @@ qemuBlockStorageSourceCreateDetectSize(virHashTablePtr blockNamedNodeData,
         return -1;
     }

+    /* propagate cluster size if the images are compatible */
+    if (templ->format == VIR_STORAGE_FILE_QCOW2 &&
+        src->format == VIR_STORAGE_FILE_QCOW2)
+        src->clusterSize = entry->clusterSize;
+
     if (src->format == VIR_STORAGE_FILE_RAW) {
         src->physical = entry->capacity;
     } else {
-- 
2.26.2




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux