All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Wen Congyang <wency@cn.fujitsu.com>
To: Eric Blake <eblake@redhat.com>, Markus Armbruster <armbru@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>, Alberto Garcia <berto@igalia.com>,
	zhanghailiang <zhang.zhanghailiang@huawei.com>,
	qemu block <qemu-block@nongnu.org>,
	Jiang Yunhong <yunhong.jiang@intel.com>,
	Dong Eddie <eddie.dong@intel.com>,
	qemu devel <qemu-devel@nongnu.org>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Gonglei <arei.gonglei@huawei.com>,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Yang Hongyang <yanghy@cn.fujitsu.com>
Subject: Re: [Qemu-devel] [PATCH v3 1/5] support nbd driver in blockdev-add
Date: Wed, 16 Sep 2015 15:11:14 +0800	[thread overview]
Message-ID: <55F91612.6010300@cn.fujitsu.com> (raw)
In-Reply-To: <55F818F1.9070201@redhat.com>

On 09/15/2015 09:11 PM, Eric Blake wrote:
> On 09/14/2015 09:58 PM, Wen Congyang wrote:
>> On 09/15/2015 11:46 AM, Eric Blake wrote:
>>> On 09/14/2015 08:27 PM, Wen Congyang wrote:
>>>>> Building fails:
>>>>>   GEN   qmp-commands.h
>>>>> In file included from /work/src/qemu/qapi-schema.json:9:
>>>>> In file included from /work/src/qemu/qapi/block.json:6:
>>>>> /work/src/qemu/qapi/block-core.json:1844: Flat union 'BlockdevOptionsNBD' must have a string base field
>>>>> Makefile:286: recipe for target 'qmp-commands.h' failed
>>>>> make: *** [qmp-commands.h] Error 1
>>>
>>> Yep, doesn't work until pending qapi patches land.
>>
>> This patchset: qapi: QMP introspection?
> 
> That, and "qapi-ify netdev_add, and other post-introspection cleanups"
> https://lists.gnu.org/archive/html/qemu-devel/2015-09/msg02580.html
> 
> and "qapi: support anonymous inline base"
> https://lists.gnu.org/archive/html/qemu-devel/2015-08/msg02346.html
> [still needs rebasing to latest versions of the other series]
> 
> 
>>>
>>> Possible workaround in the meantime - instead of trying to go with a
>>> nice flat union (where all QMP keys are in the same {} level), we can
>>> use nesting (structs that add another {} to include the unions).
>>
>> How to include the unions to a structs? Use 'base'?
> 
> Conceptually, by adding a layer of nesting.  On the wire, instead of:
> 
> { "switch1":"value", "switch2":"value", "body2":"blah" }
> 
> you would instead have:
> 
> { "switch1":"value", "data": { "switch2":"value", "body2":"blah" } }
> 
> Anywhere in qapi that you try to have:
> { 'union': ..., 'data':{'switch1':'Union'}}
> 
> you instead create a wrapper type:
> { 'struct':'Wrapper', 'data':{'data':'Union'}}
> { 'union': ..., 'data':{'switch1':'Wrapper'}}

If so, the option is "data.switch1" not "switch1"

> 
> 
> What I don't know is whether the extra QMP nesting makes it easier or
> harder to support the existing NBD command line options, and it would

Yes, it is harder to support it.

Thanks
Wen Congyang

> ultimately be nice to have unified support so that anything we can do on
> the command line can be expressed in QMP; and anything we can do in QMP
> can be expressed on the command line without undue nesting.
> 

  reply	other threads:[~2015-09-16  7:12 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-10  9:55 [Qemu-devel] [PATCH v3 0/5] qapi: child add/delete support Wen Congyang
2015-09-10  9:55 ` [Qemu-devel] [PATCH v3 1/5] support nbd driver in blockdev-add Wen Congyang
2015-09-14 14:27   ` Markus Armbruster
2015-09-14 15:47     ` Eric Blake
2015-09-15  1:39       ` Wen Congyang
2015-09-15  7:37         ` Markus Armbruster
2015-09-15  8:01           ` Wen Congyang
2015-09-15 11:12             ` Markus Armbruster
2015-09-16  5:59               ` Wen Congyang
2015-09-16  8:21                 ` Markus Armbruster
2015-09-16  8:24                   ` Wen Congyang
2015-09-16 11:18                     ` Markus Armbruster
2015-09-16 14:53                       ` [Qemu-devel] [Qemu-block] " Eric Blake
2015-09-17  1:06                         ` Wen Congyang
2015-09-17  1:04                       ` [Qemu-devel] " Wen Congyang
2015-09-17  5:01                         ` Markus Armbruster
2015-09-15 13:03           ` Eric Blake
2015-09-15 13:26             ` Kevin Wolf
2015-09-15  2:20       ` Wen Congyang
2015-09-15  2:27         ` Wen Congyang
2015-09-15  3:46           ` Eric Blake
2015-09-15  3:58             ` Wen Congyang
2015-09-15 13:11               ` Eric Blake
2015-09-16  7:11                 ` Wen Congyang [this message]
2015-09-16 14:55                   ` Eric Blake
2015-09-10  9:55 ` [Qemu-devel] [PATCH v3 2/5] Add new block driver interface to add/delete a BDS's child Wen Congyang
2015-09-10  9:55 ` [Qemu-devel] [PATCH v3 3/5] quorum: implement bdrv_add_child() and bdrv_del_child() Wen Congyang
2015-09-10  9:55 ` [Qemu-devel] [PATCH v3 4/5] qmp: add monitor command to add/remove a child Wen Congyang
2015-09-10 10:04   ` Daniel P. Berrange
2015-09-10 10:34     ` Wen Congyang
2015-09-14 14:36   ` Markus Armbruster
2015-09-14 15:34     ` Kevin Wolf
2015-09-14 16:09       ` Markus Armbruster
2015-09-15  2:40     ` Wen Congyang
2015-09-15  7:49       ` Markus Armbruster
2015-09-15  7:57         ` Wen Congyang
2015-09-16  6:31         ` Wen Congyang
2015-09-16  8:29           ` Markus Armbruster
2015-09-14 15:37   ` Kevin Wolf
2015-09-15  2:33     ` Wen Congyang
2015-09-15  8:56     ` Alberto Garcia
2015-09-15  9:20       ` Kevin Wolf
2015-09-15  9:26         ` [Qemu-devel] [Qemu-block] " Kevin Wolf
2015-09-10  9:55 ` [Qemu-devel] [PATCH v3 5/5] hmp: " Wen Congyang

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=55F91612.6010300@cn.fujitsu.com \
    --to=wency@cn.fujitsu.com \
    --cc=arei.gonglei@huawei.com \
    --cc=armbru@redhat.com \
    --cc=berto@igalia.com \
    --cc=dgilbert@redhat.com \
    --cc=eblake@redhat.com \
    --cc=eddie.dong@intel.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=yanghy@cn.fujitsu.com \
    --cc=yunhong.jiang@intel.com \
    --cc=zhang.zhanghailiang@huawei.com \
    /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.