提交 902f4bce 编写于 作者: P Peter Krempa

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=1598829Signed-off-by: NPeter Krempa <pkrempa@redhat.com>
Reviewed-by: NDaniel P. Berrangé <berrange@redhat.com>
上级 1e65d35b
......@@ -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");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册