From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48663) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcrZX-0006Tw-ME for qemu-devel@nongnu.org; Fri, 18 Sep 2015 05:03:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZcrZT-0008Mz-6n for qemu-devel@nongnu.org; Fri, 18 Sep 2015 05:03:11 -0400 Received: from [59.151.112.132] (port=42365 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcrZS-0008MC-R8 for qemu-devel@nongnu.org; Fri, 18 Sep 2015 05:03:07 -0400 Received: from G08CNEXCHPEKD02.g08.fujitsu.local (localhost.localdomain [127.0.0.1]) by edo.cn.fujitsu.com (8.14.3/8.13.1) with ESMTP id t8I92lgF011739 for ; Fri, 18 Sep 2015 17:02:47 +0800 Message-ID: <55FBD347.4020401@cn.fujitsu.com> Date: Fri, 18 Sep 2015 17:03:03 +0800 From: Yang Hongyang MIME-Version: 1.0 References: <1441857991-7309-1-git-send-email-eblake@redhat.com> <1441857991-7309-28-git-send-email-eblake@redhat.com> <55FA84C5.8060206@cn.fujitsu.com> <55FACF90.408@redhat.com> <55FB1E65.6030402@redhat.com> In-Reply-To: <55FB1E65.6030402@redhat.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH RFC v4 27/29] qapi: Change Netdev into a flat union List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org On 09/18/2015 04:11 AM, Eric Blake wrote: > On 09/17/2015 08:34 AM, Eric Blake wrote: > >>> >>> I apply Markus's v8 patch and this series, make check will fail: >>> TEST: tests/virtio-net-test... (pid=23648) >>> /x86_64/virtio/net/pci/basic: qemu-system-x86_64: -netdev socket,fd=6,id=hs0: Invalid parameter 'fd' >> >> Oh dear. I guess I was focused on 'make check-qapi-schema', and forgot >> to test the rest of the suite. The bug is most likely in my patches, >> and will be fixed by the time I post v5, now that you've pointed it out >> to me. > > Fix is simple: add this patch to your build: > > https://lists.gnu.org/archive/html/qemu-devel/2015-09/msg01650.html > > I've rebased my git repo accordingly for now, and will post v5 later on > (I'm still working on other improvements, and may reshuffle patches > before actually getting to v5). > > git fetch git://repo.or.cz/qemu/ericb.git qapi > http://repo.or.cz/qemu/ericb.git/shortlog/refs/heads/qapi I have to add a workaround in my previous netfilter v9 patchset(v10 and later changed to QOM, so it won't have the problem) to get flat union work. Seems that you have already fixed it. diff --git a/qapi/opts-visitor.c b/qapi/opts-visitor.c index 7ae33b3..1271fab 100644 --- a/qapi/opts-visitor.c +++ b/qapi/opts-visitor.c @@ -186,6 +186,20 @@ opts_end_struct(Visitor *v, Error **errp) } +static void opts_start_implicit_struct(Visitor *v, void **obj, + size_t size, Error **errp) +{ + if (obj) { + *obj = g_malloc0(size); + } +} + + +static void opts_end_implicit_struct(Visitor *v, Error **errp) +{ +} + + static GQueue * lookup_distinct(const OptsVisitor *ov, const char *name, Error **errp) { @@ -507,6 +521,8 @@ opts_visitor_new(const QemuOpts *opts) ov->visitor.start_struct = &opts_start_struct; ov->visitor.end_struct = &opts_end_struct; + ov->visitor.start_implicit_struct = &opts_start_implicit_struct; + ov->visitor.end_implicit_struct = &opts_end_implicit_struct; ov->visitor.start_list = &opts_start_list; ov->visitor.next_list = &opts_next_list; > -- Thanks, Yang.