On Mon, May 20, 2019 at 10:20:56AM +0100, Richard W.M. Jones wrote:
Previous discussion: https://lists.debian.org/nbd/2018/07/msg00002.html Again I'm stuck because we need a URL syntax for NBD. Various URLs have been proposed before: * Library Hostname+port over TCP/IP Unix domain socket Export name - Link for further information - Notes * libguestfs nbd://example.com:port (:port is optional) nbd://?socket=/socket nbd://example.com:port/exportname nbd:///exportname?socket=/socket - http://libguestfs.org/guestfish.1.html#a-nbd:-example.com-:port - Cannot specify an export name without a leading '/' character * QEMU nbd:example.com:port nbd:unix:/socket nbd:example.com:port:exportname=/export - https://qemu.weilnetz.de/doc/qemu-doc.html#Device-URL-Syntax - Not a real URL!
QEMU also accepts real URLs, even for unix sockets: nbd+unix:///?socket=nbdkit.sock I haven't yet checked how the exportname is handled, though.
* Curl nbd://example.com/ nbd://example.com/exportname - https://github.com/rwmjones/curl/commit/2aba3dd7d8f9b8e03a8c3435e7555ab9e195675a#diff-77ab3188c0ad08b7b9d8d9787c8e9d75 - Cannot specify an export name without a leading '/' character - No Unix domain socket syntax was ever defined. - Did not go upstream. The leading problem with the "obvious" NBD URL format seems to be that it's impossible to specify empty export names or export names which don't start with a '/' character. This is why I'd be inclined to use an extra URL parameter instead, like: nbd://example.com[:port]/?export=exportname and for Unix domain sockets: nbd:///?export=exportname&socket=/socket The export would be optional, defaulting to empty string. IPv6 addresses would work in the obvious way for URLs, using "[...]" around the address part (ie as in RFC 2732). All escaping issues would work as for standard URLs. I think we should standardize this once and for all in a document in the NBD repository. Anyway let me know what you think and I will try to write something formal. 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
Attachment:
signature.asc
Description: PGP signature