mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemuBlockStorageSourceCreateGetFormatPropsQcow2: Add support for 'extended-l2' feature
Allow creating the qcow2 with the new subcluster format if required. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
58f5597a77
commit
df0e867447
@ -2441,18 +2441,23 @@ qemuBlockStorageSourceCreateGetFormatPropsQcow2(virStorageSource *src,
|
|||||||
{
|
{
|
||||||
g_autoptr(virJSONValue) qcow2props = NULL;
|
g_autoptr(virJSONValue) qcow2props = NULL;
|
||||||
const char *qcow2version = NULL;
|
const char *qcow2version = NULL;
|
||||||
|
bool extendedL2 = false;
|
||||||
|
|
||||||
if (STREQ_NULLABLE(src->compat, "0.10"))
|
if (STREQ_NULLABLE(src->compat, "0.10"))
|
||||||
qcow2version = "v2";
|
qcow2version = "v2";
|
||||||
else if (STREQ_NULLABLE(src->compat, "1.1"))
|
else if (STREQ_NULLABLE(src->compat, "1.1"))
|
||||||
qcow2version = "v3";
|
qcow2version = "v3";
|
||||||
|
|
||||||
|
if (src->features)
|
||||||
|
extendedL2 = virBitmapIsBitSet(src->features, VIR_STORAGE_FILE_FEATURE_EXTENDED_L2);
|
||||||
|
|
||||||
if (virJSONValueObjectAdd(&qcow2props,
|
if (virJSONValueObjectAdd(&qcow2props,
|
||||||
"s:driver", "qcow2",
|
"s:driver", "qcow2",
|
||||||
"s:file", src->nodestorage,
|
"s:file", src->nodestorage,
|
||||||
"U:size", src->capacity,
|
"U:size", src->capacity,
|
||||||
"S:version", qcow2version,
|
"S:version", qcow2version,
|
||||||
"P:cluster-size", src->clusterSize,
|
"P:cluster-size", src->clusterSize,
|
||||||
|
"B:extended-l2", extendedL2,
|
||||||
NULL) < 0)
|
NULL) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user