]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: monitor: Use 'target' instead of 'arch' in reply of 'query-cpus-fast'
authorPeter Krempa <pkrempa@redhat.com>
Mon, 9 Jul 2018 10:32:39 +0000 (12:32 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 9 Jul 2018 14:18:53 +0000 (16:18 +0200)
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>
src/qemu/qemu_monitor_json.c

index fc5cec42ddb5c46f2f9850cf8b93e4f77e2f444c..f9fe9e35ba7d670ce66b48dd98e0358b5f79b2c3 100644 (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");