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: Yang Hongyang
Subject: Re: [Qemu-devel] [PATCH v11 12/12] netfilter: add multiqueue support
Date: Tue, 22 Sep 2015 16:35:22 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0



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.



reply via email to

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