From: Eric Blake <eblake@redhat.com>
To: Alex Bligh <alex@alex.org.uk>, "Richard W.M. Jones" <rjones@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
"Daniel P. Berrange" <berrange@redhat.com>,
"nbd-general@lists.sourceforge.net"
<nbd-general@lists.sourceforge.net>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [Nbd] [PULL 23/28] nbd: always query export list in fixed new style protocol
Date: Tue, 17 May 2016 09:52:30 -0600 [thread overview]
Message-ID: <573B3E3E.60902@redhat.com> (raw)
In-Reply-To: <5ED6FB6F-5023-4833-83F9-B24BD379E2CD@alex.org.uk>
[-- Attachment #1: Type: text/plain, Size: 5399 bytes --]
On 05/17/2016 09:22 AM, Alex Bligh wrote:
>>> nbdkit's implemention of NBD_OPT_LIST returns an error, because there
>>> is no such thing as a list of export names supported (in effect nbdkit
>>> allows any export name).
>
> nbdkit is non-compliant in that case. Support of NBD_OPT_LIST is
> compulsory, even if you support it by returning a nameless export
> (or default). Moreover support of export names is compulsory
> (even if you have a single fixed one called "" or "default").
Where does the protocol state that? I don't see any mandatory NBD_OPT in
the protocol, except for NBD_OPT_EXPORT_NAME (as I read it, a server may
reply with NBD_REP_ERR_UNSUP for every other option). I'm fine if we
WANT to make NBD_OPT_LIST mandatory (and either document under
NBD_OPT_LIST that NBD_REP_ERR_UNSUP cannot be used, or document under
NBD_REP_ERR_UNSUP that it cannot be used with NBD_OPT_LIST), but that
would make the current nbdkit non-conforming; so it might be nicer to
make a change to the protocol document that instead permits current
nbdkit behavior and puts the burden on clients to interoperate when
NBD_OPT_LIST is not supported.
>
> This is assuming nbdkit supports 'fixed newstyle'; if nbdkit merely
> supports 'newstyle' negotiation, then we know qemu won't connect
> to it as modern qemu only supports servers that support 'fixed newstyle'
> I believe.
Not quite true. Qemu as a client is perfectly fine connecting with a
plain 'newstyle' server (and not just 'fixed newstyle'); but will limit
itself to JUST NBD_OPT_EXPORT_NAME in that case. So nbdkit must be
exposing 'fixed newstyle' for qemu to be attempting NBD_OPT_LIST.
>
>> Perhaps nbdkit should implement NBD_OPT_LIST returning just "" (the
>> default name) as its only list entry?
>
> Or "default".
As I read the protocol, I don't see "default" as a permissible name of
the default export, just "".
Also, we currently state that NBD_OPT_LIST has zero or more
NBD_REP_SERVER replies, which means that it is valid for the command to
succeed with NBD_REP_ACK _without_ advertising any exports at all
(rather annoying in that it tells you nothing about whether
NBD_OPT_EXPORT_NAME/NBD_OPT_GO will succeed anyways). Should we reword
that to require that if NBD_REP_ACK is sent, then at least one
NBD_REP_SERVER reply was given (where "" is the obvious name, but at the
same time where "" is not mandatory if some other name is given)?
>
>> And at some point, nbdkit should probably implement NBD_OPT_GO (which is
>> a nicer replacement to NBD_OPT_EXPORT_NAME; I've got patches pending for
>> qemu to implement that).
>>
>> In fact, if NBD_OPT_GO is supported, then my patches to qemu won't even
>> try NBD_OPT_LIST.
>
> Sure, but NBD_OPT_INFO/GO is still an experimental protocol extension.
Hopefully not much longer; we have multiple implementations converging
on interoperable use of it.
>
>>> Therefore I don't believe the assumption made here -- that you can
>>> list export names and choose them on the client side -- is a valid
>>> one.
>>
>> Qemu is not choosing an export name, so much as proving whether any
>> OTHER errors can be detected (such as export name not present, or TLS
>> required). It _should_ be gracefully ignoring NBD_OPT_LIST errors if
>> such errors don't definitively prove that the export will not succeed,
>> but I guess this is not happening. I'll see if I can tweak the qemu
>> logic to be more forgiving of nbdkit's current behavior.
>
> Whilst that is fair enough, NBD_OPT_LIST is a mandatory part of the
> specification. If a server doesn't implement mandatory parts of
> the specification, then bad things will happen.
Again, I don't see how the protocol justifies that claim. Maybe it
should, but I'd like to see your reasoning for stating that it is
mandatory that the server support it.
>
> My interpretation of NBD_OPT_LIST failing would be 'this server
> doesn't have anything it can export'.
Indeed, and that's why qemu as a client is currently dropping the
connection with nbdkit. But I would also make that interpretation for
NBD_OPT_LIST succeeding with NBD_REP_ACK with 0 NBD_REP_SERVER replies -
so maybe it is worth a note in the protocol how to detect servers that
are exporting exactly one volume and don't care what name you pass, then
tweaking either nbdkit, qemu, or both to comply to that added protocol
wording.
>
>>> Naturally the protocol document
>>> (https://github.com/yoe/nbd/blob/master/doc/proto.md) isn't clear on
>>> this case.
>>
>> You're right that we may also want to tweak the NBD protocol to make
>> this interoperability point obvious.
>
> I can't actually see the issue here. It explains what needs to be
> implemented by the server, and that includes NBD_OPT_LIST. Very
> happy to add some clarity, but I'm not sure where it's needed.
I've hinted at it above - either an explicit statement that servers
cannot reject NBD_OPT_LIST with NBD_REP_UNSUP, and that if they have no
other exports, then the SHOULD include an NBD_REP_SERVER with name "";
or an explicit statement that if a server rejects NBD_OPT_LIST, then the
client SHOULD assume that any name will work for
NBD_OPT_EXPORT_NAME/NBD_OPT_GO.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2016-05-17 15:52 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-16 16:34 [Qemu-devel] [PULL 00/28] Bug fixes + NBD-over-TLS support patches for 2016-02-16 Paolo Bonzini
2016-02-16 16:34 ` [Qemu-devel] [PULL 01/28] checkpatch: Eliminate false positive in case of comma-space-square bracket Paolo Bonzini
2016-02-16 16:34 ` [Qemu-devel] [PULL 02/28] checkpatch: Eliminate false positive in case of space before square bracket in a definition Paolo Bonzini
2016-02-16 16:34 ` [Qemu-devel] [PULL 03/28] Revert "qemu-char: Keep pty slave file descriptor open until the master is closed" Paolo Bonzini
2016-02-16 16:34 ` [Qemu-devel] [PULL 04/28] char: fix handling of QIO_CHANNEL_ERR_BLOCK Paolo Bonzini
2016-02-16 16:34 ` [Qemu-devel] [PULL 05/28] build: Don't redefine 'inline' Paolo Bonzini
2016-02-16 16:34 ` [Qemu-devel] [PULL 06/28] vl: change QEMU state machine for system reset Paolo Bonzini
2016-02-16 16:34 ` [Qemu-devel] [PULL 07/28] vl: fix migration from prelaunch state Paolo Bonzini
2016-02-16 16:34 ` [Qemu-devel] [PULL 08/28] migration: fix incorrect memory_global_dirty_log_start outside BQL Paolo Bonzini
2016-02-16 16:34 ` [Qemu-devel] [PULL 09/28] mptsas: add missing va_end Paolo Bonzini
2016-02-16 16:34 ` [Qemu-devel] [PULL 10/28] mptsas: fix memory leak Paolo Bonzini
2016-02-16 16:34 ` [Qemu-devel] [PULL 11/28] mptsas: fix wrong formula Paolo Bonzini
2016-02-16 16:34 ` [Qemu-devel] [PULL 12/28] ipmi: sensor number should not exceed MAX_SENSORS Paolo Bonzini
2016-02-16 16:34 ` [Qemu-devel] [PULL 13/28] qom: add helpers for UserCreatable object types Paolo Bonzini
2016-02-16 16:34 ` [Qemu-devel] [PULL 14/28] qemu-nbd: add support for --object command line arg Paolo Bonzini
2016-02-16 16:34 ` [Qemu-devel] [PULL 15/28] nbd: convert block client to use I/O channels for connection setup Paolo Bonzini
2016-02-16 16:34 ` [Qemu-devel] [PULL 16/28] nbd: convert qemu-nbd server " Paolo Bonzini
2016-02-16 16:34 ` [Qemu-devel] [PULL 17/28] nbd: convert blockdev NBD " Paolo Bonzini
2016-02-16 16:34 ` [Qemu-devel] [PULL 18/28] nbd: convert to using I/O channels for actual socket I/O Paolo Bonzini
2016-02-16 16:34 ` [Qemu-devel] [PULL 19/28] nbd: invert client logic for negotiating protocol version Paolo Bonzini
2016-02-16 16:34 ` [Qemu-devel] [PULL 20/28] nbd: make server compliant with fixed newstyle spec Paolo Bonzini
2016-02-16 16:34 ` [Qemu-devel] [PULL 21/28] nbd: make client request fixed new style if advertised Paolo Bonzini
2016-02-16 16:34 ` [Qemu-devel] [PULL 22/28] nbd: allow setting of an export name for qemu-nbd server Paolo Bonzini
2016-02-16 16:34 ` [Qemu-devel] [PULL 23/28] nbd: always query export list in fixed new style protocol Paolo Bonzini
2016-05-17 9:53 ` Richard W.M. Jones
2016-05-17 15:09 ` Eric Blake
2016-05-17 15:22 ` [Qemu-devel] [Nbd] " Alex Bligh
2016-05-17 15:52 ` Eric Blake [this message]
2016-05-17 15:58 ` Richard W.M. Jones
2016-05-17 16:05 ` Eric Blake
2016-05-17 16:41 ` Richard W.M. Jones
2016-05-17 16:56 ` Eric Blake
2016-05-17 17:36 ` Alex Bligh
2016-05-17 18:47 ` Richard W.M. Jones
2016-05-17 15:59 ` Eric Blake
2016-05-17 16:39 ` Richard W.M. Jones
2016-05-17 16:58 ` Eric Blake
2016-05-17 16:22 ` Alex Bligh
2016-05-17 16:50 ` Eric Blake
2016-05-17 17:34 ` Alex Bligh
2016-05-21 21:53 ` Wouter Verhelst
2016-05-22 18:16 ` Richard W.M. Jones
2016-05-17 15:54 ` Richard W.M. Jones
2016-05-17 16:26 ` Alex Bligh
2016-05-17 17:00 ` Eric Blake
2016-02-16 16:34 ` [Qemu-devel] [PULL 24/28] nbd: use "" as a default export name if none provided Paolo Bonzini
2016-02-16 16:34 ` [Qemu-devel] [PULL 25/28] nbd: implement TLS support in the protocol negotiation Paolo Bonzini
2016-02-16 16:34 ` [Qemu-devel] [PULL 26/28] nbd: enable use of TLS with NBD block driver Paolo Bonzini
2016-02-16 16:34 ` [Qemu-devel] [PULL 27/28] nbd: enable use of TLS with qemu-nbd server Paolo Bonzini
2016-02-16 16:34 ` [Qemu-devel] [PULL 28/28] nbd: enable use of TLS with nbd-server-start command Paolo Bonzini
2016-02-16 18:25 ` [Qemu-devel] [PULL 00/28] Bug fixes + NBD-over-TLS support patches for 2016-02-16 Peter Maydell
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=573B3E3E.60902@redhat.com \
--to=eblake@redhat.com \
--cc=alex@alex.org.uk \
--cc=berrange@redhat.com \
--cc=nbd-general@lists.sourceforge.net \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rjones@redhat.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 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.