[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [PATCH v5 05/14] nbd: Share common reply-s
From: |
Eric Blake |
Subject: |
Re: [Qemu-block] [Qemu-devel] [PATCH v5 05/14] nbd: Share common reply-sending code in server |
Date: |
Tue, 19 Jul 2016 08:52:47 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
On 07/18/2016 11:10 PM, Fam Zheng wrote:
> On Mon, 07/18 22:07, Eric Blake wrote:
>> Rather than open-coding NBD_REP_SERVER, reuse the code we
>> already have by adding a length parameter. Additionally,
>> the refactoring will make adding NBD_OPT_GO in a later patch
>> easier.
>>
>> Signed-off-by: Eric Blake <address@hidden>
>>
>> ---
>> v4: no change
>> v3: rebase to changes earlier in series
>> ---
>> nbd/server.c | 48 +++++++++++++++++++++++-------------------------
>> 1 file changed, 23 insertions(+), 25 deletions(-)
>>
>> diff --git a/nbd/server.c b/nbd/server.c
>> index 85c4f5d..c8716f1 100644
>> --- a/nbd/server.c
>> +++ b/nbd/server.c
>> @@ -195,12 +195,15 @@ static ssize_t nbd_negotiate_drop_sync(QIOChannel
>> *ioc, size_t size)
>>
>> */
>>
>> -static int nbd_negotiate_send_rep(QIOChannel *ioc, uint32_t type, uint32_t
>> opt)
>> +/* Send a reply header, including length, but no payload.
>> + * Return -errno to kill connection, 0 to continue negotiation. */
>
> Not a show stopper but I'm not sure documenting the control logic of the
> outermost caller a few layers away is a good idea, the same question applies
> to
> functions below as well.
The documentation here accurately describes this function. Or is your
complaint that the outermost caller is lacking documentation, and
therefore I should first do a patch that uniformly adds documentation,
before changing behavior, so that this function doesn't end up with
details while the outermost caller remains undocumented?
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
- [Qemu-block] [PATCH for-2.7 v5 00/14] nbd: efficient write zeroes, Eric Blake, 2016/07/19
- [Qemu-block] [PATCH v5 06/14] nbd: Send message along with server NBD_REP_ERR errors, Eric Blake, 2016/07/19
- [Qemu-block] [PATCH v5 03/14] nbd: Limit nbdflags to 16 bits, Eric Blake, 2016/07/19
- [Qemu-block] [PATCH v5 09/14] nbd: Let client skip portions of server reply, Eric Blake, 2016/07/19
- [Qemu-block] [PATCH v5 08/14] nbd: Let server know when client gives up negotiation, Eric Blake, 2016/07/19
- [Qemu-block] [PATCH v5 04/14] nbd: Treat flags vs. command type as separate fields, Eric Blake, 2016/07/19
- [Qemu-block] [PATCH v5 13/14] nbd: Implement NBD_CMD_WRITE_ZEROES on server, Eric Blake, 2016/07/19