1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

qemu: monitor: Use 'target' instead of 'arch' in reply of 'query-cpus-fast'

qemu changed the output field name for the architecture from 'arch' to
'target'. Note the change and fix the code so that the arch-specific
extraction works.

https://bugzilla.redhat.com/show_bug.cgi?id=1598829

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
Peter Krempa 2018-07-09 12:32:39 +02:00
parent 1e65d35b04
commit 902f4bce09

View File

@ -1624,6 +1624,9 @@ qemuMonitorJSONExtractCPUS390Info(virJSONValuePtr jsoncpu,
* ...},
* {...}
* ]
*
* Note that since QEMU 2.13.0 the "arch" output member of the
* "query-cpus-fast" command is replaced by "target".
*/
static int
qemuMonitorJSONExtractCPUInfo(virJSONValuePtr data,
@ -1659,7 +1662,8 @@ qemuMonitorJSONExtractCPUInfo(virJSONValuePtr data,
* The return data of query-cpus-fast has different field names
*/
if (fast) {
arch = virJSONValueObjectGetString(entry, "arch");
if (!(arch = virJSONValueObjectGetString(entry, "target")))
arch = virJSONValueObjectGetString(entry, "arch");
ignore_value(virJSONValueObjectGetNumberInt(entry, "cpu-index", &cpuid));
ignore_value(virJSONValueObjectGetNumberInt(entry, "thread-id", &thread));
qom_path = virJSONValueObjectGetString(entry, "qom-path");