From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48979) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYuF5-0002IZ-Nf for qemu-devel@nongnu.org; Mon, 07 Sep 2015 07:05:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZYu3k-0007ss-Qb for qemu-devel@nongnu.org; Mon, 07 Sep 2015 06:54:03 -0400 Received: from [59.151.112.132] (port=20500 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYu3k-0007sL-Ee for qemu-devel@nongnu.org; Mon, 07 Sep 2015 06:54:00 -0400 Message-ID: <55ED6CBD.90602@cn.fujitsu.com> Date: Mon, 7 Sep 2015 18:53:49 +0800 From: Yang Hongyang MIME-Version: 1.0 References: <1441098383-22585-1-git-send-email-yanghy@cn.fujitsu.com> <1441098383-22585-6-git-send-email-yanghy@cn.fujitsu.com> <20150901144308.GE2407@stefanha-thinkpad.redhat.com> <55E6559E.5060305@cn.fujitsu.com> <20150902130245.GI17873@stefanha-thinkpad.redhat.com> <55E7214A.20803@cn.fujitsu.com> <20150904103255.GB8683@stefanha-thinkpad.redhat.com> <55ED3EB0.1030902@cn.fujitsu.com> <20150907091117.GA8893@stefanha-thinkpad.redhat.com> In-Reply-To: <20150907091117.GA8893@stefanha-thinkpad.redhat.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v9 05/10] move out net queue structs define List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi 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 , Andreas Faerber On 09/07/2015 05:11 PM, Stefan Hajnoczi wrote: [...] >> Thanks very much for the suggestion, I've already implemented it and tested, >> the code looks cleaner now. >> >> The last issue is the QOM thing, do Markus and Andreas have more input >> about that? > > If you would like to see examples of QOM usage, take a look at > iothread.c and/or backends/hostmem.c. > > The key things are: > > 1. They use include/qom/object.h to register a type based on > TYPE_OBJECT and their properties are registered using > object_property_add_*(). > > 2. They implement the TYPE_USER_CREATABLE interface so the -object > command-line option can be used to instantiate them. See > object_interfaces.h. > > As a result, a lot of code becomes unnecessary and iothread.c, in > particular, is quite short. After looking into this, I have some questions on the implement, could you please help me on this because I don't know much about the object mechanism: The netfilter need to be initialized after the net_init_clients, because we need to attach the filter to the net client. But currently, net client is not using QOM, and seems that it is initialized after objects been created. So here comes the problem: how can I initialize a certain object later, is it possiable? > > Stefan > . > -- Thanks, Yang.