From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40899) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2i1s-0006k1-T8 for qemu-devel@nongnu.org; Tue, 17 May 2016 12:39:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b2i1p-0004pD-LF for qemu-devel@nongnu.org; Tue, 17 May 2016 12:39:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42067) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b2i1p-0004os-Di for qemu-devel@nongnu.org; Tue, 17 May 2016 12:39:29 -0400 Date: Tue, 17 May 2016 17:39:26 +0100 From: "Richard W.M. Jones" Message-ID: <20160517163926.GA1683@redhat.com> References: <1455640486-6101-1-git-send-email-pbonzini@redhat.com> <1455640486-6101-24-git-send-email-pbonzini@redhat.com> <20160517095339.GD28935@redhat.com> <573B342E.8030208@redhat.com> <5ED6FB6F-5023-4833-83F9-B24BD379E2CD@alex.org.uk> <573B3E3E.60902@redhat.com> <573B3FC6.2060907@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <573B3FC6.2060907@redhat.com> Subject: Re: [Qemu-devel] [Nbd] [PULL 23/28] nbd: always query export list in fixed new style protocol List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: Alex Bligh , "nbd-general@lists.sourceforge.net" , Paolo Bonzini , "Daniel P. Berrange" , "qemu-devel@nongnu.org" On Tue, May 17, 2016 at 09:59:02AM -0600, Eric Blake wrote: > On 05/17/2016 09:52 AM, Eric Blake wrote: > >>> 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)? > > Okay, I just downloaded nbdkit code and checked; nbdkit is sending 0 > entries and NBD_REP_ACK (for success), and NOT an error code; so it is > implying that there are NO known export names but that the command was > recognized. Bleah you are right. I misread the code I wrote :-( We can add a empty string list entry there easily enough. Rich. > >> > >> 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. > > Except that nbdkit is NOT failing NBD_OPT_LIST, just merely listing 0 > replies. > > > But I would also make that interpretation for > > NBD_OPT_LIST succeeding with NBD_REP_ACK with 0 NBD_REP_SERVER replies - > > which is the nbdkit behavior > > > 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. > > > -- > Eric Blake eblake redhat com +1-919-301-3266 > Libvirt virtualization library http://libvirt.org > -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-df lists disk usage of guests without needing to install any software inside the virtual machine. Supports Linux and Windows. http://people.redhat.com/~rjones/virt-df/