[PATCH] virnwfilterobj: Don't use virObjectLockGuard() with virNWFilterObj

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

 



While its name would suggest that virNWFilterObj is an actual
virObject it is not. It's a plain structure (with virMutex as its
first member). Therefore, when locking the struct
virObjectLockGuard() can' be used and virLockGuardLock() must be
used instead.

Spotted-by: Martin Kletzander <mkletzan@xxxxxxxxxx>
Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/conf/virnwfilterobj.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/conf/virnwfilterobj.c b/src/conf/virnwfilterobj.c
index 309f8bddb4..e9bb2b1811 100644
--- a/src/conf/virnwfilterobj.c
+++ b/src/conf/virnwfilterobj.c
@@ -386,7 +386,7 @@ virNWFilterObjListCount(void *key G_GNUC_UNUSED,
 {
     virNWFilterObj *obj = payload;
     struct virNWFilterObjListData *data = opaque;
-    VIR_LOCK_GUARD lock = virObjectLockGuard(obj);
+    VIR_LOCK_GUARD lock = virLockGuardLock(&obj->lock);
 
     if (data->filter(data->conn, obj->def))
         data->count++;
@@ -423,7 +423,7 @@ virNWFilterObjListCopyNames(void *key G_GNUC_UNUSED,
 {
     virNWFilterObj *obj = payload;
     struct virNWFilterNameData *data = opaque;
-    VIR_LOCK_GUARD lock = virObjectLockGuard(obj);
+    VIR_LOCK_GUARD lock = virLockGuardLock(&obj->lock);
 
     if (data->filter &&
         !data->filter(data->conn, obj->def))
-- 
2.34.1




[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