]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: block: Allow specifying cluster size when using 'blockdev-create'
authorPeter Krempa <pkrempa@redhat.com>
Wed, 26 Aug 2020 14:43:29 +0000 (16:43 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Tue, 8 Sep 2020 06:48:53 +0000 (08:48 +0200)
'blockdev-create' allows us to create the image with a custom cluster
size if we wish to. Wire it up for 'qcow2'.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
src/qemu/qemu_block.c
src/util/virstoragefile.h

index 26c1b42428a7711410f102f98ce31e2db39d4175..0113c64f0f71572e76558acb016caa9ad3967b82 100644 (file)
@@ -2315,6 +2315,7 @@ qemuBlockStorageSourceCreateGetFormatPropsQcow2(virStorageSourcePtr src,
                                  "s:file", src->nodestorage,
                                  "U:size", src->capacity,
                                  "S:version", qcow2version,
+                                 "P:cluster-size", src->clusterSize,
                                  NULL) < 0)
         return -1;
 
index f73b3ee0057f3b548035efba81a772cabe16f290..87763cf3893f1d5c4a30855a6f70368c3ed7ed53 100644 (file)
@@ -318,6 +318,7 @@ struct _virStorageSource {
     unsigned long long capacity; /* in bytes, 0 if unknown */
     unsigned long long allocation; /* in bytes, 0 if unknown */
     unsigned long long physical; /* in bytes, 0 if unknown */
+    unsigned long long clusterSize; /* in bytes, 0 if unknown */
     bool has_allocation; /* Set to true when provided in XML */
 
     size_t nseclabels;