]> 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 12:49:42 +0000 (13:49 +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.

(cherry picked from commit b87a11340fb444f669d1a3e2ffb3680490c10134)

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

index 2ca78031cb2dcbfaec11b7652b52a6a2d9fe4abb..f0b70d5684905854dfe31fae95f89b7129fab8a9 100644 (file)
@@ -2817,23 +2817,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;
-}
-
 
 /*
  * Parsing a doc that looks like
index a74d39f2b93ae7aacb393f224f603a0a8c6b48e4..e0f4d6ee003adf7c6d245e3b024500ece68edb77 100644 (file)
@@ -390,9 +390,6 @@ virQEMUCapsPtr virQEMUCapsNew(void);
 int virQEMUCapsInitQMPMonitor(virQEMUCapsPtr qemuCaps,
                               qemuMonitorPtr mon);
 
-int virQEMUCapsProbeQMP(virQEMUCapsPtr qemuCaps,
-                        qemuMonitorPtr mon);
-
 void virQEMUCapsSet(virQEMUCapsPtr qemuCaps,
                     virQEMUCapsFlags flag) ATTRIBUTE_NONNULL(1);
 
index b10b05359d236f1cbd95ec0da3a88e1a2cc71983..03ccf4d8c2657cd79e1e8fdd84dc16f3b7f8222b 100644 (file)
@@ -1726,10 +1726,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,