[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v9 01/10] net: add a new object netfilter
From: |
Daniel P. Berrange |
Subject: |
Re: [Qemu-devel] [PATCH v9 01/10] net: add a new object netfilter |
Date: |
Wed, 2 Sep 2015 14:04:05 +0100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Wed, Sep 02, 2015 at 01:58:58PM +0100, Stefan Hajnoczi wrote:
> 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.
Yep, you're right - using QOM would be a better idea as it avoids
all the QemuOpts boilerplate command line handling and being part
of the standard object framework makes introspection easier for
apps too.
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
- Re: [Qemu-devel] [PATCH v9 05/10] move out net queue structs define, (continued)
- Re: [Qemu-devel] [PATCH v9 05/10] move out net queue structs define, Yang Hongyang, 2015/09/07
- Re: [Qemu-devel] [PATCH v9 05/10] move out net queue structs define, Daniel P. Berrange, 2015/09/07
- Re: [Qemu-devel] [PATCH v9 05/10] move out net queue structs define, Yang Hongyang, 2015/09/07
- Re: [Qemu-devel] [PATCH v9 05/10] move out net queue structs define, Daniel P. Berrange, 2015/09/07
- Re: [Qemu-devel] [PATCH v9 05/10] move out net queue structs define, Yang Hongyang, 2015/09/07
[Qemu-devel] [PATCH v9 07/10] netfilter: print filter info associate with the netdev, Yang Hongyang, 2015/09/01
[Qemu-devel] [PATCH v9 01/10] net: add a new object netfilter, Yang Hongyang, 2015/09/01
[Qemu-devel] [PATCH v9 10/10] tests: add test cases for netfilter object, Yang Hongyang, 2015/09/01