From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52933) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gT6ku-0005RI-1S for qemu-devel@nongnu.org; Sat, 01 Dec 2018 10:00:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gT6ks-00015q-7F for qemu-devel@nongnu.org; Sat, 01 Dec 2018 10:00:27 -0500 Date: Sat, 1 Dec 2018 15:00:15 +0000 From: "Richard W.M. Jones" Message-ID: <20181201150015.GM27120@redhat.com> References: <20181130220344.3350618-1-eblake@redhat.com> <20181201074244.GF27120@redhat.com> <6e32f97a-6b4c-2627-ed63-25d4c9f35eb3@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6e32f97a-6b4c-2627-ed63-25d4c9f35eb3@redhat.com> Subject: Re: [Qemu-devel] [PATCH for-4.0 00/14] nbd: add qemu-nbd --list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org, jsnow@redhat.com, nsoffer@redhat.com, vsementsov@virtuozzo.com, qemu-block@nongnu.org On Sat, Dec 01, 2018 at 07:57:51AM -0600, Eric Blake wrote: > On 12/1/18 1:42 AM, Richard W.M. Jones wrote: > >On Fri, Nov 30, 2018 at 04:03:29PM -0600, Eric Blake wrote: > >>I note that upstream NBD has 'nbd-client -l $host' for querying > >>just export names (with no quoting, so you have to know that > >>a blank line means the default export), but it wasn't powerful > >>enough, so I implemented 'qemu-nbd -L' to document everything. > >>Upstream NBD has separate 'nbd-client' and 'nbd-server' binaries, > >>while we only have 'qemu-nbd' (which is normally just a server, > >>but 'qemu-nbd -c' also operates a second thread as a client). > >>Our other uses of qemu as NBD client are for consuming a block > >>device (as in qemu-io, qemu-img, or a drive to qemu) - but those > >>binaries are less suited to something so specific to the NBD > >>protocol. > > > >I tried it against nbdkit and it works (obviously): > > > >$ ./qemu-nbd -L > >exports available: 1 > > export: '' > > size: 67108864 > > flags: 0x61 ( trim zeroes ) > > > >What I couldn't work out is how to connect to other hosts. It's > >possible to add -p or -k to change the localhost port number or to use > >a Unix domain socket (and I checked both work). However can we > >connect to remote hosts? > > Should work by adding '-b host' (if -b is omitted, it defaults to > 0.0.0.0). However, I admit that so far I have only tested '-b > localhost' or '-b 127.0.0.1' (per the iotest additions at the end of > the series), so it could well be something that I missed in setting > up the client socket in nbd_build_socket_address(). Must have missed that option. It does work, thanks. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-builder quickly builds VMs from scratch http://libguestfs.org/virt-builder.1.html