提交 72c1770a 编写于 作者: M Michal Privoznik

qemu_capabilities: Introduce QEMU_CAPS_OBJECT_MEMORY_FILE_DISCARD

This capability tracks if memory-backend-file has discard-data
attribute or not.
Signed-off-by: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 8a94501e
......@@ -479,6 +479,7 @@ VIR_ENUM_IMPL(virQEMUCaps, QEMU_CAPS_LAST,
/* 295 */
"qom-list-properties",
"memory-backend-file.discard-data",
);
......@@ -1375,6 +1376,15 @@ static virQEMUCapsObjectTypeProps virQEMUCapsDeviceProps[] = {
QEMU_CAPS_DEVICE_VIRTIO_GPU_CCW },
};
static struct virQEMUCapsStringFlags virQEMUCapsObjectPropsMemoryBackendFile[] = {
{ "discard-data", QEMU_CAPS_OBJECT_MEMORY_FILE_DISCARD },
};
static virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = {
{ "memory-backend-file", virQEMUCapsObjectPropsMemoryBackendFile,
ARRAY_CARDINALITY(virQEMUCapsObjectPropsMemoryBackendFile),
QEMU_CAPS_OBJECT_MEMORY_FILE },
};
static void
virQEMUCapsProcessStringFlags(virQEMUCapsPtr qemuCaps,
......@@ -2132,6 +2142,14 @@ virQEMUCapsProbeQMPDevices(virQEMUCapsPtr qemuCaps,
qemuMonitorGetDeviceProps) < 0)
return -1;
if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_QOM_LIST_PROPERTIES) &&
virQEMUCapsProbeQMPGenericProps(qemuCaps,
mon,
virQEMUCapsObjectProps,
ARRAY_CARDINALITY(virQEMUCapsObjectProps),
qemuMonitorGetObjectProps) < 0)
return -1;
return 0;
}
......
......@@ -463,6 +463,7 @@ typedef enum { /* virQEMUCapsFlags grouping marker for syntax-check */
/* 295 */
QEMU_CAPS_QOM_LIST_PROPERTIES, /* qom-list-properties monitor command */
QEMU_CAPS_OBJECT_MEMORY_FILE_DISCARD, /* -object memory-backend-file,discard-data */
QEMU_CAPS_LAST /* this must always be the last item */
} virQEMUCapsFlags;
......
......@@ -5275,6 +5275,60 @@
"id": "libvirt-35"
}
{
"return": [
{
"name": "policy",
"type": "HostMemPolicy"
},
{
"name": "dump",
"type": "bool"
},
{
"name": "share",
"type": "bool"
},
{
"name": "prealloc",
"type": "bool"
},
{
"name": "size",
"type": "int"
},
{
"name": "host-nodes",
"type": "int"
},
{
"name": "id",
"type": "string"
},
{
"name": "merge",
"type": "bool"
},
{
"name": "align",
"type": "int"
},
{
"name": "mem-path",
"type": "string"
},
{
"name": "discard-data",
"type": "bool"
},
{
"name": "type",
"type": "string"
}
],
"id": "libvirt-36"
}
{
"return": [
{
......@@ -5569,7 +5623,7 @@
"cpu-max": 1
}
],
"id": "libvirt-36"
"id": "libvirt-37"
}
{
......@@ -5745,20 +5799,20 @@
"static": false
}
],
"id": "libvirt-37"
"id": "libvirt-38"
}
{
"return": [
],
"id": "libvirt-38"
"id": "libvirt-39"
}
{
"return": [
"emulator"
],
"id": "libvirt-39"
"id": "libvirt-40"
}
{
......@@ -6919,7 +6973,7 @@
"option": "drive"
}
],
"id": "libvirt-40"
"id": "libvirt-41"
}
{
......@@ -6981,7 +7035,7 @@
"capability": "dirty-bitmaps"
}
],
"id": "libvirt-41"
"id": "libvirt-42"
}
{
......@@ -18349,7 +18403,7 @@
"meta-type": "object"
}
],
"id": "libvirt-42"
"id": "libvirt-43"
}
{
......@@ -18365,7 +18419,7 @@
"kernel": false
}
],
"id": "libvirt-43"
"id": "libvirt-44"
}
{
......
......@@ -160,9 +160,10 @@
<flag name='nbd-tls'/>
<flag name='pr-manager-helper'/>
<flag name='qom-list-properties'/>
<flag name='memory-backend-file.discard-data'/>
<version>2011090</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>342346</microcodeVersion>
<microcodeVersion>343099</microcodeVersion>
<package>v2.12.0-rc0</package>
<arch>aarch64</arch>
<cpu type='kvm' name='pxa262'/>
......
......@@ -5322,6 +5322,60 @@
"id": "libvirt-36"
}
{
"return": [
{
"name": "policy",
"type": "HostMemPolicy"
},
{
"name": "dump",
"type": "bool"
},
{
"name": "share",
"type": "bool"
},
{
"name": "prealloc",
"type": "bool"
},
{
"name": "size",
"type": "int"
},
{
"name": "host-nodes",
"type": "int"
},
{
"name": "id",
"type": "string"
},
{
"name": "merge",
"type": "bool"
},
{
"name": "align",
"type": "int"
},
{
"name": "mem-path",
"type": "string"
},
{
"name": "discard-data",
"type": "bool"
},
{
"name": "type",
"type": "string"
}
],
"id": "libvirt-37"
}
{
"return": [
{
......@@ -5457,7 +5511,7 @@
"cpu-max": 1
}
],
"id": "libvirt-37"
"id": "libvirt-38"
}
{
......@@ -7653,20 +7707,20 @@
"static": false
}
],
"id": "libvirt-38"
"id": "libvirt-39"
}
{
"return": [
],
"id": "libvirt-39"
"id": "libvirt-40"
}
{
"return": [
"emulator"
],
"id": "libvirt-40"
"id": "libvirt-41"
}
{
......@@ -8822,7 +8876,7 @@
"option": "drive"
}
],
"id": "libvirt-41"
"id": "libvirt-42"
}
{
......@@ -8884,7 +8938,7 @@
"capability": "dirty-bitmaps"
}
],
"id": "libvirt-42"
"id": "libvirt-43"
}
{
......@@ -20252,7 +20306,7 @@
"meta-type": "object"
}
],
"id": "libvirt-43"
"id": "libvirt-44"
}
{
......
......@@ -157,9 +157,10 @@
<flag name='nbd-tls'/>
<flag name='pr-manager-helper'/>
<flag name='qom-list-properties'/>
<flag name='memory-backend-file.discard-data'/>
<version>2011090</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>419215</microcodeVersion>
<microcodeVersion>419968</microcodeVersion>
<package>v2.12.0-rc0</package>
<arch>ppc64</arch>
<cpu type='kvm' name='default'/>
......
......@@ -3614,6 +3614,60 @@
"id": "libvirt-34"
}
{
"return": [
{
"name": "policy",
"type": "HostMemPolicy"
},
{
"name": "dump",
"type": "bool"
},
{
"name": "share",
"type": "bool"
},
{
"name": "prealloc",
"type": "bool"
},
{
"name": "size",
"type": "int"
},
{
"name": "host-nodes",
"type": "int"
},
{
"name": "id",
"type": "string"
},
{
"name": "merge",
"type": "bool"
},
{
"name": "align",
"type": "int"
},
{
"name": "mem-path",
"type": "string"
},
{
"name": "discard-data",
"type": "bool"
},
{
"name": "type",
"type": "string"
}
],
"id": "libvirt-35"
}
{
"return": [
{
......@@ -3669,7 +3723,7 @@
"alias": "s390-ccw-virtio"
}
],
"id": "libvirt-35"
"id": "libvirt-36"
}
{
......@@ -6324,20 +6378,20 @@
"migration-safe": true
}
],
"id": "libvirt-36"
"id": "libvirt-37"
}
{
"return": [
],
"id": "libvirt-37"
"id": "libvirt-38"
}
{
"return": [
"emulator"
],
"id": "libvirt-38"
"id": "libvirt-39"
}
{
......@@ -7493,7 +7547,7 @@
"option": "drive"
}
],
"id": "libvirt-39"
"id": "libvirt-40"
}
{
......@@ -7555,7 +7609,7 @@
"capability": "dirty-bitmaps"
}
],
"id": "libvirt-40"
"id": "libvirt-41"
}
{
......@@ -18923,11 +18977,11 @@
"meta-type": "object"
}
],
"id": "libvirt-41"
"id": "libvirt-42"
}
{
"id": "libvirt-42",
"id": "libvirt-43",
"error": {
"class": "GenericError",
"desc": "The CPU definition 'max' is unknown."
......
......@@ -122,6 +122,7 @@
<flag name='nbd-tls'/>
<flag name='pr-manager-helper'/>
<flag name='qom-list-properties'/>
<flag name='memory-backend-file.discard-data'/>
<version>2011090</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>0</microcodeVersion>
......
......@@ -4605,6 +4605,60 @@
"id": "libvirt-39"
}
{
"return": [
{
"name": "policy",
"type": "HostMemPolicy"
},
{
"name": "dump",
"type": "bool"
},
{
"name": "share",
"type": "bool"
},
{
"name": "prealloc",
"type": "bool"
},
{
"name": "size",
"type": "int"
},
{
"name": "host-nodes",
"type": "int"
},
{
"name": "id",
"type": "string"
},
{
"name": "merge",
"type": "bool"
},
{
"name": "align",
"type": "int"
},
{
"name": "mem-path",
"type": "string"
},
{
"name": "discard-data",
"type": "bool"
},
{
"name": "type",
"type": "string"
}
],
"id": "libvirt-40"
}
{
"return": [
{
......@@ -4801,7 +4855,7 @@
"cpu-max": 255
}
],
"id": "libvirt-40"
"id": "libvirt-41"
}
{
......@@ -5315,7 +5369,7 @@
"migration-safe": true
}
],
"id": "libvirt-41"
"id": "libvirt-42"
}
{
......@@ -5323,7 +5377,7 @@
"tpm-crb",
"tpm-tis"
],
"id": "libvirt-42"
"id": "libvirt-43"
}
{
......@@ -5331,7 +5385,7 @@
"passthrough",
"emulator"
],
"id": "libvirt-43"
"id": "libvirt-44"
}
{
......@@ -6618,7 +6672,7 @@
"option": "drive"
}
],
"id": "libvirt-44"
"id": "libvirt-45"
}
{
......@@ -6680,7 +6734,7 @@
"capability": "dirty-bitmaps"
}
],
"id": "libvirt-45"
"id": "libvirt-46"
}
{
......@@ -18048,7 +18102,7 @@
"meta-type": "object"
}
],
"id": "libvirt-46"
"id": "libvirt-47"
}
{
......@@ -18238,7 +18292,7 @@
}
}
},
"id": "libvirt-47"
"id": "libvirt-48"
}
{
......@@ -18493,7 +18547,7 @@
}
}
},
"id": "libvirt-48"
"id": "libvirt-49"
}
{
......@@ -18683,7 +18737,7 @@
}
}
},
"id": "libvirt-49"
"id": "libvirt-50"
}
{
......@@ -18938,7 +18992,7 @@
}
}
},
"id": "libvirt-50"
"id": "libvirt-51"
}
{
......
......@@ -198,9 +198,10 @@
<flag name='tpm-crb'/>
<flag name='pr-manager-helper'/>
<flag name='qom-list-properties'/>
<flag name='memory-backend-file.discard-data'/>
<version>2011090</version>
<kvmVersion>0</kvmVersion>
<microcodeVersion>390060</microcodeVersion>
<microcodeVersion>390813</microcodeVersion>
<package>v2.12.0-rc0</package>
<arch>x86_64</arch>
<hostCPU type='kvm' model='base' migratability='yes'>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册