[PATCH 4/4] vshAdmCatchDisconnect: Don't probe connection URI

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



virsh already stores the connection URI in 'ctl->connname', use that
instead.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 tools/virt-admin.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/tools/virt-admin.c b/tools/virt-admin.c
index 02cf421cee..fa9304c772 100644
--- a/tools/virt-admin.c
+++ b/tools/virt-admin.c
@@ -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
-- 
2.43.0
_______________________________________________
Devel mailing list -- devel@xxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux