From: Peter Krempa Date: Fri, 30 Sep 2016 10:45:59 +0000 (+0200) Subject: qemu: Don't strictly require JSON monitor for vCPU detection X-Git-Tag: v2.4.0-rc1~217 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=62135ff692044a0a7cac5ee91f2cb42463550052;p=thirdparty%2Flibvirt.git 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 --- diff --git a/src/qemu/qemu_monitor.c b/src/qemu/qemu_monitor.c index 8083a36e99..5175f4eaa8 100644 --- a/src/qemu/qemu_monitor.c +++ b/src/qemu/qemu_monitor.c @@ -1898,14 +1898,14 @@ qemuMonitorGetCPUInfo(qemuMonitorPtr mon, int rc; qemuMonitorCPUInfoPtr info = NULL; - if (hotplug) - QEMU_CHECK_MONITOR_JSON(mon); - else - QEMU_CHECK_MONITOR(mon); + QEMU_CHECK_MONITOR(mon); if (VIR_ALLOC_N(info, maxvcpus) < 0) return -1; + if (!mon->json) + hotplug = false; + /* initialize a few non-zero defaults */ qemuMonitorCPUInfoClear(info, maxvcpus);