aboutsummaryrefslogtreecommitdiff
path: root/block
diff options
context:
space:
mode:
authorPeter Lieven <pl@kamp.de>2013-10-24 12:07:00 +0200
committerKevin Wolf <kwolf@redhat.com>2013-11-28 10:30:52 +0100
commitba6c59191f245147e7ee0c2b9ecaf5fb116f7877 (patch)
treee68859ae488123a49ca3f7dd1bced86a28c1fe69 /block
parent6f14da5247076bde1e00444f6d5b2b7ca8075a09 (diff)
iscsi: set limits in BlockDriverState
Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Peter Lieven <pl@kamp.de> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block')
-rw-r--r--block/iscsi.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/block/iscsi.c b/block/iscsi.c
index 3095887a27..1cafa782a1 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -1384,6 +1384,20 @@ static int iscsi_open(BlockDriverState *bs, QDict *options, int flags,
sizeof(struct scsi_inquiry_block_limits));
scsi_free_scsi_task(task);
task = NULL;
+
+ 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);
+ }
+ bs->bl.write_zeroes_alignment = sector_lun2qemu(iscsilun->bl.opt_unmap_gran,
+ iscsilun);
}
#if defined(LIBISCSI_FEATURE_NOP_COUNTER)