mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
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 <mkletzan@redhat.com> Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
parent
45dcb1a881
commit
17fe6a090b
@ -386,7 +386,7 @@ virNWFilterObjListCount(void *key G_GNUC_UNUSED,
|
|||||||
{
|
{
|
||||||
virNWFilterObj *obj = payload;
|
virNWFilterObj *obj = payload;
|
||||||
struct virNWFilterObjListData *data = opaque;
|
struct virNWFilterObjListData *data = opaque;
|
||||||
VIR_LOCK_GUARD lock = virObjectLockGuard(obj);
|
VIR_LOCK_GUARD lock = virLockGuardLock(&obj->lock);
|
||||||
|
|
||||||
if (data->filter(data->conn, obj->def))
|
if (data->filter(data->conn, obj->def))
|
||||||
data->count++;
|
data->count++;
|
||||||
@ -423,7 +423,7 @@ virNWFilterObjListCopyNames(void *key G_GNUC_UNUSED,
|
|||||||
{
|
{
|
||||||
virNWFilterObj *obj = payload;
|
virNWFilterObj *obj = payload;
|
||||||
struct virNWFilterNameData *data = opaque;
|
struct virNWFilterNameData *data = opaque;
|
||||||
VIR_LOCK_GUARD lock = virObjectLockGuard(obj);
|
VIR_LOCK_GUARD lock = virLockGuardLock(&obj->lock);
|
||||||
|
|
||||||
if (data->filter &&
|
if (data->filter &&
|
||||||
!data->filter(data->conn, obj->def))
|
!data->filter(data->conn, obj->def))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user