]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: capabilities: Don't partially reprope caps on process reconnect
authorPeter Krempa <pkrempa@redhat.com>
Fri, 25 Nov 2016 16:08:25 +0000 (17:08 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 28 Nov 2016 09:02:36 +0000 (10:02 +0100)
Thanks to the complex capability caching code virQEMUCapsProbeQMP was
never called when we were starting a new qemu VM. On the other hand,
when we are reconnecting to the qemu process we reload the capability
list from the status XML file. This means that the flag preventing the
function being called was not set and thus we partially reprobed some of
the capabilities.

The recent addition of CPU hotplug clears the
QEMU_CAPS_QUERY_HOTPLUGGABLE_CPUS if the machine does not support it.
The partial re-probe on reconnect results into attempting to call the
unsupported command and then killing the VM.

Remove the partial reprobe and depend on the stored capabilities. If it
will be necessary to reprobe the capabilities in the future, we should
do a full reprobe rather than this partial one.

src/qemu/qemu_capabilities.c
src/qemu/qemu_capabilities.h
src/qemu/qemu_process.c

index ad9451e8f86c35955095b118281d48192b42cbab..45ab5bbb68014c3a1894610a16fcc3d3f3844b8b 100644 (file)
@@ -3000,23 +3000,6 @@ virQEMUCapsProbeQMPGICCapabilities(virQEMUCapsPtr qemuCaps,
     return 0;
 }
 
-int virQEMUCapsProbeQMP(virQEMUCapsPtr qemuCaps,
-                        qemuMonitorPtr mon)
-{
-    VIR_DEBUG("qemuCaps=%p mon=%p", qemuCaps, mon);
-
-    if (qemuCaps->usedQMP)
-        return 0;
-
-    if (virQEMUCapsProbeQMPCommands(qemuCaps, mon) < 0)
-        return -1;
-
-    if (virQEMUCapsProbeQMPEvents(qemuCaps, mon) < 0)
-        return -1;
-
-    return 0;
-}
-
 
 static bool
 virQEMUCapsCPUFilterFeatures(const char *name,
index b3175a5211e24f45b3b812aed6918afec8790642..ee4bbb329f76bdfbc898f80cf819c11947220ec7 100644 (file)
@@ -400,9 +400,6 @@ typedef virQEMUCapsCache *virQEMUCapsCachePtr;
 
 virQEMUCapsPtr virQEMUCapsNew(void);
 
-int virQEMUCapsProbeQMP(virQEMUCapsPtr qemuCaps,
-                        qemuMonitorPtr mon);
-
 void virQEMUCapsSet(virQEMUCapsPtr qemuCaps,
                     virQEMUCapsFlags flag) ATTRIBUTE_NONNULL(1);
 
index 64a3f95ea4c1dab321816ac480b43a2b625295c8..4b82a971d28ef5cbbaba96d9f29b86d119b6dd77 100644 (file)
@@ -1723,10 +1723,6 @@ qemuConnectMonitor(virQEMUDriverPtr driver, virDomainObjPtr vm, int asyncJob,
     if (qemuMonitorSetCapabilities(priv->mon) < 0)
         goto cleanup;
 
-    if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MONITOR_JSON) &&
-        virQEMUCapsProbeQMP(priv->qemuCaps, priv->mon) < 0)
-        goto cleanup;
-
     if (virQEMUCapsGet(priv->qemuCaps, QEMU_CAPS_MIGRATION_EVENT) &&
         qemuMonitorSetMigrationCapability(priv->mon,
                                           QEMU_MONITOR_MIGRATION_CAPS_EVENTS,