Probe the current URI so that other places don't need to do that.

Signed-off-by: Peter Krempa <[email protected]>
---
 tools/virsh.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/virsh.c b/tools/virsh.c
index 7b71131db3..18a8c32f53 100644
--- a/tools/virsh.c
+++ b/tools/virsh.c
@@ -225,6 +225,9 @@ virshReconnect(vshControl *ctl, const char *name, bool 
readonly, bool force)
             ctl->connname = g_strdup(name);
         }

+        if (!ctl->connname)
+            ctl->connname = virConnectGetURI(priv->conn);
+
         priv->readonly = readonly;

         if (virConnectRegisterCloseCallback(priv->conn, virshCatchDisconnect,
-- 
2.43.0
_______________________________________________
Devel mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to