From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44177) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWKxu-0006jK-LG for qemu-devel@nongnu.org; Mon, 31 Aug 2015 05:01:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZWKxo-0003Z5-Jw for qemu-devel@nongnu.org; Mon, 31 Aug 2015 05:01:22 -0400 Received: from [59.151.112.132] (port=34001 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZWKxo-0003Wh-9C for qemu-devel@nongnu.org; Mon, 31 Aug 2015 05:01:16 -0400 Message-ID: <55E417D0.8050800@cn.fujitsu.com> Date: Mon, 31 Aug 2015 17:01:04 +0800 From: Yang Hongyang MIME-Version: 1.0 References: <1440583182-5828-1-git-send-email-yanghy@cn.fujitsu.com> <1440583182-5828-4-git-send-email-yanghy@cn.fujitsu.com> <878u8ym649.fsf@blackfin.pond.sub.org> <55DDDD33.3000507@redhat.com> <87k2sfabku.fsf@blackfin.pond.sub.org> <55E3AFA2.1040702@cn.fujitsu.com> <871tek540h.fsf@blackfin.pond.sub.org> In-Reply-To: <871tek540h.fsf@blackfin.pond.sub.org> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v8 03/11] netfilter: add netfilter_{add|del} commands List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: thuth@redhat.com, zhang.zhanghailiang@huawei.com, lizhijian@cn.fujitsu.com, jasowang@redhat.com, qemu-devel@nongnu.org, mrhines@linux.vnet.ibm.com, Luiz Capitulino , stefanha@redhat.com On 08/31/2015 03:08 PM, Markus Armbruster wrote: > Yang Hongyang writes: > >> On 08/28/2015 07:37 PM, Markus Armbruster wrote: > [...] >>> To make progress, I suggest you try the following: >>> >>> 1. Make NetFilter a flat union, as I suggested in my review of PATCH 2. >>> >>> 2. Use Eric's idea above, because it avoids the dependency on code >>> that's still under review. >>> >>> Drawback: extra layer of nesting. Ugly, but not the end of the world, >>> and we still have a chance to peel it off before the next release. >> >> Thanks for the explanation, I will try to see if I can fully understand >> your point. > > If you have questions on the QAPI part, Eric and I will be happy to > answer them. Thanks a lot for the help! Sorry that I don't know much about the QAPI part, I have a question, in previous reply, Eric suggested: > > Then this becomes something like: > > { 'command': 'netfilter-add', 'data': 'NetFilter' } or use NetFilter as a union, but have the command be: { 'command': 'netfilter-add', 'data': { 'data': 'NetFilter' } } where you have to pass an extra layer of nesting at the QMP layer. What do you mean by pass an extra layer of nesting? I've already switched to flat union as you suggested: { 'struct': 'NetFilterDummyOptions', 'data': { } } { 'enum': 'NetFilterType', 'data': ['dummy'] } { 'struct': 'NetFilterBase', 'data': { 'id': 'str', 'netdev': 'str', '*chain': 'str', 'type': 'NetFilterType' } } { 'union': 'NetFilter', 'base': 'NetFilterBase', 'discriminator': 'type', 'data': { 'dummy': 'NetFilterDummyOptions' } } > . > -- Thanks, Yang.