From: Eric Blake <eblake@redhat.com>
To: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
qemu-devel@nongnu.org
Cc: pbonzini@redhat.com, stefanha@redhat.com, den@openvz.org
Subject: Re: [Qemu-devel] [PATCH v2 1/6] nbd/server: nbd_negotiate: return 1 on NBD_OPT_ABORT
Date: Thu, 6 Jul 2017 11:07:26 -0500 [thread overview]
Message-ID: <040674c0-770d-3b05-0e6a-c46d1c15ac4c@redhat.com> (raw)
In-Reply-To: <945a762c-bf5b-ab71-cea2-790f7fd311f5@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 2449 bytes --]
On 06/29/2017 01:46 PM, Eric Blake wrote:
> On 06/21/2017 10:34 AM, Vladimir Sementsov-Ogievskiy wrote:
>> Separate case when client sent NBD_OPT_ABORT from other errors.
>
> Commit messages are best written in imperative tense (you can supply an
> implicit "apply this patch in order to" prefix in front of the message,
> and it should still generally read well); and that doesn't mix well with
> past-tense descriptions. I might have written:
>
> Separate the case when a client sends NBD_OPT_ABORT from all other errors.
>
>> It will be needed for the following patch, where errors will be
>> reported.
>> Considered case is not actually the error - it honestly follows NBD
>> protocol. Therefore it should not be reported like an error.
>
> This particular case is not actually an error - it honestly follows the
> NBD protocol.
>
>>
>> Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
>> ---
>> nbd/server.c | 20 +++++++++++++++-----
>> 1 file changed, 15 insertions(+), 5 deletions(-)
>>
>
>> -
>> -/* Process all NBD_OPT_* client option commands.
>> - * Return -errno on error, 0 on success. */
>> +/* nbd_negotiate_options
>> + * Process all NBD_OPT_* client option commands.
>> + * Return:
>> + * -errno on error
>> + * 0 on successful negotiation
>> + * 1 if client sent NBD_OPT_ABORT, i.e. on legal disconnect
>
Phooey, I'm just now noticing (while trying to rebase my existing
patches on top of yours) that we have a conflict in semantics. For
reference, my patch was posted here:
https://lists.gnu.org/archive/html/qemu-devel/2017-02/msg04535.html
where I picked the semantics:
+/* Process all NBD_OPT_* client option commands, during fixed newstyle
+ * negotiation. Return -errno on error, 0 on successful
NBD_OPT_EXPORT_NAME,
+ * and 1 on successful NBD_OPT_GO. */
+static int nbd_negotiate_options(NBDClient *client, uint16_t myflags)
But since I'm rebasing my stuff anyways, I'll come up with some other
way to combine the two semantics (perhaps by refactoring the response to
NBD_OPT_EXPORT_NAME to occur in nbd_negotiate_options() instead of in
the caller, so that returning 0 is always sufficient to mark that
newstyle negotiation is complete and the server is now in transmission
phase).
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2017-07-06 16:07 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-21 15:34 [Qemu-devel] [PATCH v2 0/6] nbd refactoring part 2 Vladimir Sementsov-Ogievskiy
2017-06-21 15:34 ` [Qemu-devel] [PATCH v2 1/6] nbd/server: nbd_negotiate: return 1 on NBD_OPT_ABORT Vladimir Sementsov-Ogievskiy
2017-06-29 18:46 ` Eric Blake
2017-07-06 16:07 ` Eric Blake [this message]
2017-06-21 15:34 ` [Qemu-devel] [PATCH v2 2/6] nbd/server: use errp instead of LOG Vladimir Sementsov-Ogievskiy
2017-06-29 19:27 ` Eric Blake
2017-07-05 12:33 ` Vladimir Sementsov-Ogievskiy
2017-07-05 15:21 ` Paolo Bonzini
2017-07-05 17:38 ` Markus Armbruster
2017-07-07 14:40 ` Eric Blake
2017-07-07 15:10 ` Vladimir Sementsov-Ogievskiy
2017-06-21 15:34 ` [Qemu-devel] [PATCH v2 3/6] nbd/server: add errp to nbd_send_reply() Vladimir Sementsov-Ogievskiy
2017-06-29 19:31 ` Eric Blake
2017-06-21 15:34 ` [Qemu-devel] [PATCH v2 4/6] nbd/common: nbd_tls_handshake: remove extra TRACE Vladimir Sementsov-Ogievskiy
2017-06-29 19:32 ` Eric Blake
2017-06-21 15:34 ` [Qemu-devel] [PATCH v2 5/6] nbd/client: refactor TRACE of NBD_MAGIC Vladimir Sementsov-Ogievskiy
2017-06-29 19:36 ` Eric Blake
2017-07-05 15:21 ` Paolo Bonzini
2017-06-21 15:34 ` [Qemu-devel] [PATCH v2 6/6] nbd: use generic trace subsystem instead of TRACE macro Vladimir Sementsov-Ogievskiy
2017-06-29 20:12 ` Eric Blake
2017-07-06 14:49 ` Eric Blake
2017-07-05 15:29 ` Paolo Bonzini
2017-07-06 8:45 ` Vladimir Sementsov-Ogievskiy
2017-07-06 8:57 ` Paolo Bonzini
2017-07-06 15:01 ` Eric Blake
2017-07-06 15:28 ` Eric Blake
2017-07-06 15:44 ` Eric Blake
2017-07-07 14:02 ` Vladimir Sementsov-Ogievskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=040674c0-770d-3b05-0e6a-c46d1c15ac4c@redhat.com \
--to=eblake@redhat.com \
--cc=den@openvz.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=vsementsov@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).