diff options
author | Peter Krempa <pkrempa@redhat.com> | 2016-12-04 18:53:03 +0100 |
---|---|---|
committer | Peter Krempa <pkrempa@redhat.com> | 2017-01-18 09:57:06 +0100 |
commit | 5cd670fea8d100e07d47cf26fa301e60b0e7ef3c (patch) | |
tree | f2cd40eff5ffca8075a316f327aa9bf2eb7ffbbe /src/qemu/qemu_monitor.c | |
parent | 35296ad4a79d4d99b94ec2125dd0d49f1e3534f7 (diff) | |
download | libvirt-5cd670fea8d100e07d47cf26fa301e60b0e7ef3c.tar.gz |
qemu: monitor: More strict checking of 'query-cpus' if hotplug is supported
In cases where CPU hotplug is supported by qemu force the monitor to
reject invalid or broken responses to 'query-cpus'. It's expected that
the command returns usable data in such case.
Diffstat (limited to 'src/qemu/qemu_monitor.c')
-rw-r--r-- | src/qemu/qemu_monitor.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 1610ae3f4e..b7be5e7f47 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -1921,12 +1921,12 @@ qemuMonitorGetCPUInfo(qemuMonitorPtr mon, goto cleanup; if (mon->json) - rc = qemuMonitorJSONQueryCPUs(mon, &cpuentries, &ncpuentries); + rc = qemuMonitorJSONQueryCPUs(mon, &cpuentries, &ncpuentries, hotplug); else rc = qemuMonitorTextQueryCPUs(mon, &cpuentries, &ncpuentries); if (rc < 0) { - if (rc == -2) { + if (!hotplug && rc == -2) { VIR_STEAL_PTR(*vcpus, info); ret = 0; } @@ -1974,7 +1974,7 @@ qemuMonitorGetCpuHalted(qemuMonitorPtr mon, QEMU_CHECK_MONITOR_NULL(mon); if (mon->json) - rc = qemuMonitorJSONQueryCPUs(mon, &cpuentries, &ncpuentries); + rc = qemuMonitorJSONQueryCPUs(mon, &cpuentries, &ncpuentries, false); else rc = qemuMonitorTextQueryCPUs(mon, &cpuentries, &ncpuentries); |