[libvirt] [PATCH 2/2] scsi: Check for long running create in FCRefreshThread

John Ferlan posted 2 patches 7 years, 6 months ago
[libvirt] [PATCH 2/2] scsi: Check for long running create in FCRefreshThread
Posted by John Ferlan 7 years, 6 months ago
Similar to a recent patch in virStorageVolPoolRefreshThread to ensure
that there were no pool AsyncJobs (e.g. nothing being created at the
time in a long running buildVol job), modify virStoragePoolFCRefreshThread
to check for async jobs before calling virStoragePoolObjClearVols and
refreshing the volumes defined in the pool.

Signed-off-by: John Ferlan <jferlan@redhat.com>
---
 src/storage/storage_backend_scsi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/storage/storage_backend_scsi.c b/src/storage/storage_backend_scsi.c
index 02fd4b643c..63a9154102 100644
--- a/src/storage/storage_backend_scsi.c
+++ b/src/storage/storage_backend_scsi.c
@@ -159,6 +159,7 @@ virStoragePoolFCRefreshThread(void *opaque)
         pool->def->allocation = pool->def->capacity = pool->def->available = 0;
 
         if (virStoragePoolObjIsActive(pool) &&
+            virStoragePoolObjGetAsyncjobs(pool) == 0 &&
             virSCSIHostGetNumber(fchost_name, &host) == 0 &&
             virStorageBackendSCSITriggerRescan(host) == 0) {
             virStoragePoolObjClearVols(pool);
-- 
2.13.6

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 2/2] scsi: Check for long running create in FCRefreshThread
Posted by Cedric Bosdonnat 7 years, 6 months ago
On Mon, 2017-11-06 at 15:53 -0500, John Ferlan wrote:
> Similar to a recent patch in virStorageVolPoolRefreshThread to ensure
> that there were no pool AsyncJobs (e.g. nothing being created at the
> time in a long running buildVol job), modify virStoragePoolFCRefreshThread
> to check for async jobs before calling virStoragePoolObjClearVols and
> refreshing the volumes defined in the pool.
> 
> Signed-off-by: John Ferlan <jferlan@redhat.com>
> ---
>  src/storage/storage_backend_scsi.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/storage/storage_backend_scsi.c b/src/storage/storage_backend_scsi.c
> index 02fd4b643c..63a9154102 100644
> --- a/src/storage/storage_backend_scsi.c
> +++ b/src/storage/storage_backend_scsi.c
> @@ -159,6 +159,7 @@ virStoragePoolFCRefreshThread(void *opaque)
>          pool->def->allocation = pool->def->capacity = pool->def->available = 0;
>  
>          if (virStoragePoolObjIsActive(pool) &&
> +            virStoragePoolObjGetAsyncjobs(pool) == 0 &&
>              virSCSIHostGetNumber(fchost_name, &host) == 0 &&
>              virStorageBackendSCSITriggerRescan(host) == 0) {
>              virStoragePoolObjClearVols(pool);

ACK
--
Cedric

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list