mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 03:25:20 +00:00
vshAdmCatchDisconnect: Don't probe connection URI
virsh already stores the connection URI in 'ctl->connname', use that instead. Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
6f956696cb
commit
9139cf44d4
@ -72,15 +72,10 @@ vshAdmCatchDisconnect(virAdmConnectPtr conn G_GNUC_UNUSED,
|
|||||||
{
|
{
|
||||||
vshControl *ctl = opaque;
|
vshControl *ctl = opaque;
|
||||||
const char *str = "unknown reason";
|
const char *str = "unknown reason";
|
||||||
virErrorPtr error;
|
|
||||||
g_autofree char *uri = NULL;
|
|
||||||
|
|
||||||
if (reason == VIR_CONNECT_CLOSE_REASON_CLIENT)
|
if (reason == VIR_CONNECT_CLOSE_REASON_CLIENT)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
virErrorPreserveLast(&error);
|
|
||||||
uri = virAdmConnectGetURI(conn);
|
|
||||||
|
|
||||||
switch ((virConnectCloseReason) reason) {
|
switch ((virConnectCloseReason) reason) {
|
||||||
case VIR_CONNECT_CLOSE_REASON_ERROR:
|
case VIR_CONNECT_CLOSE_REASON_ERROR:
|
||||||
str = N_("Disconnected from %1$s due to I/O error");
|
str = N_("Disconnected from %1$s due to I/O error");
|
||||||
@ -96,8 +91,7 @@ vshAdmCatchDisconnect(virAdmConnectPtr conn G_GNUC_UNUSED,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
vshError(ctl, _(str), NULLSTR(uri));
|
vshError(ctl, _(str), NULLSTR(ctl->connname));
|
||||||
virErrorRestore(&error);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
Loading…
Reference in New Issue
Block a user