go-nbd icon indicating copy to clipboard operation
go-nbd copied to clipboard

Support NBD URIs in the client

Open rwmjones opened this issue 11 months ago • 1 comments

Just want to make you aware of the NBD URI specification. It's a simple extension of the basic NBD protocol, allowing an easy and cross-client way for NBD endpoints to be specified. eg:

nbd://localhost = NBD unencrypted over TCP to localhost:10809, default export name

nbds+unix:///default?socket=/tmp/sock = NBD encrypted over Unix domain socket /tmp/sock, export name default

Some other examples below, as well as more in the specification above. https://libguestfs.org/nbd_connect_uri.3.html

rwmjones avatar Mar 24 '24 14:03 rwmjones

(Adding @ebblake)

rwmjones avatar Mar 24 '24 15:03 rwmjones

This could be interesting, but it's not something that really is in the scope of this project since it's intended for the for use as a library. The internal interface asks for any net.Conn, so this is something that could be implemented by anyone using the go-nbd library:

func client.Connect(conn net.Conn, device *os.File, options *client.Options) error

pojntfx avatar Jul 30 '24 23:07 pojntfx