[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v3 for-2.9 8/9] nbd: Tidy up blockdev-add interf
From: |
Max Reitz |
Subject: |
Re: [Qemu-block] [PATCH v3 for-2.9 8/9] nbd: Tidy up blockdev-add interface |
Date: |
Thu, 30 Mar 2017 23:35:48 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 |
On 30.03.2017 19:43, 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
Still s/=/-/, but nothing I can't fix. ;-)
Max
> 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:
>
> -drive
> if=none,driver=nbd,server.type=inet,server.data.host=127.0.0.1,server.data.port=12345
>
> Nobody should be using it, as it's fairly new and has never been
> documented, so adding still more compatibility gunk to keep it working
> isn't worth the trouble. You now have to use
>
> -drive
> if=none,driver=nbd,server.type=inet,server.host=127.0.0.1,server.port=12345
>
> Signed-off-by: Markus Armbruster <address@hidden>
> Reviewed-by: Eric Blake <address@hidden>
> Reviewed-by: Max Reitz <address@hidden>
> ---
> block/nbd.c | 53
> +++++++++++++++++++++++++++-------------------------
> qapi/block-core.json | 2 +-
> 2 files changed, 29 insertions(+), 26 deletions(-)
signature.asc
Description: OpenPGP digital signature
- [Qemu-block] [PATCH v3 for-2.9 0/9] Fixes and cleanups around SocketAddress, Markus Armbruster, 2017/03/30
- [Qemu-block] [PATCH v3 for-2.9 3/9] io vnc sockets: Clean up SocketAddressKind switches, Markus Armbruster, 2017/03/30
- [Qemu-block] [PATCH v3 for-2.9 6/9] qapi-schema: SocketAddressFlat variants 'vsock' and 'fd', Markus Armbruster, 2017/03/30
- [Qemu-block] [PATCH v3 for-2.9 5/9] gluster: Prepare for SocketAddressFlat extension, Markus Armbruster, 2017/03/30
- [Qemu-block] [PATCH v3 for-2.9 2/9] char: Fix socket with "type": "vsock" address, Markus Armbruster, 2017/03/30
- [Qemu-block] [PATCH v3 for-2.9 8/9] nbd: Tidy up blockdev-add interface, Markus Armbruster, 2017/03/30
- Re: [Qemu-block] [PATCH v3 for-2.9 8/9] nbd: Tidy up blockdev-add interface,
Max Reitz <=
- [Qemu-block] [PATCH v3 for-2.9 1/9] nbd sockets vnc: Mark problematic address family tests TODO, Markus Armbruster, 2017/03/30
- [Qemu-block] [PATCH v3 for-2.9 9/9] sheepdog: Fix blockdev-add, Markus Armbruster, 2017/03/30
- [Qemu-block] [PATCH v3 for-2.9 4/9] block: Document -drive problematic code and bugs, Markus Armbruster, 2017/03/30
- [Qemu-block] [PATCH v3 for-2.9 7/9] sockets: New helper socket_address_crumple(), Markus Armbruster, 2017/03/30
- Re: [Qemu-block] [PATCH v3 for-2.9 0/9] Fixes and cleanups around SocketAddress, Max Reitz, 2017/03/30