提交 d22c6221 编写于 作者: A Andrea Bolognani

qemu: Probe canonicalized machine type

Now that we have the list of machine types available when
probing machine type properties, we can list properties for
the canonicalized version of the "pseries" machine type
instead of having to go through "spapr-machine", which we
know to be the parent type for all "pseries-*-machine"
types. By doing this, we'll be able to find even properties
that are only available from a certain versioned machine
type forward, and can't thus be obtained when looking at
the parent type only.
Signed-off-by: NAndrea Bolognani <abologna@redhat.com>
Reviewed-by: NPavel Hrdina <phrdina@redhat.com>
上级 f3f9d8e3
...@@ -1400,15 +1400,15 @@ static virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = { ...@@ -1400,15 +1400,15 @@ static virQEMUCapsObjectTypeProps virQEMUCapsObjectProps[] = {
QEMU_CAPS_OBJECT_MEMORY_MEMFD }, QEMU_CAPS_OBJECT_MEMORY_MEMFD },
}; };
static struct virQEMUCapsStringFlags virQEMUCapsMachinePropsSPAPR[] = { static struct virQEMUCapsStringFlags virQEMUCapsMachinePropsPSeries[] = {
{ "cap-hpt-max-page-size", QEMU_CAPS_MACHINE_PSERIES_CAP_HPT_MAX_PAGE_SIZE }, { "cap-hpt-max-page-size", QEMU_CAPS_MACHINE_PSERIES_CAP_HPT_MAX_PAGE_SIZE },
{ "cap-htm", QEMU_CAPS_MACHINE_PSERIES_CAP_HTM }, { "cap-htm", QEMU_CAPS_MACHINE_PSERIES_CAP_HTM },
{ "cap-nested-hv", QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV }, { "cap-nested-hv", QEMU_CAPS_MACHINE_PSERIES_CAP_NESTED_HV },
}; };
static virQEMUCapsObjectTypeProps virQEMUCapsMachineProps[] = { static virQEMUCapsObjectTypeProps virQEMUCapsMachineProps[] = {
{ "spapr", virQEMUCapsMachinePropsSPAPR, { "pseries", virQEMUCapsMachinePropsPSeries,
ARRAY_CARDINALITY(virQEMUCapsMachinePropsSPAPR), ARRAY_CARDINALITY(virQEMUCapsMachinePropsPSeries),
-1 }, -1 },
}; };
...@@ -2357,11 +2357,12 @@ virQEMUCapsProbeQMPMachineProps(virQEMUCapsPtr qemuCaps, ...@@ -2357,11 +2357,12 @@ virQEMUCapsProbeQMPMachineProps(virQEMUCapsPtr qemuCaps,
for (i = 0; i < ARRAY_CARDINALITY(virQEMUCapsMachineProps); i++) { for (i = 0; i < ARRAY_CARDINALITY(virQEMUCapsMachineProps); i++) {
virQEMUCapsObjectTypeProps props = virQEMUCapsMachineProps[i]; virQEMUCapsObjectTypeProps props = virQEMUCapsMachineProps[i];
const char *canon = virQEMUCapsGetCanonicalMachine(qemuCaps, props.type);
VIR_AUTOFREE(char *) type = NULL; VIR_AUTOFREE(char *) type = NULL;
/* The QOM type for machine types is the machine type name /* The QOM type for machine types is the machine type name
* followed by the -machine suffix */ * followed by the -machine suffix */
if (virAsprintf(&type, "%s-machine", props.type) < 0) if (virAsprintf(&type, "%s-machine", canon) < 0)
return -1; return -1;
if ((nvalues = qemuMonitorGetObjectProps(mon, type, &values)) < 0) if ((nvalues = qemuMonitorGetObjectProps(mon, type, &values)) < 0)
......
...@@ -5635,7 +5635,7 @@ ...@@ -5635,7 +5635,7 @@
{ {
"execute": "qom-list-properties", "execute": "qom-list-properties",
"arguments": { "arguments": {
"typename": "spapr-machine" "typename": "pseries-machine"
}, },
"id": "libvirt-32" "id": "libvirt-32"
} }
...@@ -5644,7 +5644,7 @@ ...@@ -5644,7 +5644,7 @@
"id": "libvirt-32", "id": "libvirt-32",
"error": { "error": {
"class": "DeviceNotFound", "class": "DeviceNotFound",
"desc": "Class 'spapr-machine' not found" "desc": "Class 'pseries-machine' not found"
} }
} }
......
...@@ -5531,7 +5531,7 @@ ...@@ -5531,7 +5531,7 @@
{ {
"execute": "qom-list-properties", "execute": "qom-list-properties",
"arguments": { "arguments": {
"typename": "spapr-machine" "typename": "pseries-2.12-machine"
}, },
"id": "libvirt-33" "id": "libvirt-33"
} }
......
...@@ -3811,7 +3811,7 @@ ...@@ -3811,7 +3811,7 @@
{ {
"execute": "qom-list-properties", "execute": "qom-list-properties",
"arguments": { "arguments": {
"typename": "spapr-machine" "typename": "pseries-machine"
}, },
"id": "libvirt-32" "id": "libvirt-32"
} }
...@@ -3820,7 +3820,7 @@ ...@@ -3820,7 +3820,7 @@
"id": "libvirt-32", "id": "libvirt-32",
"error": { "error": {
"class": "DeviceNotFound", "class": "DeviceNotFound",
"desc": "Class 'spapr-machine' not found" "desc": "Class 'pseries-machine' not found"
} }
} }
......
...@@ -4968,7 +4968,7 @@ ...@@ -4968,7 +4968,7 @@
{ {
"execute": "qom-list-properties", "execute": "qom-list-properties",
"arguments": { "arguments": {
"typename": "spapr-machine" "typename": "pseries-machine"
}, },
"id": "libvirt-38" "id": "libvirt-38"
} }
...@@ -4977,7 +4977,7 @@ ...@@ -4977,7 +4977,7 @@
"id": "libvirt-38", "id": "libvirt-38",
"error": { "error": {
"class": "DeviceNotFound", "class": "DeviceNotFound",
"desc": "Class 'spapr-machine' not found" "desc": "Class 'pseries-machine' not found"
} }
} }
......
...@@ -5616,7 +5616,7 @@ ...@@ -5616,7 +5616,7 @@
{ {
"execute": "qom-list-properties", "execute": "qom-list-properties",
"arguments": { "arguments": {
"typename": "spapr-machine" "typename": "pseries-3.0-machine"
}, },
"id": "libvirt-33" "id": "libvirt-33"
} }
......
...@@ -1700,7 +1700,7 @@ ...@@ -1700,7 +1700,7 @@
{ {
"execute": "qom-list-properties", "execute": "qom-list-properties",
"arguments": { "arguments": {
"typename": "spapr-machine" "typename": "pseries-machine"
}, },
"id": "libvirt-28" "id": "libvirt-28"
} }
...@@ -1709,7 +1709,7 @@ ...@@ -1709,7 +1709,7 @@
"id": "libvirt-28", "id": "libvirt-28",
"error": { "error": {
"class": "DeviceNotFound", "class": "DeviceNotFound",
"desc": "Class 'spapr-machine' not found" "desc": "Class 'pseries-machine' not found"
} }
} }
......
...@@ -1700,7 +1700,7 @@ ...@@ -1700,7 +1700,7 @@
{ {
"execute": "qom-list-properties", "execute": "qom-list-properties",
"arguments": { "arguments": {
"typename": "spapr-machine" "typename": "pseries-machine"
}, },
"id": "libvirt-28" "id": "libvirt-28"
} }
...@@ -1709,7 +1709,7 @@ ...@@ -1709,7 +1709,7 @@
"id": "libvirt-28", "id": "libvirt-28",
"error": { "error": {
"class": "DeviceNotFound", "class": "DeviceNotFound",
"desc": "Class 'spapr-machine' not found" "desc": "Class 'pseries-machine' not found"
} }
} }
......
...@@ -3970,7 +3970,7 @@ ...@@ -3970,7 +3970,7 @@
{ {
"execute": "qom-list-properties", "execute": "qom-list-properties",
"arguments": { "arguments": {
"typename": "spapr-machine" "typename": "pseries-machine"
}, },
"id": "libvirt-33" "id": "libvirt-33"
} }
...@@ -3979,7 +3979,7 @@ ...@@ -3979,7 +3979,7 @@
"id": "libvirt-33", "id": "libvirt-33",
"error": { "error": {
"class": "DeviceNotFound", "class": "DeviceNotFound",
"desc": "Class 'spapr-machine' not found" "desc": "Class 'pseries-machine' not found"
} }
} }
......
...@@ -5109,7 +5109,7 @@ ...@@ -5109,7 +5109,7 @@
{ {
"execute": "qom-list-properties", "execute": "qom-list-properties",
"arguments": { "arguments": {
"typename": "spapr-machine" "typename": "pseries-machine"
}, },
"id": "libvirt-38" "id": "libvirt-38"
} }
...@@ -5118,7 +5118,7 @@ ...@@ -5118,7 +5118,7 @@
"id": "libvirt-38", "id": "libvirt-38",
"error": { "error": {
"class": "DeviceNotFound", "class": "DeviceNotFound",
"desc": "Class 'spapr-machine' not found" "desc": "Class 'pseries-machine' not found"
} }
} }
......
...@@ -5696,7 +5696,7 @@ ...@@ -5696,7 +5696,7 @@
{ {
"execute": "qom-list-properties", "execute": "qom-list-properties",
"arguments": { "arguments": {
"typename": "spapr-machine" "typename": "pseries-3.1-machine"
}, },
"id": "libvirt-33" "id": "libvirt-33"
} }
......
...@@ -5182,7 +5182,7 @@ ...@@ -5182,7 +5182,7 @@
{ {
"execute": "qom-list-properties", "execute": "qom-list-properties",
"arguments": { "arguments": {
"typename": "spapr-machine" "typename": "pseries-machine"
}, },
"id": "libvirt-38" "id": "libvirt-38"
} }
...@@ -5191,7 +5191,7 @@ ...@@ -5191,7 +5191,7 @@
"id": "libvirt-38", "id": "libvirt-38",
"error": { "error": {
"class": "DeviceNotFound", "class": "DeviceNotFound",
"desc": "Class 'spapr-machine' not found" "desc": "Class 'pseries-machine' not found"
} }
} }
......
...@@ -6213,7 +6213,7 @@ ...@@ -6213,7 +6213,7 @@
{ {
"execute": "qom-list-properties", "execute": "qom-list-properties",
"arguments": { "arguments": {
"typename": "spapr-machine" "typename": "pseries-machine"
}, },
"id": "libvirt-33" "id": "libvirt-33"
} }
...@@ -6222,7 +6222,7 @@ ...@@ -6222,7 +6222,7 @@
"id": "libvirt-33", "id": "libvirt-33",
"error": { "error": {
"class": "DeviceNotFound", "class": "DeviceNotFound",
"desc": "Class 'spapr-machine' not found" "desc": "Class 'pseries-machine' not found"
} }
} }
......
...@@ -6079,7 +6079,7 @@ ...@@ -6079,7 +6079,7 @@
{ {
"execute": "qom-list-properties", "execute": "qom-list-properties",
"arguments": { "arguments": {
"typename": "spapr-machine" "typename": "pseries-4.0-machine"
}, },
"id": "libvirt-34" "id": "libvirt-34"
} }
......
...@@ -4082,7 +4082,7 @@ ...@@ -4082,7 +4082,7 @@
{ {
"execute": "qom-list-properties", "execute": "qom-list-properties",
"arguments": { "arguments": {
"typename": "spapr-machine" "typename": "pseries-machine"
}, },
"id": "libvirt-34" "id": "libvirt-34"
} }
...@@ -4091,7 +4091,7 @@ ...@@ -4091,7 +4091,7 @@
"id": "libvirt-34", "id": "libvirt-34",
"error": { "error": {
"class": "DeviceNotFound", "class": "DeviceNotFound",
"desc": "Class 'spapr-machine' not found" "desc": "Class 'pseries-machine' not found"
} }
} }
......
...@@ -4082,7 +4082,7 @@ ...@@ -4082,7 +4082,7 @@
{ {
"execute": "qom-list-properties", "execute": "qom-list-properties",
"arguments": { "arguments": {
"typename": "spapr-machine" "typename": "pseries-machine"
}, },
"id": "libvirt-34" "id": "libvirt-34"
} }
...@@ -4091,7 +4091,7 @@ ...@@ -4091,7 +4091,7 @@
"id": "libvirt-34", "id": "libvirt-34",
"error": { "error": {
"class": "DeviceNotFound", "class": "DeviceNotFound",
"desc": "Class 'spapr-machine' not found" "desc": "Class 'pseries-machine' not found"
} }
} }
......
...@@ -4283,7 +4283,7 @@ ...@@ -4283,7 +4283,7 @@
{ {
"execute": "qom-list-properties", "execute": "qom-list-properties",
"arguments": { "arguments": {
"typename": "spapr-machine" "typename": "pseries-machine"
}, },
"id": "libvirt-33" "id": "libvirt-33"
} }
...@@ -4292,7 +4292,7 @@ ...@@ -4292,7 +4292,7 @@
"id": "libvirt-33", "id": "libvirt-33",
"error": { "error": {
"class": "DeviceNotFound", "class": "DeviceNotFound",
"desc": "Class 'spapr-machine' not found" "desc": "Class 'pseries-machine' not found"
} }
} }
......
...@@ -5415,7 +5415,7 @@ ...@@ -5415,7 +5415,7 @@
{ {
"execute": "qom-list-properties", "execute": "qom-list-properties",
"arguments": { "arguments": {
"typename": "spapr-machine" "typename": "pseries-machine"
}, },
"id": "libvirt-38" "id": "libvirt-38"
} }
...@@ -5424,7 +5424,7 @@ ...@@ -5424,7 +5424,7 @@
"id": "libvirt-38", "id": "libvirt-38",
"error": { "error": {
"class": "DeviceNotFound", "class": "DeviceNotFound",
"desc": "Class 'spapr-machine' not found" "desc": "Class 'pseries-machine' not found"
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册