[libvirt] [PATCH] virsh: Honour --readonly with cmdConnect and no name

Martin Kletzander mkletzan at redhat.com
Mon Aug 21 10:43:00 UTC 2017


On Mon, Aug 21, 2017 at 11:29:15AM +0200, Erik Skultety wrote:
>On Fri, Aug 18, 2017 at 04:40:04PM +0200, Martin Kletzander wrote:
>> Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
>> ---
>>  tools/virsh.c | 10 ++++++++--
>>  1 file changed, 8 insertions(+), 2 deletions(-)
>>
>> diff --git a/tools/virsh.c b/tools/virsh.c
>> index 94bb7ff6c93a..9883e87df2b5 100644
>> --- a/tools/virsh.c
>> +++ b/tools/virsh.c
>> @@ -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 default URI (in which case we want to keep the
>
>Probably I'm just thinking about it too much, but "default URI" means the URI
>to use when none specified - you can define it by the following: uri_default in
>libvirt.conf, LIBVIRT_DEFAULT_URI env or let libvirt use the hardcoded default
>- the thing is that I can have the default defined as "qemu:///system" but use
>lxc for the moment and this would still work nicely, so maybe "last known
>URI"?? But as I said, maybe I'm just spending ridiculously too much time
>thinking about it.

No, you're right, it's reconnecting to the current URI, just with a new
flag, so it should say "current".  Will fix before pushing.

>
>ACK
>
>Erik
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20170821/6a5ed8e7/attachment-0001.sig>


More information about the libvir-list mailing list