]> Git Repo - qemu.git/commit
nbd: Fix filename generation
authorMax Reitz <[email protected]>
Wed, 8 Oct 2014 17:55:15 +0000 (19:55 +0200)
committerKevin Wolf <[email protected]>
Mon, 20 Oct 2014 11:41:26 +0000 (13:41 +0200)
commitec0de76874462c745a1600911bd81ee0253c0c23
tree01616a1295932a8eb18b4326dbdd01f8caf1228a
parent7c15903789953ead14a417882657d52dc0c19a24
nbd: Fix filename generation

Export names may be used with nbd+unix, too, fix nbd_refresh_filename()
accordingly. Also, for nbd+tcp, the documented path schema is
"nbd://host[:port]/export", so use it. Furthermore, as can be seen from
that schema, the port is optional.

That makes six single cases for how the filename can be formatted; it is
not easy to generalize these cases without the resulting statement being
completely unreadable, thus there is simply one snprintf() per case.

Finally, taking the options from BDRVNBDState::socket_opts is wrong,
because those will not contain the export name. Just use
BlockDriverState::options instead.

Reported-by: Stefan Hajnoczi <[email protected]>
Signed-off-by: Max Reitz <[email protected]>
Reviewed-by: Paolo Bonzini <[email protected]>
Signed-off-by: Kevin Wolf <[email protected]>
block/nbd.c
This page took 0.025496 seconds and 4 git commands to generate.