From 6f956696cbf81e0345fd97f47ee1a9f0b7c61f93 Mon Sep 17 00:00:00 2001 From: Peter Krempa Date: Thu, 14 Dec 2023 17:18:39 +0100 Subject: [PATCH] vshAdmConnect: Preserve connection URI in ctl->connname if auto-detected Probe the current URI so that other places don't need to do that. Signed-off-by: Peter Krempa Reviewed-by: Michal Privoznik --- tools/virt-admin.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/virt-admin.c b/tools/virt-admin.c index 1e22a3c8a9..02cf421cee 100644 --- a/tools/virt-admin.c +++ b/tools/virt-admin.c @@ -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;