qemu-devel.nongnu.org archive mirror
 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] [RFC v2 for-2.9 08/10] nbd: Tidy up blockdev-add interface
Date: Thu, 30 Mar 2017 18:31:18 +0200	[thread overview]
Message-ID: <dfc2b733-ae8e-6786-7f41-cd6857486801@redhat.com> (raw)
In-Reply-To: <1490879707-6060-9-git-send-email-armbru@redhat.com>

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

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 <armbru@redhat.com>
> ---
>  block/nbd.c          | 94 +++++++++++++++++++++++++++++++++++++---------------
>  qapi/block-core.json |  2 +-
>  2 files changed, 69 insertions(+), 27 deletions(-)

Reviewed-by: Max Reitz <mreitz@redhat.com>

(Hoping the next patch gets squashed in)


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

  parent reply	other threads:[~2017-03-30 16:31 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-30 13:14 [Qemu-devel] [RFC v2 for-2.9 00/10] Fixes and cleanups around SocketAddress Markus Armbruster
2017-03-30 13:14 ` [Qemu-devel] [RFC v2 for-2.9 01/10] nbd sockets vnc: Mark problematic address family tests TODO Markus Armbruster
2017-03-30 13:14 ` [Qemu-devel] [RFC v2 for-2.9 02/10] char: Fix socket with "type": "vsock" address Markus Armbruster
2017-03-30 13:15 ` [Qemu-devel] [RFC v2 for-2.9 03/10] io vnc sockets: Clean up SocketAddressKind switches Markus Armbruster
2017-04-03 11:48   ` Daniel P. Berrange
2017-04-03 12:50     ` Max Reitz
2017-04-03 13:05       ` Daniel P. Berrange
2017-04-03 13:06         ` Max Reitz
2017-03-30 13:15 ` [Qemu-devel] [RFC v2 for-2.9 04/10] block: Document -drive problematic code and bugs Markus Armbruster
2017-03-30 14:28   ` Eric Blake
2017-03-30 14:45     ` Markus Armbruster
2017-03-30 13:15 ` [Qemu-devel] [RFC v2 for-2.9 05/10] gluster: Prepare for SocketAddressFlat extension Markus Armbruster
2017-03-30 13:15 ` [Qemu-devel] [RFC v2 for-2.9 06/10] qapi-schema: SocketAddressFlat variants 'vsock' and 'fd' Markus Armbruster
2017-03-30 14:36   ` Eric Blake
2017-03-30 14:59     ` Markus Armbruster
2017-03-30 13:15 ` [Qemu-devel] [RFC v2 for-2.9 07/10] sockets: New helper socket_address_crumple() Markus Armbruster
2017-03-30 14:42   ` Eric Blake
2017-03-30 15:03     ` Markus Armbruster
2017-03-30 15:13       ` Eric Blake
2017-03-30 16:20       ` Max Reitz
2017-03-30 13:15 ` [Qemu-devel] [RFC v2 for-2.9 08/10] nbd: Tidy up blockdev-add interface Markus Armbruster
2017-03-30 15:09   ` Eric Blake
2017-03-30 15:37     ` Markus Armbruster
2017-03-30 16:31   ` Max Reitz [this message]
2017-03-30 13:15 ` [Qemu-devel] [RFC v2 for-2.9 09/10] squash! " Markus Armbruster
2017-03-30 15:19   ` Eric Blake
2017-03-30 15:54     ` Markus Armbruster
2017-03-30 16:32   ` Max Reitz
2017-03-30 13:15 ` [Qemu-devel] [RFC v2 for-2.9 10/10] sheepdog: Fix blockdev-add Markus Armbruster
2017-03-30 15:32   ` Eric Blake
2017-03-30 16:42   ` Max Reitz
2017-03-30 17:05     ` Markus Armbruster
2017-03-30 15:29 ` [Qemu-devel] [Qemu-block] [RFC v2 for-2.9 00/10] Fixes and cleanups around SocketAddress Kashyap Chamarthy
2017-03-30 15:47   ` Markus Armbruster

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=dfc2b733-ae8e-6786-7f41-cd6857486801@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).