All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wouter Verhelst <w@uter.be>
To: Alex Bligh <alex@alex.org.uk>
Cc: "nbd-general@lists.sourceforge.net"
	<nbd-general@lists.sourceforge.net>,
	"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [Nbd] [PATCH] Strawman proposal for NBD structured replies
Date: Tue, 29 Mar 2016 22:57:35 +0200	[thread overview]
Message-ID: <20160329205735.GA19767@grep.be> (raw)
In-Reply-To: <1459283983-11890-1-git-send-email-alex@alex.org.uk>

On Tue, Mar 29, 2016 at 09:39:43PM +0100, Alex Bligh wrote:
> Here's a strawman for the structured reply section. I haven't
> covered negotation.

LGTM, for the most part.

[...]
> +Each chunk consists of the following:
> +
> +S: 32 bits, 0x668e33ef, magic (`NBD_STRUCTURED_REPLY_MAGIC`)
> +S: 32 bits, flags (including type)
> +S: 64 bits, handle
> +S: 32 bits, payload length
> +S: (*length* bytes of payload data)
> +
> +The flags have the following meanings:
> +
> +* bits 0-7: `NBD_CHUNKTYPE`, an 8 bit unsigned integer
> +* bits 8-31: reserved (server MUST set these to zero)

I understand why you do it this way (we don't need 2^16 reply types),
but (in contrast to the flags in the request packet) this makes it
harder to specify flags and command type as separate fields (there is no
24-bit integer on most systems).

As said though, I understand why, and the alternative isn't ideal.

[...]
> +If the server detects an error during an operation which it
> +is serving with a structured reply, it MUST complete
> +the transmission of the current data chunk if transmission
> +has started (by padding the current chunk with data
> +which MUST be zero), after which zero or more other
> +data chunks may be sent, followed by an `NBD_CHUNKTYPE_END`
> +chunk. The server MAY set the offset within `NBD_CHUNKTYPE_END`
> +to the offset of the error; if so, this MUST be within the
> +length requested.

This should probably also be more explicit about what to do if the
server doesn't want to set the offset (set it to zero, presumably)

-- 
< ron> I mean, the main *practical* problem with C++, is there's like a dozen
       people in the world who think they really understand all of its rules,
       and pretty much all of them are just lying to themselves too.
 -- #debian-devel, OFTC, 2016-02-12

  reply	other threads:[~2016-03-29 20:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-29 20:39 [Qemu-devel] [PATCH] Strawman proposal for NBD structured replies Alex Bligh
2016-03-29 20:57 ` Wouter Verhelst [this message]
2016-03-29 21:59   ` [Qemu-devel] [Nbd] " Alex Bligh
2016-03-29 22:31     ` Wouter Verhelst
2016-03-29 22:58       ` Eric Blake

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=20160329205735.GA19767@grep.be \
    --to=w@uter.be \
    --cc=alex@alex.org.uk \
    --cc=nbd-general@lists.sourceforge.net \
    --cc=qemu-devel@nongnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.