提交 622ea8b6 编写于 作者: M Martin Kletzander

virsh: Honour --readonly with cmdConnect and no name

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1436042Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
上级 e8580654
......@@ -218,7 +218,13 @@ virshReconnect(vshControl *ctl, const char *name, bool readonly, bool force)
{
bool connected = false;
virshControlPtr priv = ctl->privData;
bool ro = name ? readonly : priv->readonly;
/* If the flag was not specified, then it depends on whether we are
* reconnecting to the current URI (in which case we want to keep the
* readonly flag as it was) or to a specified URI in which case it
* should stay false */
if (!readonly && !name)
readonly = priv->readonly;
if (priv->conn) {
int ret;
......@@ -233,7 +239,7 @@ virshReconnect(vshControl *ctl, const char *name, bool readonly, bool force)
"disconnect from the hypervisor"));
}
priv->conn = virshConnect(ctl, name ? name : ctl->connname, ro);
priv->conn = virshConnect(ctl, name ? name : ctl->connname, readonly);
if (!priv->conn) {
if (disconnected)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册