[PATCH 2/3] Initialize and destroy pthread condition variable for _virStoragePoolObj

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

 



---
 src/conf/storage_conf.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/src/conf/storage_conf.c b/src/conf/storage_conf.c
index f6f8be1..0279850 100644
--- a/src/conf/storage_conf.c
+++ b/src/conf/storage_conf.c
@@ -323,6 +323,7 @@ virStoragePoolObjFree(virStoragePoolObjPtr obj) {
     VIR_FREE(obj->autostartLink);
 
     virMutexDestroy(&obj->lock);
+    ignore_value(virCondDestroy(&obj->cond));
 
     VIR_FREE(obj);
 }
@@ -1391,6 +1392,15 @@ virStoragePoolObjAssignDef(virStoragePoolObjListPtr pools,
         VIR_FREE(pool);
         return NULL;
     }
+
+    if (virCondInit(&pool->cond) < 0) {
+        virStorageReportError(VIR_ERR_INTERNAL_ERROR,
+                              "%s", _("cannot initialize cond"));
+        virMutexDestroy(&pool->lock);
+        VIR_FREE(pool);
+        return NULL;
+    }
+
     virStoragePoolObjLock(pool);
     pool->active = 0;
     pool->def = def;
-- 
1.7.1

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