[libvirt] [PATCH] storage: Fix iscsi-direct volume size for volumes > 4GiB

Jiri Denemark jdenemar at redhat.com
Thu Feb 28 14:22:00 UTC 2019


Both block_size and nb_block are unit32_t.

Signed-off-by: Jiri Denemark <jdenemar at redhat.com>
---
 src/storage/storage_backend_iscsi_direct.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/storage/storage_backend_iscsi_direct.c b/src/storage/storage_backend_iscsi_direct.c
index 20997d5c5d..78dc4bd100 100644
--- a/src/storage/storage_backend_iscsi_direct.c
+++ b/src/storage/storage_backend_iscsi_direct.c
@@ -321,8 +321,8 @@ virISCSIDirectRefreshVol(virStoragePoolObjPtr pool,
     if (virISCSIDirectGetVolumeCapacity(iscsi, lun, &block_size, &nb_block) < 0)
         return -1;
 
-    vol->target.capacity = block_size * nb_block;
-    vol->target.allocation = block_size * nb_block;
+    vol->target.capacity = (unsigned long long)block_size * nb_block;
+    vol->target.allocation = (unsigned long long)block_size * nb_block;
     def->capacity += vol->target.capacity;
     def->allocation += vol->target.allocation;
 
-- 
2.21.0




More information about the libvir-list mailing list