From 62135ff692044a0a7cac5ee91f2cb42463550052 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Fri, 30 Sep 2016 12:45:59 +0200 Subject: [PATCH] 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 --- src/qemu/qemu_monitor.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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);