From: Peter Krempa Date: Thu, 14 Dec 2023 16:18:39 +0000 (+0100) Subject: vshAdmConnect: Preserve connection URI in ctl->connname if auto-detected X-Git-Tag: v10.1.0-rc1~280 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f956696cbf81e0345fd97f47ee1a9f0b7c61f93;p=thirdparty%2Flibvirt.git 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 --- 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;