virNetworkObjList: Derive from virObjectLockableClass

Later we can turn APIs to lock the object if needed instead of
relying on caller to mutually exclude itself (probably done by
locking a big lock anyway).

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Michal Privoznik 2015-02-25 14:58:16 +01:00
parent 5a84a07857
commit 52430928d1

View File

@ -52,7 +52,7 @@
#define CLASS_ID_BITMAP_SIZE (1<<16)
struct _virNetworkObjList {
virObject parent;
virObjectLockable parent;
virHashTablePtr objs;
};
@ -92,7 +92,7 @@ static int virNetworkObjOnceInit(void)
virNetworkObjDispose)))
return -1;
if (!(virNetworkObjListClass = virClassNew(virClassForObject(),
if (!(virNetworkObjListClass = virClassNew(virClassForObjectLockable(),
"virNetworkObjList",
sizeof(virNetworkObjList),
virNetworkObjListDispose)))
@ -146,7 +146,7 @@ virNetworkObjListPtr virNetworkObjListNew(void)
if (virNetworkObjInitialize() < 0)
return NULL;
if (!(nets = virObjectNew(virNetworkObjListClass)))
if (!(nets = virObjectLockableNew(virNetworkObjListClass)))
return NULL;
if (!(nets->objs = virHashCreate(50, virObjectFreeHashData))) {