qemu: Don't strictly require JSON monitor for vCPU detection

Attaching to a existing qemu process allows to get us into a situation
when qemu is new enough to have JSON monitor and new vCPU hotplug but
the json monitor is not used. The vCPU detection code would require it
though. This broke attaching to qemu processes.

Make the condition less strict and just skip the vCPU hotplug detection
if JSON monitor is not available.

Resolves one of the symptoms in:
https://bugzilla.redhat.com/show_bug.cgi?id=1378401
This commit is contained in:
Peter Krempa 2016-09-30 12:45:59 +02:00
parent 1dcbb27402
commit 62135ff692

View File

@ -1898,14 +1898,14 @@ qemuMonitorGetCPUInfo(qemuMonitorPtr mon,
int rc; int rc;
qemuMonitorCPUInfoPtr info = NULL; qemuMonitorCPUInfoPtr info = NULL;
if (hotplug) QEMU_CHECK_MONITOR(mon);
QEMU_CHECK_MONITOR_JSON(mon);
else
QEMU_CHECK_MONITOR(mon);
if (VIR_ALLOC_N(info, maxvcpus) < 0) if (VIR_ALLOC_N(info, maxvcpus) < 0)
return -1; return -1;
if (!mon->json)
hotplug = false;
/* initialize a few non-zero defaults */ /* initialize a few non-zero defaults */
qemuMonitorCPUInfoClear(info, maxvcpus); qemuMonitorCPUInfoClear(info, maxvcpus);