[PATCH 2/4] virshCatchDisconnect: 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/virsh.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/tools/virsh.c b/tools/virsh.c
index 18a8c32f53..95ff63baeb 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -67,18 +67,13 @@ static int disconnected; /* we may have been disconnected */
  * handler, just save the fact it was raised.
  */
 static void
-virshCatchDisconnect(virConnectPtr conn,
+virshCatchDisconnect(virConnectPtr conn G_GNUC_UNUSED,
                      int reason,
                      void *opaque)
 {
     if (reason != VIR_CONNECT_CLOSE_REASON_CLIENT) {
         vshControl *ctl = opaque;
         const char *str = "unknown reason";
-        virErrorPtr error;
-        g_autofree char *uri = NULL;
-
-        virErrorPreserveLast(&error);
-        uri = virConnectGetURI(conn);

         switch ((virConnectCloseReason) reason) {
         case VIR_CONNECT_CLOSE_REASON_ERROR:
@@ -94,9 +89,8 @@ virshCatchDisconnect(virConnectPtr conn,
         case VIR_CONNECT_CLOSE_REASON_LAST:
             break;
         }
-        vshError(ctl, _(str), NULLSTR(uri));
+        vshError(ctl, _(str), NULLSTR(ctl->connname));

-        virErrorRestore(&error);
         disconnected++;
         vshEventDone(ctl);
     }
-- 
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