diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2014-04-02 15:30:29 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2014-04-03 13:10:53 +0200 |
commit | c97ca29db0a68deb281a901f535cec5ea4862244 (patch) | |
tree | ff6f372f87d90b3c1d8a4945d3a7e46b1614faff /block/iscsi.c | |
parent | b2f9c08a4f11f16ec101e95feab8e71d7cfcfee9 (diff) | |
download | qemu-c97ca29db0a68deb281a901f535cec5ea4862244.zip qemu-c97ca29db0a68deb281a901f535cec5ea4862244.tar.gz qemu-c97ca29db0a68deb281a901f535cec5ea4862244.tar.bz2 |
iscsi: always query max WRITE SAME length
Max WRITE SAME length is also used when the UNMAP bit is zero, so it
should be queried even if LBPWS=0. Same for the optimal transfer
length.
However, the write_zeroes_alignment only matters for UNMAP=1 so we
still restrict it to LBPWS=1.
Reviewed-by: Peter Lieven <pl@kamp.de>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'block/iscsi.c')
-rw-r--r-- | block/iscsi.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/block/iscsi.c b/block/iscsi.c index e68aa0f..21c18a3 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -1335,18 +1335,20 @@ static int iscsi_refresh_limits(BlockDriverState *bs) /* We don't actually refresh here, but just return data queried in * iscsi_open(): iscsi targets don't change their limits. */ - if (iscsilun->lbp.lbpu || iscsilun->lbp.lbpws) { + if (iscsilun->lbp.lbpu) { if (iscsilun->bl.max_unmap < 0xffffffff) { bs->bl.max_discard = sector_lun2qemu(iscsilun->bl.max_unmap, iscsilun); } bs->bl.discard_alignment = sector_lun2qemu(iscsilun->bl.opt_unmap_gran, iscsilun); + } - if (iscsilun->bl.max_ws_len < 0xffffffff) { - bs->bl.max_write_zeroes = sector_lun2qemu(iscsilun->bl.max_ws_len, - iscsilun); - } + if (iscsilun->bl.max_ws_len < 0xffffffff) { + bs->bl.max_write_zeroes = sector_lun2qemu(iscsilun->bl.max_ws_len, + iscsilun); + } + if (iscsilun->lbp.lbpws) { bs->bl.write_zeroes_alignment = sector_lun2qemu(iscsilun->bl.opt_unmap_gran, iscsilun); } |