block/nbd: Accept SocketAddress

Add a new option "server" to the NBD block driver which accepts a
SocketAddress.

"path", "host" and "port" are still supported as legacy options and are
mapped to their corresponding SocketAddress representation.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Max Reitz 2016-10-25 15:11:34 +02:00 committed by Kevin Wolf
parent 48c38e0b8d
commit 491d6c7c4e
3 changed files with 121 additions and 70 deletions

View file

@ -222,7 +222,7 @@ Testing: -drive driver=file
QEMU_PROG: -drive driver=file: The 'file' block driver requires a file name
Testing: -drive driver=nbd
QEMU_PROG: -drive driver=nbd: one of path and host must be specified
QEMU_PROG: -drive driver=nbd: NBD server address missing
Testing: -drive driver=raw
QEMU_PROG: -drive driver=raw: Can't use 'raw' as a block driver for the protocol level
@ -231,7 +231,7 @@ Testing: -drive file.driver=file
QEMU_PROG: -drive file.driver=file: The 'file' block driver requires a file name
Testing: -drive file.driver=nbd
QEMU_PROG: -drive file.driver=nbd: one of path and host must be specified
QEMU_PROG: -drive file.driver=nbd: NBD server address missing
Testing: -drive file.driver=raw
QEMU_PROG: -drive file.driver=raw: Can't use 'raw' as a block driver for the protocol level