mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-11-05 16:24:27 +03:00
rpc: ensure daemon is spawn even if dead socket exists
The auto-spawn code would originally attempt to spawn the
daemon for both ENOENT and ECONNREFUSED errors from connect().
The various refactorings eventually lost this so we only
spawn the daemon on ENOENT. The result is if the daemon exits
uncleanly, so that the socket is left in the filesystem, we
will never be able to auto-spawn the daemon again.
(cherry picked from commit 406ee8c226)
This commit is contained in:
committed by
Cole Robinson
parent
d7addd6871
commit
fe40b1d1d4
@@ -610,7 +610,8 @@ int virNetSocketNewConnectUNIX(const char *path,
|
|||||||
|
|
||||||
while (retries &&
|
while (retries &&
|
||||||
connect(fd, &remoteAddr.data.sa, remoteAddr.len) < 0) {
|
connect(fd, &remoteAddr.data.sa, remoteAddr.len) < 0) {
|
||||||
if (!(spawnDaemon && errno == ENOENT)) {
|
if (!(spawnDaemon && (errno == ENOENT ||
|
||||||
|
errno == ECONNREFUSED))) {
|
||||||
virReportSystemError(errno, _("Failed to connect socket to '%s'"),
|
virReportSystemError(errno, _("Failed to connect socket to '%s'"),
|
||||||
path);
|
path);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|||||||
Reference in New Issue
Block a user