All of lore.kernel.org
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org
Cc: qemu-block@nongnu.org, mitake.hitoshi@lab.ntt.co.jp,
	namei.unix@gmail.com, jcody@redhat.com, kwolf@redhat.com,
	eblake@redhat.com, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH v3 for-2.9 8/9] nbd: Tidy up blockdev-add interface
Date: Thu, 30 Mar 2017 23:35:48 +0200	[thread overview]
Message-ID: <e6382858-ec9e-233e-74b4-4b3197a35039@redhat.com> (raw)
In-Reply-To: <1490895797-29094-9-git-send-email-armbru@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2121 bytes --]

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 <armbru@redhat.com>
> Reviewed-by: Eric Blake <eblake@redhat.com>
> Reviewed-by: Max Reitz <mreitz@redhat.com>
> ---
>  block/nbd.c          | 53 +++++++++++++++++++++++++++-------------------------
>  qapi/block-core.json |  2 +-
>  2 files changed, 29 insertions(+), 26 deletions(-)



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 512 bytes --]

  reply	other threads:[~2017-03-30 21:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-30 17:43 [Qemu-devel] [PATCH v3 for-2.9 0/9] Fixes and cleanups around SocketAddress Markus Armbruster
2017-03-30 17:43 ` [Qemu-devel] [PATCH v3 for-2.9 1/9] nbd sockets vnc: Mark problematic address family tests TODO Markus Armbruster
2017-03-30 17:43 ` [Qemu-devel] [PATCH v3 for-2.9 2/9] char: Fix socket with "type": "vsock" address Markus Armbruster
2017-03-31  9:03   ` Stefan Hajnoczi
2017-03-30 17:43 ` [Qemu-devel] [PATCH v3 for-2.9 3/9] io vnc sockets: Clean up SocketAddressKind switches Markus Armbruster
2017-03-30 17:43 ` [Qemu-devel] [PATCH v3 for-2.9 4/9] block: Document -drive problematic code and bugs Markus Armbruster
2017-03-30 18:00   ` Eric Blake
2017-03-30 18:56     ` Markus Armbruster
2017-03-30 21:29       ` Max Reitz
2017-03-30 17:43 ` [Qemu-devel] [PATCH v3 for-2.9 5/9] gluster: Prepare for SocketAddressFlat extension Markus Armbruster
2017-03-30 17:43 ` [Qemu-devel] [PATCH v3 for-2.9 6/9] qapi-schema: SocketAddressFlat variants 'vsock' and 'fd' Markus Armbruster
2017-03-30 17:43 ` [Qemu-devel] [PATCH v3 for-2.9 7/9] sockets: New helper socket_address_crumple() Markus Armbruster
2017-03-30 18:02   ` Eric Blake
2017-03-30 17:43 ` [Qemu-devel] [PATCH v3 for-2.9 8/9] nbd: Tidy up blockdev-add interface Markus Armbruster
2017-03-30 21:35   ` Max Reitz [this message]
2017-03-30 17:43 ` [Qemu-devel] [PATCH v3 for-2.9 9/9] sheepdog: Fix blockdev-add Markus Armbruster
2017-03-30 21:42 ` [Qemu-devel] [PATCH v3 for-2.9 0/9] Fixes and cleanups around SocketAddress Max Reitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e6382858-ec9e-233e-74b4-4b3197a35039@redhat.com \
    --to=mreitz@redhat.com \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=jcody@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=mitake.hitoshi@lab.ntt.co.jp \
    --cc=namei.unix@gmail.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.