提交 3192efae 编写于 作者: C Cole Robinson

rpc: socket: Explicitly error if we exceed retry count

When we autolaunch libvirtd for session URIs, we spin in a retry
loop waiting for the daemon to start and the connect(2) to succeed.

However if we exceed the retry count, we don't explicitly raise an
error, which can yield a slew of different error messages elsewhere
in the code.

Explicitly raise the last connect(2) failure if we run out of retries.

(cherry picked from commit 8da02d52)
上级 4cfc14c7
......@@ -618,7 +618,9 @@ int virNetSocketNewConnectUNIX(const char *path,
}
VIR_DEBUG("connect() failed: retries=%d errno=%d", retries, errno);
retries--;
if (!spawnDaemon ||
retries == 0 ||
(errno != ENOENT && errno != ECONNREFUSED)) {
virReportSystemError(errno, _("Failed to connect socket to '%s'"),
path);
......@@ -628,7 +630,6 @@ int virNetSocketNewConnectUNIX(const char *path,
if (virNetSocketForkDaemon(binary) < 0)
goto cleanup;
retries--;
usleep(5000);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册