[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/5] nbd: Improve per-export flag handling in se
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 1/5] nbd: Improve per-export flag handling in server |
Date: |
Fri, 30 Aug 2019 18:10:24 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 |
On 8/30/19 1:00 PM, Vladimir Sementsov-Ogievskiy wrote:
> 23.08.2019 17:37, Eric Blake wrote:
>> When creating a read-only image, we are still advertising support for
>> TRIM and WRITE_ZEROES to the client, even though the client should not
>> be issuing those commands. But seeing this requires looking across
>> multiple functions:
>>
>> @@ -458,10 +458,13 @@ static int nbd_negotiate_handle_export_name(NBDClient
>> *client,
>> return -EINVAL;
>> }
>>
>> - trace_nbd_negotiate_new_style_size_flags(client->exp->size,
>> - client->exp->nbdflags |
>> myflags);
>> + myflags = client->exp->nbdflags;
>> + if (client->structured_reply) {
>> + myflags |= NBD_FLAG_SEND_DF;
>> + }
>
>
> why we cant do just
> client->exp->nbdflags |= NBD_FLAG_SEND_DF ?
Because myflags is the runtime flags for _this_ client, while
client->exp->nbdflags are the base flags shared by _all_ clients. If
client A requests structured reply, but client B does not, then we don't
want to advertise DF to client B; but amending client->exp->nbdflags
would have that effect.
--
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 0/5] Add NBD fast zero support to qemu client and server, Eric Blake, 2019/08/23
[Qemu-devel] [PATCH 3/5] nbd: Implement client use of NBD FAST_ZERO, Eric Blake, 2019/08/23
[Qemu-devel] [PATCH 4/5] nbd: Implement server use of NBD FAST_ZERO, Eric Blake, 2019/08/23
[Qemu-devel] [PATCH 5/5] nbd: Tolerate more errors to structured reply request, Eric Blake, 2019/08/23
[Qemu-devel] [PATCH 2/5] nbd: Prepare for NBD_CMD_FLAG_FAST_ZERO, Eric Blake, 2019/08/23