render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
9c6c51
From d801cf83a1f453f034147e83bce0c9665d911c26 Mon Sep 17 00:00:00 2001
9c6c51
Message-Id: <d801cf83a1f453f034147e83bce0c9665d911c26@dist-git>
9c6c51
From: Peter Krempa <pkrempa@redhat.com>
9c6c51
Date: Tue, 4 Sep 2018 16:41:31 +0200
9c6c51
Subject: [PATCH] qemu: monitor: Use 'target' instead of 'arch' in reply of
9c6c51
 'query-cpus-fast'
9c6c51
MIME-Version: 1.0
9c6c51
Content-Type: text/plain; charset=UTF-8
9c6c51
Content-Transfer-Encoding: 8bit
9c6c51
9c6c51
qemu changed the output field name for the architecture from 'arch' to
9c6c51
'target'. Note the change and fix the code so that the arch-specific
9c6c51
extraction works.
9c6c51
9c6c51
https://bugzilla.redhat.com/show_bug.cgi?id=1598829
9c6c51
9c6c51
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
9c6c51
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
9c6c51
(cherry picked from commit 902f4bce098d68c48899fc1c42ec1552f2104995)
9c6c51
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1598829
9c6c51
Reviewed-by: Ján Tomko <jtomko@redhat.com>
9c6c51
---
9c6c51
 src/qemu/qemu_monitor_json.c | 6 +++++-
9c6c51
 1 file changed, 5 insertions(+), 1 deletion(-)
9c6c51
9c6c51
diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
9c6c51
index e7e6658075..d6c11666c5 100644
9c6c51
--- a/src/qemu/qemu_monitor_json.c
9c6c51
+++ b/src/qemu/qemu_monitor_json.c
9c6c51
@@ -1647,6 +1647,9 @@ qemuMonitorJSONExtractCPUS390Info(virJSONValuePtr jsoncpu,
9c6c51
  *    ...},
9c6c51
  *    {...}
9c6c51
  *  ]
9c6c51
+ *
9c6c51
+ *  Note that since QEMU 2.13.0 the "arch" output member of the
9c6c51
+ *  "query-cpus-fast" command is replaced by "target".
9c6c51
  */
9c6c51
 static int
9c6c51
 qemuMonitorJSONExtractCPUInfo(virJSONValuePtr data,
9c6c51
@@ -1682,7 +1685,8 @@ qemuMonitorJSONExtractCPUInfo(virJSONValuePtr data,
9c6c51
          * The return data of query-cpus-fast has different field names
9c6c51
          */
9c6c51
         if (fast) {
9c6c51
-            arch = virJSONValueObjectGetString(entry, "arch");
9c6c51
+            if (!(arch = virJSONValueObjectGetString(entry, "target")))
9c6c51
+                arch = virJSONValueObjectGetString(entry, "arch");
9c6c51
             ignore_value(virJSONValueObjectGetNumberInt(entry, "cpu-index", &cpuid));
9c6c51
             ignore_value(virJSONValueObjectGetNumberInt(entry, "thread-id", &thread));
9c6c51
             qom_path = virJSONValueObjectGetString(entry, "qom-path");
9c6c51
-- 
9c6c51
2.18.0
9c6c51