On 30.03.2017 15:15, Markus Armbruster wrote: > SocketAddress is a simple union, and simple unions are awkward: they > have their variant members wrapped in a "data" object on the wire, and > require additional indirections in C. I intend to limit its use to > existing external interfaces, and convert all internal interfaces to > SocketAddressFlat. > > BlockdevOptionsNbd is an external interface using SocketAddress. We > already use SocketAddressFlat elsewhere in blockdev=add. Replace it
s/=/-/
> by SocketAddressFlat while we can (it's new in 2.9) for simplicity and
> consistency. For example,
>
> { "execute": "blockdev-add",
> "arguments": { "node-name": "foo", "driver": "nbd",
> "server": { "type": "inet",
> "data": { "host": "localhost",
> "port": "12345" } } } }
>
> becomes
>
> { "execute": "blockdev-add",
> "arguments": { "node-name": "foo", "driver": "nbd",
> "server": { "type": "inet",
> "host": "localhost", "port": "12345" } } }
>
> Since the internal interfaces still take SocketAddress, this requires
> conversion function socket_address_crumple(). It'll go away when I
> update the interfaces.
>
> Unfortunately, SocketAddress is also visible in -drive since 2.8. Add
> still more gunk to nbd_process_legacy_socket_options(). You can now
> shorten
>
> -drive
> if=none,driver=nbd,server.type=inet,server.data.host=127.0.0.1,server.data.port=12345
>
> to
>
> -drive
> if=none,driver=nbd,server.type=inet,server.host=127.0.0.1,server.port=12345
>
> Signed-off-by: Markus Armbruster <[email protected]>
> ---
> block/nbd.c | 94
> +++++++++++++++++++++++++++++++++++++---------------
> qapi/block-core.json | 2 +-
> 2 files changed, 69 insertions(+), 27 deletions(-)
Reviewed-by: Max Reitz <[email protected]>
(Hoping the next patch gets squashed in)
signature.asc
Description: OpenPGP digital signature
