]> git.proxmox.com Git - mirror_qemu.git/commitdiff
block/iscsi: clarify the meaning of ISCSI_CHECKALLOC_THRES
authorPeter Lieven <pl@kamp.de>
Mon, 28 Apr 2014 15:11:33 +0000 (17:11 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 29 Apr 2014 09:14:41 +0000 (11:14 +0200)
Signed-off-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
block/iscsi.c

index 6b8a0a34f720e56e2cddc63e58b79746a49e837b..e8d26bb781223bdd320b791e0d73e3aee4971992 100644 (file)
@@ -95,7 +95,15 @@ typedef struct IscsiAIOCB {
 #define NOP_INTERVAL 5000
 #define MAX_NOP_FAILURES 3
 #define ISCSI_CMD_RETRIES 5
-#define ISCSI_CHECKALLOC_THRES 63
+
+/* this threshhold is a trade-off knob to choose between
+ * the potential additional overhead of an extra GET_LBA_STATUS request
+ * vs. unnecessarily reading a lot of zero sectors over the wire.
+ * If a read request is greater or equal than ISCSI_CHECKALLOC_THRES
+ * sectors we check the allocation status of the area covered by the
+ * request first if the allocationmap indicates that the area might be
+ * unallocated. */
+#define ISCSI_CHECKALLOC_THRES 64
 
 static void
 iscsi_bh_cb(void *p)
@@ -505,7 +513,7 @@ static int coroutine_fn iscsi_co_readv(BlockDriverState *bs,
     }
 
 #if defined(LIBISCSI_FEATURE_IOVECTOR)
-    if (iscsilun->lbprz && nb_sectors > ISCSI_CHECKALLOC_THRES &&
+    if (iscsilun->lbprz && nb_sectors >= ISCSI_CHECKALLOC_THRES &&
         !iscsi_allocationmap_is_allocated(iscsilun, sector_num, nb_sectors)) {
         int64_t ret;
         int pnum;