diff --git a/src/rpc/virnetsocket.c b/src/rpc/virnetsocket.c index fa16d31f20..0b32ffeee4 100644 --- a/src/rpc/virnetsocket.c +++ b/src/rpc/virnetsocket.c @@ -502,7 +502,11 @@ int virNetSocketNewConnectUNIX(const char *path, retry: if (connect(fd, &remoteAddr.data.sa, remoteAddr.len) < 0) { - if (errno == ECONNREFUSED && spawnDaemon && retries < 20) { + if ((errno == ECONNREFUSED || + errno == ENOENT) && + spawnDaemon && retries < 20) { + VIR_DEBUG("Connection refused for %s, trying to spawn %s", + path, binary); if (retries == 0 && virNetSocketForkDaemon(binary) < 0) goto error;