qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v11 12/12] netfilter: add multiqueue support


From: Jason Wang
Subject: Re: [Qemu-devel] [PATCH v11 12/12] netfilter: add multiqueue support
Date: Tue, 22 Sep 2015 17:19:56 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.2.0


On 09/22/2015 04:35 PM, Yang Hongyang wrote:
>
>
> 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(). 

I see. Thanks.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]