diff --git a/src/libvirt-storage.c b/src/libvirt-storage.c index 9ab0fe28ea12b9b960c65c793ac14c9345f73b7f..e4646cb80ff97cdd07d0994ac4aec9de1e8ecf47 100644 --- a/src/libvirt-storage.c +++ b/src/libvirt-storage.c @@ -1632,7 +1632,8 @@ virStorageVolDownload(virStorageVolPtr vol, * another active stream is writing to the storage volume. * * When the data stream is closed whether the upload is successful - * or not the target storage pool will be refreshed to reflect pool + * or not an attempt will be made to refresh the target storage pool + * if an asynchronous build is not running in order to reflect pool * and volume changes as a result of the upload. Depending on * the target volume storage backend and the source stream type * for a successful upload, the target volume may take on the diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c index 2b7a299706a0f3875ef3e08e3dfc789fe7565962..d209f5afb8c60943602f081947c738a0261e1005 100644 --- a/src/storage/storage_driver.c +++ b/src/storage/storage_driver.c @@ -2267,6 +2267,13 @@ virStorageVolPoolRefreshThread(void *opaque) goto cleanup; def = virStoragePoolObjGetDef(obj); + /* If some thread is building a new volume in the pool, then we cannot + * clear out all vols and refresh the pool. So we'll just pass. */ + if (virStoragePoolObjGetAsyncjobs(obj) > 0) { + VIR_DEBUG("Asyncjob in process, cannot refresh storage pool"); + goto cleanup; + } + if (!(backend = virStorageBackendForType(def->type))) goto cleanup;