mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-21 10:52:22 +00:00
virsh: Fix virsh prompt when connection changes to readonly mode.
This commit fixes the virsh prompt when reconnection to the same URI is called: `virsh # connect --readonly` (Reconnect). The problem is happening because the code is considering URI (name) as a mandatory parameter to change the prompt. This commit remove the assignment into `priv->readonly` from `if (name)` conditional. Before: virsh # uri qemu:///system virsh # connect --readonly virsh # After: virsh # uri qemu:///system virsh # connect --readonly virsh > Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1507737 Signed-off-by: Julio Faracco <jcfaracco@gmail.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
8ed2b6300b
commit
13d45b0dc2
@ -251,8 +251,10 @@ virshReconnect(vshControl *ctl, const char *name, bool readonly, bool force)
|
||||
if (name) {
|
||||
VIR_FREE(ctl->connname);
|
||||
ctl->connname = vshStrdup(ctl, name);
|
||||
priv->readonly = readonly;
|
||||
}
|
||||
|
||||
priv->readonly = readonly;
|
||||
|
||||
if (virConnectRegisterCloseCallback(priv->conn, virshCatchDisconnect,
|
||||
ctl, NULL) < 0)
|
||||
vshError(ctl, "%s", _("Unable to register disconnect callback"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user