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 <pkrempa@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Peter Krempa 2023-12-14 17:18:39 +01:00
parent 4763f62a96
commit 6f956696cb

View 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;