1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-20 07:59:00 +00:00

qemu: block: Allow specifying cluster size when using 'blockdev-create'

'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>
This commit is contained in:
Peter Krempa 2020-08-26 16:43:29 +02:00
parent fd49364d8b
commit e60620e28b
2 changed files with 2 additions and 0 deletions

View 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;

View 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;