nbd icon indicating copy to clipboard operation
nbd copied to clipboard

nbd-client connects to wrong port

Open hartmark opened this issue 1 year ago • 1 comments

I was trying to replicate https://github.com/NetworkBlockDevice/nbd/issues/169 using latest from master branch.

I noticed that nbd-client have an issue where the port number is ignored.

First I startup my server: sudo ./nbd-server localhost:31488 /srv/nbd/hej.img -C foo --copy-on-write -d

Then I use this to connect: sudo ./nbd-client -name foo localhost 31488 /dev/nbd3

Noting is outputted in the server. But!! nbdkit which I have switched to instead that is listening on the default 10809 port outputs this:

Sep 29 23:46:57 staropramen nbdkit[694634]: nbdkit: debug: accepted connection
Sep 29 23:46:57 staropramen nbdkit[694634]: nbdkit: ondemand[18]: debug: ondemand: preconnect
Sep 29 23:46:57 staropramen nbdkit[694634]: nbdkit: ondemand[18]: debug: newstyle negotiation: flags: global 0x3
Sep 29 23:46:57 staropramen nbdkit[694634]: nbdkit: ondemand[18]: debug: newstyle negotiation: client flags: 0x3
Sep 29 23:46:57 staropramen nbdkit[694634]: nbdkit: ondemand[18]: debug: newstyle negotiation: NBD_OPT_GO: client requested export 'foo'
Sep 29 23:46:57 staropramen nbdkit[694634]: nbdkit: ondemand[18]: debug: ondemand: open readonly=0 exportname="foo" tls=0

Another question: How do I specify the exportname that should be used when I'm running nbd-server without any config-file?

hartmark avatar Sep 29 '24 21:09 hartmark

Also is it possible to get more debug output from nbd-client and nbd-server commands?

hartmark avatar Sep 29 '24 21:09 hartmark

When specifying an export on the command line, the syntax is "host@port", not "host:port".

Note that specifying exports on the command line is deprecated though.

yoe avatar Dec 20 '24 10:12 yoe

Aha, didn't see your use @ for delimiter, : is most common though.

What do you mean it's deprecated?

hartmark avatar Dec 20 '24 11:12 hartmark