mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
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.
This commit is contained in:
parent
64f0e145c1
commit
d94b501b7b
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user