[libvirt] [PATCH] virISCSIDirectRefreshVol: Don't clear volumes in each run

Michal Privoznik posted 1 patch 5 years ago
Test syntax-check passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/207c0fc2994cfbe62317242747df7407d0e0d741.1551365086.git.mprivozn@redhat.com
src/storage/storage_backend_iscsi_direct.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[libvirt] [PATCH] virISCSIDirectRefreshVol: Don't clear volumes in each run
Posted by Michal Privoznik 5 years ago
When fetching LUNs from iscsi server the
virISCSIDirectReportLuns() is called. This function does some
libiscsi calls and then calls virISCSIDirectRefreshVol() over
each LUN found. It's unfortunate that the latter calls
virStoragePoolObjClearVols() as we lose all LUNs processed
in previous iterations.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 src/storage/storage_backend_iscsi_direct.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/storage/storage_backend_iscsi_direct.c b/src/storage/storage_backend_iscsi_direct.c
index 20997d5c5d..32ceb592d9 100644
--- a/src/storage/storage_backend_iscsi_direct.c
+++ b/src/storage/storage_backend_iscsi_direct.c
@@ -309,7 +309,6 @@ virISCSIDirectRefreshVol(virStoragePoolObjPtr pool,
     uint32_t nb_block;
     VIR_AUTOPTR(virStorageVolDef) vol = NULL;
 
-    virStoragePoolObjClearVols(pool);
     if (virISCSIDirectTestUnitReady(iscsi, lun) < 0)
         return -1;
 
@@ -376,6 +375,7 @@ virISCSIDirectReportLuns(virStoragePoolObjPtr pool,
 
     def->capacity = 0;
     def->allocation = 0;
+    virStoragePoolObjClearVols(pool);
     for (i = 0; i < list->num; i++) {
         if (virISCSIDirectRefreshVol(pool, iscsi, list->luns[i], portal) < 0)
             goto cleanup;
-- 
2.19.2

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH] virISCSIDirectRefreshVol: Don't clear volumes in each run
Posted by Jiri Denemark 5 years ago
On Thu, Feb 28, 2019 at 15:44:46 +0100, Michal Privoznik wrote:
> When fetching LUNs from iscsi server the
> virISCSIDirectReportLuns() is called. This function does some
> libiscsi calls and then calls virISCSIDirectRefreshVol() over
> each LUN found. It's unfortunate that the latter calls
> virStoragePoolObjClearVols() as we lose all LUNs processed
> in previous iterations.
> 
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
>  src/storage/storage_backend_iscsi_direct.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Jiri Denemark <jdenemar@redhat.com>

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