NetworkBlockDevice / nbd

Network Block Device
GNU General Public License v2.0
459 stars 120 forks source link

nbd-client connects to wrong port #172

Open hartmark opened 1 month ago

hartmark commented 1 month ago

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 commented 1 month ago

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