[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH 1/5] nbd/server: refactor negotiation functions
From: |
Eric Blake |
Subject: |
Re: [Qemu-block] [PATCH 1/5] nbd/server: refactor negotiation functions parameters |
Date: |
Wed, 22 Nov 2017 10:39:02 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 |
On 11/22/2017 04:19 AM, Vladimir Sementsov-Ogievskiy wrote:
> Instead of passing currently negotiating option and its length to
> many of negotiation functions let's just store them on NBDClient
> struct to be state-variables of negotiation phase.
>
> This unifies semantics of negotiation functions and this allows to
> track changes of remaining option length in future patches.
"allows to $verb" is not idiomatic English; the options are "allows
$subject to $verb" or "allows ${verb}ing"
>
> Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> ---
> nbd/server.c | 164
> +++++++++++++++++++++++++++++------------------------------
> 1 file changed, 82 insertions(+), 82 deletions(-)
Not really a net win in lines of code; but I'll have to see how the
other patches in the series are made easier by this. It relies on the
fact that the NBD protocol states that negotiation phase is synchronous
(at one point, it was argued that negotiation, like transmission, could
allow out-of-order replies from the server, but we got that fixed in the
spec to match existing practice, and this patch cements the fact that we
are processing exactly one option at a time).
Mechanically, the conversion looks sane, so:
Reviewed-by: Eric Blake <address@hidden>
We'll see how I feel at the end of the series.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature
- Re: [Qemu-block] [PATCH 3/5] nbd/server: add helper nbd_opt_invalid, (continued)
- [Qemu-block] [PATCH 4/5] nbd: rename nbd_option and nbd_opt_reply, Vladimir Sementsov-Ogievskiy, 2017/11/22
- [Qemu-block] [PATCH 2/5] nbd/server: add nbd_opt_{read, drop} to track client->optlen, Vladimir Sementsov-Ogievskiy, 2017/11/22
- [Qemu-block] [PATCH 5/5] nbd/server: structurize option reply sending, Vladimir Sementsov-Ogievskiy, 2017/11/22
- [Qemu-block] [PATCH 1/5] nbd/server: refactor negotiation functions parameters, Vladimir Sementsov-Ogievskiy, 2017/11/22
- Re: [Qemu-block] [PATCH 1/5] nbd/server: refactor negotiation functions parameters,
Eric Blake <=
- Re: [Qemu-block] [Qemu-devel] [PATCH 0/5] NBD server refactoring before BLOCK_STATUS, no-reply, 2017/11/22