[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] PATCH: Fix autostart of session daemon



When connecting qemu:///session we can autostart the libvirtd daemon.
With the node device APIs present, it can take upto a second to start
up while talking to dbus. The remote driver was only waiting for a
fraction of a second. This changes it to wait for upto 2 seconds, and
also not to spawn multiple instances of the daemon.

Daniel

diff -rup libvirt-0.6.0.orig/src/remote_internal.c libvirt-0.6.0.new/src/remote_internal.c
--- libvirt-0.6.0.orig/src/remote_internal.c	2009-02-18 10:56:34.000000000 +0000
+++ libvirt-0.6.0.new/src/remote_internal.c	2009-02-18 13:35:26.000000000 +0000
@@ -654,12 +654,13 @@ doRemoteOpen (virConnectPtr conn,
              */
             if (errno == ECONNREFUSED &&
                 flags & VIR_DRV_OPEN_REMOTE_AUTOSTART &&
-                trials < 5) {
+                trials < 20) {
                 close(priv->sock);
                 priv->sock = -1;
-                if (remoteForkDaemon(conn) == 0) {
+                if (trials > 0 ||
+                    remoteForkDaemon(conn) == 0) {
                     trials++;
-                    usleep(5000 * trials * trials);
+                    usleep(1000 * 100 * trials);
                     goto autostart_retry;
                 }
             }



-- 
|: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]