c76aa1c80f
Fix crash in libvirt_leasehelper (bz #1202350) Generate consistent systemtap tapsets regardless of host arch (bz #1173641) Fix qemu:///session error 'Transport endpoint is not connected' (bz #1271183) Fix parallel VM start/top svirt errors on kernel/initrd (bz #1269975)
44 lines
1.3 KiB
Diff
44 lines
1.3 KiB
Diff
From: Cole Robinson <crobinso@redhat.com>
|
|
Date: Mon, 11 Jan 2016 20:13:38 -0500
|
|
Subject: [PATCH] rpc: socket: Don't repeatedly attempt to launch daemon
|
|
|
|
On every socket connect(2) attempt we were re-launching session
|
|
libvirtd, up to 100 times in 5 seconds.
|
|
|
|
This understandably caused some weird load races and intermittent
|
|
qemu:///session startup failures
|
|
|
|
https://bugzilla.redhat.com/show_bug.cgi?id=1271183
|
|
(cherry picked from commit 2eb7a975756d05a5b54ab4acf60083beb6161ac6)
|
|
---
|
|
src/rpc/virnetsocket.c | 9 +++++++--
|
|
1 file changed, 7 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c
|
|
index 90951be..2ee4b6e 100644
|
|
--- a/src/rpc/virnetsocket.c
|
|
+++ b/src/rpc/virnetsocket.c
|
|
@@ -547,6 +547,7 @@ int virNetSocketNewConnectUNIX(const char *path,
|
|
virSocketAddr remoteAddr;
|
|
char *rundir = NULL;
|
|
int ret = -1;
|
|
+ bool daemonLaunched = false;
|
|
|
|
VIR_DEBUG("path=%s spawnDaemon=%d binary=%s", path, spawnDaemon,
|
|
NULLSTR(binary));
|
|
@@ -627,8 +628,12 @@ int virNetSocketNewConnectUNIX(const char *path,
|
|
goto cleanup;
|
|
}
|
|
|
|
- if (virNetSocketForkDaemon(binary) < 0)
|
|
- goto cleanup;
|
|
+ if (!daemonLaunched) {
|
|
+ if (virNetSocketForkDaemon(binary) < 0)
|
|
+ goto cleanup;
|
|
+
|
|
+ daemonLaunched = true;
|
|
+ }
|
|
|
|
usleep(5000);
|
|
}
|