[PATCH v2 2/2] qemu: monitor: Use 'target' instead of 'arch' in reply of 'query-cpus-fast'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 src/qemu/qemu_monitor_json.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index fc5cec42dd..f9fe9e35ba 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -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");
-- 
2.16.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux