]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Don't strictly require JSON monitor for vCPU detection
authorPeter Krempa <pkrempa@redhat.com>
Fri, 30 Sep 2016 10:45:59 +0000 (12:45 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 5 Oct 2016 06:52:33 +0000 (08:52 +0200)
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

index 8083a36e990ce05a960496b9840415a9277615e4..5175f4eaa890dab39b9694d1d77eeb1702c2624a 100644 (file)
@@ -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);