[PATCH] SCSI storage: Initialise the pool size parameters to zero while refreshing

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

 



If the pool creation thread happens to detect the luns 
in the scsi target,the size parameters will be populated 
as part of the refresh called from storagePoolCreate().
The commit <4a85bf3e2f> added additional refresh for 
SCSI which should also have these values initialised 
to zero, otherwise the values would appear exactly double.
A separate refresh would correct the values, but without 
an explicit pool-refresh, the allocation/capacity would 
appear exactly double after pool-create.
---
 src/storage/storage_backend_scsi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/storage/storage_backend_scsi.c b/src/storage/storage_backend_scsi.c
index 670cc4d..7c7d7d0 100644
--- a/src/storage/storage_backend_scsi.c
+++ b/src/storage/storage_backend_scsi.c
@@ -614,6 +614,9 @@ virStoragePoolFCRefreshThread(void *opaque)
          */
         VIR_DEBUG("Attempt FC Refresh for pool='%s' name='%s' tries='%d'",
                   pool->def->name, fchost_name, tries);
+
+        pool->def->allocation = pool->def->capacity = pool->def->available = 0;
+
         if (virStoragePoolObjIsActive(pool) &&
             virGetSCSIHostNumber(fchost_name, &host) == 0 &&
             virStorageBackendSCSITriggerRescan(host) == 0) {
-- 
1.8.3.1

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



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]