From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43787) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcNvF-0007Uq-OY for qemu-devel@nongnu.org; Wed, 16 Sep 2015 21:23:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZcNvB-0006Wg-M4 for qemu-devel@nongnu.org; Wed, 16 Sep 2015 21:23:37 -0400 Received: from [59.151.112.132] (port=33924 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZcNvB-0006WT-7v for qemu-devel@nongnu.org; Wed, 16 Sep 2015 21:23:33 -0400 Message-ID: <55FA1602.2090309@cn.fujitsu.com> Date: Thu, 17 Sep 2015 09:23:14 +0800 From: Yang Hongyang MIME-Version: 1.0 References: <1442405768-23019-1-git-send-email-yanghy@cn.fujitsu.com> <1442405768-23019-3-git-send-email-yanghy@cn.fujitsu.com> <55F9DA8A.1090306@redhat.com> In-Reply-To: <55F9DA8A.1090306@redhat.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v11 02/12] init/cleanup of netfilter object List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , qemu-devel@nongnu.org Cc: thuth@redhat.com, zhang.zhanghailiang@huawei.com, lizhijian@cn.fujitsu.com, jasowang@redhat.com, armbru@redhat.com, stefanha@redhat.com Hi Eric, On 09/17/2015 05:09 AM, Eric Blake wrote: > On 09/16/2015 06:15 AM, Yang Hongyang wrote: >> Add a netfilter object based on QOM. >> >> A netfilter is attached to a netdev, captures all network packets >> that pass through the netdev. When we delete the netdev, we also >> delete the netfilter object attached to it, because if the netdev is >> removed, the filter which attached to it is useless. >> >> QTAILQ_ENTRY next used by netdev, filter belongs to the specific netdev is >> in this queue. >> >> Also init delayed object after net_init_clients, because netfilters need >> to be initialized after net clients initialized. >> >> Signed-off-by: Yang Hongyang >> --- > > Interface review: > >> +++ b/qapi-schema.json >> @@ -2551,6 +2551,24 @@ >> 'opts': 'NetClientOptions' } } >> >> ## >> +# @NetFilterChain >> +# >> +# netfilter chain, a netfilter is attached to a netdev, captures the >> +# network packets of the netdev. > > Grammar. Maybe: > > This enum describes which packets are being tracked by a netfilter chain > attached as a filter to a netdev object. Thanks! > >> +# >> +# @all: the filter will receive packets both sent to/from the netdev, this >> +# is the default chain. >> +# >> +# @in: the filter will receive packets sent to the netdev. >> +# >> +# @out: the filter will receive packets sent from the netdev. >> +# >> +# Since 2.5 >> +## >> +{ 'enum': 'NetFilterChain', >> + 'data': [ 'all', 'in', 'out' ] } > > I don't see any other QMP usage of this enum anywhere in the series. Are > you planning on supporting QMP? If so, let's get that design discussion > started. If not, why not? This series is based on QOM, so the QMP command for object_add will use this enum, for example: 1 { "execute": "qmp_capabilities" } 2 { "execute": "object-add", 3 "arguments": { "qom-type": "filter-buffer", 4 "id": "f0", 5 "props": { "netdev": "bn0", 6 "chain": "in", 7 "interval": 2000 } } } for hmp: object_add filter-buffer,id=f0,netdev=bn0,chain=in,interval=1000 command options: -object filter-buffer,id=f0,netdev=bn0,chain=in,interval=1000 > > In particular, you may want to base things on top of my work to make QMP > 'netdev_add' a full-fledged introspectible command (still pending some > qapi commits landing upstream): > > https://lists.gnu.org/archive/html/qemu-devel/2015-09/msg02602.html > -- Thanks, Yang.