[PATCH 3/5] Use virNWFilterBindingObjEndAPI() more

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

 



Instead of explicit virObjectUnlock(obj) + virObjectUnref(obj)
combo the virNWFilterBindingObjEndAPI() can be used.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/conf/virnwfilterbindingobjlist.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/src/conf/virnwfilterbindingobjlist.c b/src/conf/virnwfilterbindingobjlist.c
index 470a30ca90..212cca2265 100644
--- a/src/conf/virnwfilterbindingobjlist.c
+++ b/src/conf/virnwfilterbindingobjlist.c
@@ -114,11 +114,8 @@ virNWFilterBindingObjListFindByPortDev(virNWFilterBindingObjList *bindings,
     obj = virNWFilterBindingObjListFindByPortDevLocked(bindings, name);
     virObjectRWUnlock(bindings);
 
-    if (obj && virNWFilterBindingObjGetRemoving(obj)) {
-        virObjectUnlock(obj);
-        virObjectUnref(obj);
-        obj = NULL;
-    }
+    if (obj && virNWFilterBindingObjGetRemoving(obj))
+        virNWFilterBindingObjEndAPI(&obj);
 
     return obj;
 }
@@ -407,8 +404,7 @@ virNWFilterBindingObjListFilter(virNWFilterBindingObj ***list,
          */
         if (virNWFilterBindingObjGetRemoving(binding) ||
             (filter && !filter(conn, def))) {
-            virObjectUnlock(binding);
-            virObjectUnref(binding);
+            virNWFilterBindingObjEndAPI(&binding);
             VIR_DELETE_ELEMENT(*list, i, *nbindings);
             continue;
         }
-- 
2.32.0




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux