]> xenbits.xensource.com Git - people/aperard/libvirt.git/commitdiff
vshAdmConnect: Preserve connection URI in ctl->connname if auto-detected
authorPeter Krempa <pkrempa@redhat.com>
Thu, 14 Dec 2023 16:18:39 +0000 (17:18 +0100)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 15 Jan 2024 13:05:20 +0000 (14:05 +0100)
Probe the current URI so that other places don't need to do that.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
tools/virt-admin.c

index 1e22a3c8a951b27a86de18103fd74a73ec35b7a8..02cf421cee38c5476831c9a54c0dc4226b1640ea 100644 (file)
@@ -120,6 +120,9 @@ vshAdmConnect(vshControl *ctl, unsigned int flags)
 
         if (priv->wantReconnect)
             vshPrint(ctl, "%s\n", _("Reconnected to the admin server"));
+
+        if (!ctl->connname)
+            ctl->connname = virAdmConnectGetURI(priv->conn);
     }
 
     return 0;