[libvirt] [PATCH] libvirt: qemu: Fix domain termination caused by query-hotpluggable-cpus not enabled

Boris Fiuczynski fiuczy at linux.vnet.ibm.com
Fri Nov 25 08:19:18 UTC 2016


(Re-)Starting libvirt on a system with running qemu domains which earlier
had been successfully started by libvirt results in the error

internal error: unable to execute QEMU command 'query-hotpluggable-cpus':
  The feature 'query-hotpluggable-cpus' is not enabled

if the qemu binary does not support the qmp command 'query-hotpluggable-cpus'.

As libvirt tries to reconnect to the running qemu domains it reads in the
capabilities but in qemuProcessReconnect misses to run
virQEMUCapsCacheLookupCopy and not clearing the query-hotpluggable-cpus
capability in virQEMUCapsFilterByMachineType which was introduced with
commit 920bbe5c.
Libvirt therefore issues the qmp command and qemu responds with the error
'The feature 'query-hotpluggable-cpus' is not enabled'.
As a consequence libvirt terminates the running qemu process since it
determines that it cannot reconnect to the domain.

Signed-off-by: Boris Fiuczynski <fiuczy at linux.vnet.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay at linux.vnet.ibm.com>
---
Due to the severity of this issue I recommend to backport this fix
into all maintenance releases up to v2.2.0.

 src/qemu/qemu_process.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c
index f8f379a..675f5b5 100644
--- a/src/qemu/qemu_process.c
+++ b/src/qemu/qemu_process.c
@@ -3349,8 +3349,7 @@ qemuProcessReconnect(void *opaque)
     /* If upgrading from old libvirtd we won't have found any
      * caps in the domain status, so re-query them
      */
-    if (!priv->qemuCaps &&
-        !(priv->qemuCaps = virQEMUCapsCacheLookupCopy(caps,
+    if (!(priv->qemuCaps = virQEMUCapsCacheLookupCopy(caps,
                                                       driver->qemuCapsCache,
                                                       obj->def->emulator,
                                                       obj->def->os.machine)))
-- 
2.5.5




More information about the libvir-list mailing list