]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
daemon: Raise an error if 'max_workers' < 1 in libvirtd.conf
authorMarc Hartmayer <mhartmay@linux.ibm.com>
Tue, 3 Jul 2018 11:37:36 +0000 (13:37 +0200)
committerJohn Ferlan <jferlan@redhat.com>
Sat, 21 Jul 2018 11:46:45 +0000 (07:46 -0400)
Hypervisor drivers (e.g. QEMU) assume that they run in a separate
thread from the main event loop thread otherwise deadlocks can
occur. Therefore let's report an error if max_workers < 1 is set in
the libvirtd configuration file.

Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.ibm.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
src/remote/remote_daemon_config.c

index b1516befb4a6e853ce76e9d2520cdebad9647939..27e0c635f1bed2dcfd11140c338c60ec9d1306c6 100644 (file)
@@ -337,6 +337,11 @@ daemonConfigLoadOptions(struct daemonConfig *data,
         goto error;
     if (virConfGetValueUInt(conf, "max_workers", &data->max_workers) < 0)
         goto error;
+    if (data->max_workers < 1) {
+        virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
+                       _("'max_workers' must be greater than 0"));
+        goto error;
+    }
     if (virConfGetValueUInt(conf, "max_clients", &data->max_clients) < 0)
         goto error;
     if (virConfGetValueUInt(conf, "max_queued_clients", &data->max_queued_clients) < 0)