[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 39/48] block/iscsi: set bdi->cluster_size
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL 39/48] block/iscsi: set bdi->cluster_size |
Date: |
Fri, 6 Dec 2013 17:36:38 +0100 |
From: Peter Lieven <address@hidden>
this patch aims to set bdi->cluster_size to the internal page size
of the iscsi target so that enabled callers can align requests
properly.
Reviewed-by: Paolo Bonzini <address@hidden>
Signed-off-by: Peter Lieven <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
block/iscsi.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/block/iscsi.c b/block/iscsi.c
index 93fee6d..75d6b87 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -1580,6 +1580,13 @@ static int iscsi_get_info(BlockDriverState *bs,
BlockDriverInfo *bdi)
IscsiLun *iscsilun = bs->opaque;
bdi->unallocated_blocks_are_zero = !!iscsilun->lbprz;
bdi->can_write_zeroes_with_unmap = iscsilun->lbprz && iscsilun->lbp.lbpws;
+ /* Guess the internal cluster (page) size of the iscsi target by the means
+ * of opt_unmap_gran. Transfer the unmap granularity only if it has a
+ * reasonable size for bdi->cluster_size */
+ if (iscsilun->bl.opt_unmap_gran * iscsilun->block_size >= 64 * 1024 &&
+ iscsilun->bl.opt_unmap_gran * iscsilun->block_size <= 16 * 1024 *
1024) {
+ bdi->cluster_size = iscsilun->bl.opt_unmap_gran * iscsilun->block_size;
+ }
return 0;
}
--
1.8.4.2
- [Qemu-devel] [PULL 28/48] qemu-iotests: Change default cache mode to "writeback", (continued)
- [Qemu-devel] [PULL 28/48] qemu-iotests: Change default cache mode to "writeback", Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 29/48] qemu-iotests: Clean up spaces in usage output, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 30/48] qemu-iotests: Split qcow2 only cases in 048, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 32/48] qemu-nbd: support internal snapshot export, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 33/48] qemu-iotests: add 058 internal snapshot export with qemu-nbd case, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 34/48] qemu-img: add -l for snapshot in convert, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 35/48] qemu-iotests: add test for snapshot in qemu-img convert, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 36/48] qemu-nbd: add doc for option -f, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 37/48] qemu-img: add support for skipping zeroes in input during convert, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 38/48] qemu-img: fix usage instruction for qemu-img convert, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 39/48] block/iscsi: set bdi->cluster_size,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL 40/48] block: add opt_transfer_length to BlockLimits, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 41/48] block/iscsi: set bs->bl.opt_transfer_length, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 42/48] qemu-img: dynamically adjust iobuffer size during convert, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 43/48] qemu-img: round down request length to an aligned sector, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 44/48] qemu-img: decrease progress update interval on convert, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 46/48] block: clean up bdrv_drain_all() throttling comments, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 47/48] aio: make aio_poll(ctx, true) block with no fds, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 48/48] qemu-iotests: filter QEMU monitor \r\n, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 45/48] qcow2: use start_of_cluster() and offset_into_cluster() everywhere, Stefan Hajnoczi, 2013/12/06
- [Qemu-devel] [PULL 31/48] snapshot: distinguish id and name in load_tmp, Stefan Hajnoczi, 2013/12/06