提交 d94b501b 编写于 作者: J Ján Tomko 提交者: Jiri Denemark

virsh: don't lie about reconnection in vshReconnect

Since we (ab)use vshReconnect for the default URI connection, if it
fails it might print 'Failed to reconnect to the hypervisor' even if we
were never connected before.

This changes it to only mention reconnection on the first try after
getting disconnected.
上级 64f0e145
......@@ -331,7 +331,10 @@ vshReconnect(vshControl *ctl)
virConnectAuthPtrDefault,
ctl->readonly ? VIR_CONNECT_RO : 0);
if (!ctl->conn) {
vshError(ctl, "%s", _("Failed to reconnect to the hypervisor"));
if (disconnected)
vshError(ctl, "%s", _("Failed to reconnect to the hypervisor"));
else
vshError(ctl, "%s", _("failed to connect to the hypervisor"));
} else {
if (virConnectRegisterCloseCallback(ctl->conn, vshCatchDisconnect,
NULL, NULL) < 0)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册