From 17fe6a090ba389cdd228c3e176788d9b2d45525f Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Fri, 18 Mar 2022 11:36:47 +0100 Subject: [PATCH] virnwfilterobj: Don't use virObjectLockGuard() with virNWFilterObj 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 Signed-off-by: Michal Privoznik Reviewed-by: Erik Skultety --- 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))