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

[libvirt] [PATCH v2 11/12] storage: Use virStoragePoolObj{Get|Incr}Decr}Asyncjobs



Use the new accessor APIs for storage_driver.

Signed-off-by: John Ferlan <jferlan redhat com>
---
 src/storage/storage_driver.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index 6fae6f4..83d9ce3 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -832,7 +832,7 @@ storagePoolUndefine(virStoragePoolPtr pool)
         goto cleanup;
     }
 
-    if (obj->asyncjobs > 0) {
+    if (virStoragePoolObjGetAsyncjobs(obj) > 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("pool '%s' has asynchronous jobs running."),
                        obj->def->name);
@@ -1014,7 +1014,7 @@ storagePoolDestroy(virStoragePoolPtr pool)
         goto cleanup;
     }
 
-    if (obj->asyncjobs > 0) {
+    if (virStoragePoolObjGetAsyncjobs(obj) > 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("pool '%s' has asynchronous jobs running."),
                        obj->def->name);
@@ -1082,7 +1082,7 @@ storagePoolDelete(virStoragePoolPtr pool,
         goto cleanup;
     }
 
-    if (obj->asyncjobs > 0) {
+    if (virStoragePoolObjGetAsyncjobs(obj) > 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("pool '%s' has asynchronous jobs running."),
                        obj->def->name);
@@ -1140,7 +1140,7 @@ storagePoolRefresh(virStoragePoolPtr pool,
         goto cleanup;
     }
 
-    if (obj->asyncjobs > 0) {
+    if (virStoragePoolObjGetAsyncjobs(obj) > 0) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
                        _("pool '%s' has asynchronous jobs running."),
                        obj->def->name);
@@ -1827,7 +1827,7 @@ storageVolCreateXML(virStoragePoolPtr pool,
         memcpy(buildvoldef, voldef, sizeof(*voldef));
 
         /* Drop the pool lock during volume allocation */
-        obj->asyncjobs++;
+        virStoragePoolObjIncrAsyncjobs(obj);
         voldef->building = true;
         virStoragePoolObjUnlock(obj);
 
@@ -1840,7 +1840,7 @@ storageVolCreateXML(virStoragePoolPtr pool,
         storageDriverUnlock();
 
         voldef->building = false;
-        obj->asyncjobs--;
+        virStoragePoolObjDecrAsyncjobs(obj);
 
         if (buildret < 0) {
             /* buildVol handles deleting volume on failure */
@@ -2020,13 +2020,13 @@ storageVolCreateXMLFrom(virStoragePoolPtr pool,
         goto cleanup;
 
     /* Drop the pool lock during volume allocation */
-    obj->asyncjobs++;
+    virStoragePoolObjIncrAsyncjobs(obj);
     voldef->building = true;
     voldefsrc->in_use++;
     virStoragePoolObjUnlock(obj);
 
     if (objsrc) {
-        objsrc->asyncjobs++;
+        virStoragePoolObjIncrAsyncjobs(objsrc);
         virStoragePoolObjUnlock(objsrc);
     }
 
@@ -2040,10 +2040,10 @@ storageVolCreateXMLFrom(virStoragePoolPtr pool,
 
     voldefsrc->in_use--;
     voldef->building = false;
-    obj->asyncjobs--;
+    virStoragePoolObjDecrAsyncjobs(obj);
 
     if (objsrc) {
-        objsrc->asyncjobs--;
+        virStoragePoolObjDecrAsyncjobs(objsrc);
         virStoragePoolObjUnlock(objsrc);
         objsrc = NULL;
     }
-- 
2.9.5


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