[libvirt] [PATCH v2 4/6] daemon: Raise an error if 'max_workers' < 1 in libvirtd.conf

Marc Hartmayer posted 6 patches 6 years, 10 months ago
[libvirt] [PATCH v2 4/6] daemon: Raise an error if 'max_workers' < 1 in libvirtd.conf
Posted by Marc Hartmayer 6 years, 10 months ago
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>
---
 src/remote/remote_daemon_config.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/remote/remote_daemon_config.c b/src/remote/remote_daemon_config.c
index b1516befb4a6..27e0c635f1be 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)
-- 
2.13.4

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v2 4/6] daemon: Raise an error if 'max_workers' < 1 in libvirtd.conf
Posted by John Ferlan 6 years, 9 months ago

On 07/03/2018 07:37 AM, Marc Hartmayer wrote:
> 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>
> ---
>  src/remote/remote_daemon_config.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 

Reviewed-by: John Ferlan <jferlan@redhat.com>

John

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list