]> xenbits.xensource.com Git - people/aperard/libvirt.git/commitdiff
vshAdmCatchDisconnect: Don't probe connection URI
authorPeter Krempa <pkrempa@redhat.com>
Thu, 14 Dec 2023 16:13:08 +0000 (17:13 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 15 Jan 2024 13:05:20 +0000 (14:05 +0100)
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>
tools/virt-admin.c

index 02cf421cee38c5476831c9a54c0dc4226b1640ea..fa9304c7721f975264c019292b7a096f7e5f064c 100644 (file)
@@ -72,15 +72,10 @@ vshAdmCatchDisconnect(virAdmConnectPtr conn G_GNUC_UNUSED,
 {
     vshControl *ctl = opaque;
     const char *str = "unknown reason";
-    virErrorPtr error;
-    g_autofree char *uri = NULL;
 
     if (reason == VIR_CONNECT_CLOSE_REASON_CLIENT)
         return;
 
-    virErrorPreserveLast(&error);
-    uri = virAdmConnectGetURI(conn);
-
     switch ((virConnectCloseReason) reason) {
     case VIR_CONNECT_CLOSE_REASON_ERROR:
         str = N_("Disconnected from %1$s due to I/O error");
@@ -96,8 +91,7 @@ vshAdmCatchDisconnect(virAdmConnectPtr conn G_GNUC_UNUSED,
         break;
     }
 
-    vshError(ctl, _(str), NULLSTR(uri));
-    virErrorRestore(&error);
+    vshError(ctl, _(str), NULLSTR(ctl->connname));
 }
 
 static int