From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58005) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeJ30-0004iV-Ul for qemu-devel@nongnu.org; Tue, 22 Sep 2015 04:35:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZeJ2v-0008PX-Mp for qemu-devel@nongnu.org; Tue, 22 Sep 2015 04:35:34 -0400 Received: from [59.151.112.132] (port=13546 helo=heian.cn.fujitsu.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZeJ2u-0008O6-IX for qemu-devel@nongnu.org; Tue, 22 Sep 2015 04:35:29 -0400 Message-ID: <560112CA.8010502@cn.fujitsu.com> Date: Tue, 22 Sep 2015 16:35:22 +0800 From: Yang Hongyang MIME-Version: 1.0 References: <1442405768-23019-1-git-send-email-yanghy@cn.fujitsu.com> <1442405768-23019-13-git-send-email-yanghy@cn.fujitsu.com> <56010511.2040303@redhat.com> <5601080F.9090305@cn.fujitsu.com> <560111E4.9030606@redhat.com> In-Reply-To: <560111E4.9030606@redhat.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v11 12/12] netfilter: add multiqueue support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jason Wang , qemu-devel@nongnu.org Cc: thuth@redhat.com, zhang.zhanghailiang@huawei.com, lizhijian@cn.fujitsu.com, armbru@redhat.com, Yang Hongyang , stefanha@redhat.com On 09/22/2015 04:31 PM, Jason Wang wrote: [...] >>>> + /* setup filter */ >>>> + nfqc = NETFILTER_GET_CLASS(obj); >>>> + if (nfqc->setup) { >>>> + nfqc->setup(nfq, &local_err); >>>> + if (local_err) { >>>> + error_propagate(errp, local_err); >>>> + goto out; >>>> + } >>>> + } >>>> + QTAILQ_INSERT_TAIL(&nfq->netdev->filters, nfq, next); >>>> + object_unref(obj); >> ^^^^^^^^^^^^ >> >>>> + } >>>> + >>>> + if (proptable) { >>>> + g_hash_table_unref(proptable); >>>> + } >>>> + return; >>>> + >>>> +out: >>> >>> We may leak objects here. >> >> Seems not. see above object_unref(), if we come to >> here, object create in previous iter will be unrefed. > > Maybe I miss something. But there's still refcnt for objects created in > previous iters? (I mean object_property_add_child() will add another > refcnt?) This is intended, parent need to hold a refcnt of it's child. When we delete the parent, it will release the child refcnt, and it's child obj will be automatically deleted because the refcnt is decreased to 0. The object_unref() release the refcnt hold by object_new(). > >> >>> >>>> + if (proptable) { >>>> + g_hash_table_unref(proptable); >>>> + } >>>> + if (obj) { >>>> + object_unref(obj); >>>> + } >>>> } >>>> >>>> static void netfilter_class_init(ObjectClass *oc, void *data) >>> >>> To reduce the review iterations, I suggest to drop the patch also. >>> Multiqueue support could be another series on top. >> >> I agree, thank you. >> >>> >>> Thanks >>> >>> >>> . >>> >> > > . > -- Thanks, Yang.