[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] nbd: Advertise multi-conn for shared read-only
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH] nbd: Advertise multi-conn for shared read-only connections |
Date: |
Sat, 17 Aug 2019 09:30:18 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 |
On 8/16/19 5:47 AM, Vladimir Sementsov-Ogievskiy wrote:
>>> +++ b/blockdev-nbd.c
>>> @@ -189,7 +189,7 @@ void qmp_nbd_server_add(const char *device, bool
>>> has_name, const char *name,
>>> }
>>>
>>> exp = nbd_export_new(bs, 0, len, name, NULL, bitmap,
>>> - writable ? 0 : NBD_FLAG_READ_ONLY,
>>> + writable ? 0 : NBD_FLAG_READ_ONLY, true,
>>
>> s/true/!writable ?
>
> Oh, I see, John already noticed this, it's checked in nbd_export_new anyway..
Still, since two reviewers have caught it, I'm fixing it :)
>>> @@ -1486,6 +1486,8 @@ NBDExport *nbd_export_new(BlockDriverState *bs,
>>> uint64_t dev_offset,
>>> perm = BLK_PERM_CONSISTENT_READ;
>>> if ((nbdflags & NBD_FLAG_READ_ONLY) == 0) {
>>> perm |= BLK_PERM_WRITE;
>>> + } else if (shared) {
>>> + nbdflags |= NBD_FLAG_CAN_MULTI_CONN;
>
> For me it looks a bit strange: we already have nbdflags parameter for
> nbd_export_new(), why
> to add a separate boolean to pass one of nbdflags flags?
Because I want to get rid of the nbdflags in my next patch.
>
> Also, for qemu-nbd, shouldn't we allow -e only together with -r ?
I'm reluctant to; it might break whatever existing user is okay exposing
it (although such users are questionable, so maybe we can argue they
were already broken). Maybe it's time to start a deprecation cycle?
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH] nbd: Advertise multi-conn for shared read-only connections, Eric Blake, 2019/08/15
- Re: [Qemu-devel] [PATCH] nbd: Advertise multi-conn for shared read-only connections, Richard W.M. Jones, 2019/08/15
- Re: [Qemu-devel] [Qemu-block] [PATCH] nbd: Advertise multi-conn for shared read-only connections, John Snow, 2019/08/15
- Re: [Qemu-devel] [PATCH] nbd: Advertise multi-conn for shared read-only connections, no-reply, 2019/08/15
- Re: [Qemu-devel] [PATCH] nbd: Advertise multi-conn for shared read-only connections, Vladimir Sementsov-Ogievskiy, 2019/08/16
- Re: [Qemu-devel] [PATCH] nbd: Advertise multi-conn for shared read-only connections, Vladimir Sementsov-Ogievskiy, 2019/08/20