diff --git a/src/libvirt-storage.c b/src/libvirt-storage.c index 9ab0fe28ea..e4646cb80f 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 2b7a299706..d209f5afb8 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;