[PATCH v1 22/31] virNetworkObjList: Derive from virObjectLockableClass

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

 



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@xxxxxxxxxx>
---
 src/conf/network_conf.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/conf/network_conf.c b/src/conf/network_conf.c
index 8f140d2..7e8b867 100644
--- a/src/conf/network_conf.c
+++ b/src/conf/network_conf.c
@@ -52,7 +52,7 @@
 #define CLASS_ID_BITMAP_SIZE (1<<16)
 
 struct _virNetworkObjList {
-    virObject parent;
+    virObjectLockable parent;
 
     size_t count;
     virNetworkObjPtr *objs;
@@ -93,7 +93,7 @@ static int virNetworkObjOnceInit(void)
                                            virNetworkObjDispose)))
         return -1;
 
-    if (!(virNetworkObjListClass = virClassNew(virClassForObject(),
+    if (!(virNetworkObjListClass = virClassNew(virClassForObjectLockable(),
                                                "virNetworkObjList",
                                                sizeof(virNetworkObjList),
                                                virNetworkObjListDispose)))
@@ -137,7 +137,7 @@ virNetworkObjListPtr virNetworkObjListNew(void)
     if (virNetworkObjInitialize() < 0)
         return NULL;
 
-    if (!(nets = virObjectNew(virNetworkObjListClass)))
+    if (!(nets = virObjectLockableNew(virNetworkObjListClass)))
         return NULL;
 
     return nets;
-- 
2.0.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[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]