[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-block] [PATCH v2 2/6] nbd/server: refactor negotiation functio

From: Vladimir Sementsov-Ogievskiy
Subject: Re: [Qemu-block] [PATCH v2 2/6] nbd/server: refactor negotiation functions parameters
Date: Thu, 11 Jan 2018 20:55:31 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2

11.01.2018 02:08, Eric Blake wrote:
From: Vladimir Sementsov-Ogievskiy <address@hidden>

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 allows
tracking changes of remaining option length in future patches.

Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Message-Id: <address@hidden>
[eblake: rebase, commit message tweak, assert !optlen after
negotiation completes]
Signed-off-by: Eric Blake <address@hidden>
  nbd/server.c | 168 +++++++++++++++++++++++++++++------------------------------
  1 file changed, 84 insertions(+), 84 deletions(-)


@@ -818,7 +817,7 @@ static int nbd_negotiate_options(NBDClient *client, 
uint16_t myflags,
              switch (option) {
              case NBD_OPT_EXPORT_NAME:
-                return nbd_negotiate_handle_export_name(client, length,
+                return nbd_negotiate_handle_export_name(client,
                                                          myflags, no_zeroes,

@@ -1707,6 +1706,7 @@ static coroutine_fn void nbd_co_client_start(void *opaque)

+    assert(!client->optlen);

hmm, should not it be at the end of nbd_negotiate() ? Looks OK anyway.


Best regards,

reply via email to

[Prev in Thread] Current Thread [Next in Thread]