[PATCH 2/5] Use virInterfaceObjEndAPI() more

Michal Privoznik mprivozn at redhat.com
Thu Nov 11 09:28:18 UTC 2021


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

Signed-off-by: Michal Privoznik <mprivozn at redhat.com>
---
 src/conf/virinterfaceobj.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/conf/virinterfaceobj.c b/src/conf/virinterfaceobj.c
index fa7a21c054..c5dfa6c7f5 100644
--- a/src/conf/virinterfaceobj.c
+++ b/src/conf/virinterfaceobj.c
@@ -462,8 +462,7 @@ virInterfaceObjListRemove(virInterfaceObjList *interfaces,
     virObjectRWLockWrite(interfaces);
     virObjectLock(obj);
     virHashRemoveEntry(interfaces->objsName, obj->def->name);
-    virObjectUnlock(obj);
-    virObjectUnref(obj);
+    virInterfaceObjEndAPI(&obj);
     virObjectRWUnlock(interfaces);
 }
 
-- 
2.32.0




More information about the libvir-list mailing list