提交 67129bb4 编写于 作者: J John Ferlan

storage: Use virStoragePoolObj{Get|Incr|Decr}Asyncjobs

Use the new accessor APIs for storage_driver.
上级 ccc8c311
...@@ -832,7 +832,7 @@ storagePoolUndefine(virStoragePoolPtr pool) ...@@ -832,7 +832,7 @@ storagePoolUndefine(virStoragePoolPtr pool)
goto cleanup; goto cleanup;
} }
if (obj->asyncjobs > 0) { if (virStoragePoolObjGetAsyncjobs(obj) > 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("pool '%s' has asynchronous jobs running."), _("pool '%s' has asynchronous jobs running."),
obj->def->name); obj->def->name);
...@@ -1014,7 +1014,7 @@ storagePoolDestroy(virStoragePoolPtr pool) ...@@ -1014,7 +1014,7 @@ storagePoolDestroy(virStoragePoolPtr pool)
goto cleanup; goto cleanup;
} }
if (obj->asyncjobs > 0) { if (virStoragePoolObjGetAsyncjobs(obj) > 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("pool '%s' has asynchronous jobs running."), _("pool '%s' has asynchronous jobs running."),
obj->def->name); obj->def->name);
...@@ -1082,7 +1082,7 @@ storagePoolDelete(virStoragePoolPtr pool, ...@@ -1082,7 +1082,7 @@ storagePoolDelete(virStoragePoolPtr pool,
goto cleanup; goto cleanup;
} }
if (obj->asyncjobs > 0) { if (virStoragePoolObjGetAsyncjobs(obj) > 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("pool '%s' has asynchronous jobs running."), _("pool '%s' has asynchronous jobs running."),
obj->def->name); obj->def->name);
...@@ -1140,7 +1140,7 @@ storagePoolRefresh(virStoragePoolPtr pool, ...@@ -1140,7 +1140,7 @@ storagePoolRefresh(virStoragePoolPtr pool,
goto cleanup; goto cleanup;
} }
if (obj->asyncjobs > 0) { if (virStoragePoolObjGetAsyncjobs(obj) > 0) {
virReportError(VIR_ERR_INTERNAL_ERROR, virReportError(VIR_ERR_INTERNAL_ERROR,
_("pool '%s' has asynchronous jobs running."), _("pool '%s' has asynchronous jobs running."),
obj->def->name); obj->def->name);
...@@ -1827,7 +1827,7 @@ storageVolCreateXML(virStoragePoolPtr pool, ...@@ -1827,7 +1827,7 @@ storageVolCreateXML(virStoragePoolPtr pool,
memcpy(buildvoldef, voldef, sizeof(*voldef)); memcpy(buildvoldef, voldef, sizeof(*voldef));
/* Drop the pool lock during volume allocation */ /* Drop the pool lock during volume allocation */
obj->asyncjobs++; virStoragePoolObjIncrAsyncjobs(obj);
voldef->building = true; voldef->building = true;
virStoragePoolObjUnlock(obj); virStoragePoolObjUnlock(obj);
...@@ -1840,7 +1840,7 @@ storageVolCreateXML(virStoragePoolPtr pool, ...@@ -1840,7 +1840,7 @@ storageVolCreateXML(virStoragePoolPtr pool,
storageDriverUnlock(); storageDriverUnlock();
voldef->building = false; voldef->building = false;
obj->asyncjobs--; virStoragePoolObjDecrAsyncjobs(obj);
if (buildret < 0) { if (buildret < 0) {
/* buildVol handles deleting volume on failure */ /* buildVol handles deleting volume on failure */
...@@ -2020,13 +2020,13 @@ storageVolCreateXMLFrom(virStoragePoolPtr pool, ...@@ -2020,13 +2020,13 @@ storageVolCreateXMLFrom(virStoragePoolPtr pool,
goto cleanup; goto cleanup;
/* Drop the pool lock during volume allocation */ /* Drop the pool lock during volume allocation */
obj->asyncjobs++; virStoragePoolObjIncrAsyncjobs(obj);
voldef->building = true; voldef->building = true;
voldefsrc->in_use++; voldefsrc->in_use++;
virStoragePoolObjUnlock(obj); virStoragePoolObjUnlock(obj);
if (objsrc) { if (objsrc) {
objsrc->asyncjobs++; virStoragePoolObjIncrAsyncjobs(objsrc);
virStoragePoolObjUnlock(objsrc); virStoragePoolObjUnlock(objsrc);
} }
...@@ -2040,10 +2040,10 @@ storageVolCreateXMLFrom(virStoragePoolPtr pool, ...@@ -2040,10 +2040,10 @@ storageVolCreateXMLFrom(virStoragePoolPtr pool,
voldefsrc->in_use--; voldefsrc->in_use--;
voldef->building = false; voldef->building = false;
obj->asyncjobs--; virStoragePoolObjDecrAsyncjobs(obj);
if (objsrc) { if (objsrc) {
objsrc->asyncjobs--; virStoragePoolObjDecrAsyncjobs(objsrc);
virStoragePoolObjUnlock(objsrc); virStoragePoolObjUnlock(objsrc);
objsrc = NULL; objsrc = NULL;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册