[Libguestfs] [PATCH] fish: drop leading '/' in nbd paths (RHBZ#1379585)

Pino Toscano ptoscano at redhat.com
Tue Sep 27 10:54:17 UTC 2016


On Tuesday, 27 September 2016 11:08:34 CEST Richard W.M. Jones wrote:
> On Tue, Sep 27, 2016 at 11:20:07AM +0200, Pino Toscano wrote:
> > When parsing the URI, drop the leading '/' from the path also when the
> > protocol is 'nbd': in this case, the path represents the export name,
> > which does not need the '/' coming from the URI format.
> > 
> > Improve the coverage for nbd in test-add-uri.sh, adding a couple of
> > tests, and adjusting the result of an existing one.
> 
> The trouble with this is that exportnames generally do start
> with a '/'.

This seems what nbd-server requires, although the protocol documentation
does not put any limitation to that.  Indeed, neither qemu-nbd nor
nbdkit seem to do any validation on it (thus accepting even names not
starting with '/'.

> Can one specify an exportname if it begins with '/'?

When using the API directly, 'add-drive "/name" ..' will still work,
while nbd://host[:port]//name (with two slashes) as URI will do the job.
It's a bit ugly, I agree, but I don't see a way to make both work with
the URI syntax.

-- 
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20160927/8c092bc4/attachment.sig>


More information about the Libguestfs mailing list