From: Marc Hartmayer Date: Tue, 3 Jul 2018 11:37:36 +0000 (+0200) Subject: daemon: Raise an error if 'max_workers' < 1 in libvirtd.conf X-Git-Tag: v4.6.0-rc1~131 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=71e4d4a2a19302c2b8a4c419f75f53e0544165e6;p=thirdparty%2Flibvirt.git daemon: Raise an error if 'max_workers' < 1 in libvirtd.conf 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 Reviewed-by: Boris Fiuczynski Reviewed-by: Bjoern Walk Reviewed-by: John Ferlan --- diff --git a/src/remote/remote_daemon_config.c b/src/remote/remote_daemon_config.c index b1516befb4..27e0c635f1 100644 --- a/src/remote/remote_daemon_config.c +++ b/src/remote/remote_daemon_config.c @@ -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)