From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39080) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZX7d5-0002R9-PG for qemu-devel@nongnu.org; Wed, 02 Sep 2015 08:59:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZX7d1-0001L1-ED for qemu-devel@nongnu.org; Wed, 02 Sep 2015 08:59:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55989) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZX7d1-0001Kv-9T for qemu-devel@nongnu.org; Wed, 02 Sep 2015 08:59:03 -0400 Date: Wed, 2 Sep 2015 13:58:58 +0100 From: Stefan Hajnoczi Message-ID: <20150902125858.GH17873@stefanha-thinkpad.redhat.com> References: <1441098383-22585-1-git-send-email-yanghy@cn.fujitsu.com> <1441098383-22585-2-git-send-email-yanghy@cn.fujitsu.com> <20150901143622.GC2407@stefanha-thinkpad.redhat.com> <55E6533F.30600@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55E6533F.30600@cn.fujitsu.com> Subject: Re: [Qemu-devel] [PATCH v9 01/10] net: add a new object netfilter List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Yang Hongyang Cc: thuth@redhat.com, zhang.zhanghailiang@huawei.com, lizhijian@cn.fujitsu.com, jasowang@redhat.com, qemu-devel@nongnu.org, mrhines@linux.vnet.ibm.com, Markus Armbruster , Paolo Bonzini , Andreas Faerber On Wed, Sep 02, 2015 at 09:39:11AM +0800, Yang Hongyang wrote: > On 09/01/2015 10:36 PM, Stefan Hajnoczi wrote: > >On Tue, Sep 01, 2015 at 05:06:14PM +0800, Yang Hongyang wrote: > >>diff --git a/qemu-options.hx b/qemu-options.hx > >>index 77f5853..f1d42a1 100644 > >>--- a/qemu-options.hx > >>+++ b/qemu-options.hx > >>@@ -1991,6 +1991,27 @@ override the default configuration (@option{-net nic -net user}) which > >> is activated if no @option{-net} options are provided. > >> ETEXI > >> > >>+DEF("netfilter", HAS_ARG, QEMU_OPTION_netfilter, > >>+ "-netfilter buffer,id=str,netdev=str[,chain=in|out|all,interval=t]\n" > >>+ " buffer network packets on netdev. if interval provided, will release\n" > >>+ " packets by interval. Interval scale: microsecond\n", QEMU_ARCH_ALL) > > > >Perhaps the -object option should be used: > > > > -object netfilter-buffer,id=str,netdev=str[,chain=in|out|all,interval=t] > > > >That is how IOThread and memory backends were recently added. > > > >They are QOM objects (see include/qom/object.h) and eliminate the need > >to write boilerplate code that adds new command-line options and > >instantiates objects. > > I thought -netfilter is more obvious for an object name, -object is kind of > abstract name... but I'm not maintainer, if you think it's really need to > change to -object, I can do that. The advantage of QOM and -object is that it eliminates code for command-line options, object instantiation, etc. They introduce a single object model that all types within QEMU can use instead of inventing their own. Personally I'm not that involved in QAPI or command-line but I thought -object was the new preferred way to do things. This is where I guess Markus and Andreas might have opinions. Stefan