diff options
author | Eric Blake <eblake@redhat.com> | 2016-06-23 16:37:14 -0600 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2016-07-05 16:46:25 +0200 |
commit | c8b3b998e2bb61e511591f126be9d362d80d705d (patch) | |
tree | bc0d0b99271aea4a817550f4648a9eb2dec04672 /block/iscsi.c | |
parent | 835db3ee7b2ab9643bcfc2a9816133e93c78476f (diff) |
iscsi: Set request_alignment during .bdrv_refresh_limits()
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 <eblake@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Fam Zheng <famz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/iscsi.c')
-rw-r--r-- | block/iscsi.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/block/iscsi.c b/block/iscsi.c index c5dedb3407..721afb7a74 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); } |