mirror of https://gitee.com/openkylin/libvirt.git
qemu: monitor: Extract whether qcow2 image uses extended L2 allocation data
In order to be able to propagate image configuration to newly formatted images we need to be able to query it. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
df0e867447
commit
3275be238c
|
@ -784,6 +784,9 @@ struct _qemuBlockNamedNodeData {
|
|||
|
||||
/* image version */
|
||||
bool qcow2v2;
|
||||
|
||||
/* qcow2 subcluster allocation -> extended_l2 */
|
||||
bool qcow2extendedL2;
|
||||
};
|
||||
|
||||
GHashTable *
|
||||
|
|
|
@ -2806,9 +2806,13 @@ qemuMonitorJSONBlockGetNamedNodeDataWorker(size_t pos G_GNUC_UNUSED,
|
|||
STREQ_NULLABLE(virJSONValueObjectGetString(format_specific, "type"), "qcow2")) {
|
||||
virJSONValue *qcow2props = virJSONValueObjectGetObject(format_specific, "data");
|
||||
|
||||
if (qcow2props &&
|
||||
STREQ_NULLABLE(virJSONValueObjectGetString(qcow2props, "compat"), "0.10"))
|
||||
if (qcow2props) {
|
||||
if (STREQ_NULLABLE(virJSONValueObjectGetString(qcow2props, "compat"), "0.10"))
|
||||
ent->qcow2v2 = true;
|
||||
|
||||
ignore_value(virJSONValueObjectGetBoolean(qcow2props, "extended-l2",
|
||||
&ent->qcow2extendedL2));
|
||||
}
|
||||
}
|
||||
|
||||
if (virHashAddEntry(nodes, nodename, ent) < 0)
|
||||
|
|
Loading…
Reference in New Issue