1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-02-20 18:32:20 +00:00

virshReconnect: Preserve current URI if not explicitly set in ctl->connname

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:11:08 +01:00
parent f6e6d191ca
commit 06f6d76334

@ -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,