File eefabb38-rpc-virtlockd-virtlogd-single-thread.patch of Package libvirt.8367

commit eefabb38c34cb61edcb4a233ebc7c764547e515e
Author: Daniel P. Berrangé <berrange@redhat.com>
Date:   Tue Mar 6 17:12:20 2018 +0000

    rpc: switch virtlockd and virtlogd to use single-threaded dispatch
    
    Currently both virtlogd and virtlockd use a single worker thread for
    dispatching RPC messages. Even this is overkill and their RPC message
    handling callbacks all run in short, finite time and so blocking the
    main loop is not an issue like you'd see in libvirtd with long running
    QEMU commands.
    
    By setting max_workers==0, we can turn off the worker thread and run
    these daemons single threaded. This in turn fixes a serious problem in
    the virtlockd daemon whereby it loses all fcntl() locks at re-exec due
    to multiple threads existing. fcntl() locks only get preserved if the
    process is single threaded at time of exec().
    
    Reviewed-by: John Ferlan <jferlan@redhat.com>
    Reviewed-by: Jim Fehlig <jfehlig@suse.com>
    Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>

Index: libvirt-4.0.0/src/locking/lock_daemon.c
===================================================================
--- libvirt-4.0.0.orig/src/locking/lock_daemon.c
+++ libvirt-4.0.0/src/locking/lock_daemon.c
@@ -161,7 +161,7 @@ virLockDaemonNew(virLockDaemonConfigPtr
     }
 
     if (!(srv = virNetServerNew("virtlockd", 1,
-                                1, 1, 0, config->max_clients,
+                                0, 0, 0, config->max_clients,
                                 config->max_clients, -1, 0,
                                 NULL,
                                 virLockDaemonClientNew,
Index: libvirt-4.0.0/src/logging/log_daemon.c
===================================================================
--- libvirt-4.0.0.orig/src/logging/log_daemon.c
+++ libvirt-4.0.0/src/logging/log_daemon.c
@@ -150,7 +150,7 @@ virLogDaemonNew(virLogDaemonConfigPtr co
     }
 
     if (!(srv = virNetServerNew("virtlogd", 1,
-                                1, 1, 0, config->max_clients,
+                                0, 0, 0, config->max_clients,
                                 config->max_clients, -1, 0,
                                 NULL,
                                 virLogDaemonClientNew,