qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PULL 11/43] iscsi: Set request_alignment during .bdrv_refr


From: Kevin Wolf
Subject: [Qemu-devel] [PULL 11/43] iscsi: Set request_alignment during .bdrv_refresh_limits()
Date: Tue, 5 Jul 2016 17:50:20 +0200

From: Eric Blake <address@hidden>

We want to eventually stick request_alignment alongside other
BlockLimits, but first, we must ensure it is populated at the
same time as all other limits, rather than being a special case
that is set only when a block is first opened.

Signed-off-by: Eric Blake <address@hidden>
Reviewed-by: Kevin Wolf <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
---
 block/iscsi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/block/iscsi.c b/block/iscsi.c
index c5dedb3..721afb7 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -1589,7 +1589,6 @@ static int iscsi_open(BlockDriverState *bs, QDict 
*options, int flags,
         goto out;
     }
     bs->total_sectors = sector_lun2qemu(iscsilun->num_blocks, iscsilun);
-    bs->request_alignment = iscsilun->block_size;
 
     /* We don't have any emulation for devices other than disks and CD-ROMs, so
      * this must be sg ioctl compatible. We force it to be sg, otherwise qemu
@@ -1711,6 +1710,8 @@ static void iscsi_refresh_limits(BlockDriverState *bs, 
Error **errp)
     IscsiLun *iscsilun = bs->opaque;
     uint32_t max_xfer_len = iscsilun->use_16_for_rw ? 0xffffffff : 0xffff;
 
+    bs->request_alignment = iscsilun->block_size;
+
     if (iscsilun->bl.max_xfer_len) {
         max_xfer_len = MIN(max_xfer_len, iscsilun->bl.max_xfer_len);
     }
-- 
1.8.3.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]