qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: "Qemu-devel@nongnu.org" <Qemu-devel@nongnu.org>,
	Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>,
	nbd list <nbd@other.debian.org>
Subject: [Qemu-devel] structured reply behavior for read of 0 bytes
Date: Fri, 3 Nov 2017 17:45:07 -0500	[thread overview]
Message-ID: <d0e4e71e-981e-eec1-c996-74655079a860@redhat.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1047 bytes --]

As currently written, structured reply is documented as:

> NBD_REPLY_TYPE_OFFSET_DATA (1)
> 
> This chunk type is in the content chunk category. length MUST be at least 9. It represents the contents of length - 8 bytes of the file, starting at the absolute offset from the start of the export.

which implies that the data size must be non-zero. But clients can
request a read of size 0 (the spec doesn't forbid it, but neither does
it define special semantics for it), and the existing qemu
implementation as of qemu commit f140e300 sends
NBD_REPLY_TYPE_OFFSET_DATA with length of 8 and no data payload if the
client requests a 0-byte read.  Should we specifically allow this
particular answer, or should a 0-length read be answered solely by
NBD_REPLY_TYPE_NONE, meaning that qemu's current behavior needs a tweak?
 Either way, I probably need another tweak to the NBD spec for
structured reads.

-- 
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: 619 bytes --]

             reply	other threads:[~2017-11-03 22:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-03 22:45 Eric Blake [this message]
2017-11-05 19:57 ` [Qemu-devel] structured reply behavior for read of 0 bytes Wouter Verhelst
2017-11-06 16:11   ` 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=d0e4e71e-981e-eec1-c996-74655079a860@redhat.com \
    --to=eblake@redhat.com \
    --cc=Qemu-devel@nongnu.org \
    --cc=nbd@other.debian.org \
    --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).