[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCHv5 2/6] BlockLimits: introduce max_transfer_length
From: |
Peter Lieven |
Subject: |
[Qemu-devel] [PATCHv5 2/6] BlockLimits: introduce max_transfer_length |
Date: |
Sat, 25 Oct 2014 18:18:34 +0200 |
Signed-off-by: Peter Lieven <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
---
block.c | 4 ++++
include/block/block_int.h | 3 +++
2 files changed, 7 insertions(+)
diff --git a/block.c b/block.c
index 88f6d9b..76fcc1d 100644
--- a/block.c
+++ b/block.c
@@ -519,6 +519,7 @@ void bdrv_refresh_limits(BlockDriverState *bs, Error **errp)
return;
}
bs->bl.opt_transfer_length = bs->file->bl.opt_transfer_length;
+ bs->bl.max_transfer_length = bs->file->bl.max_transfer_length;
bs->bl.opt_mem_alignment = bs->file->bl.opt_mem_alignment;
} else {
bs->bl.opt_mem_alignment = 512;
@@ -533,6 +534,9 @@ void bdrv_refresh_limits(BlockDriverState *bs, Error **errp)
bs->bl.opt_transfer_length =
MAX(bs->bl.opt_transfer_length,
bs->backing_hd->bl.opt_transfer_length);
+ bs->bl.max_transfer_length =
+ MIN_NON_ZERO(bs->bl.max_transfer_length,
+ bs->backing_hd->bl.max_transfer_length);
bs->bl.opt_mem_alignment =
MAX(bs->bl.opt_mem_alignment,
bs->backing_hd->bl.opt_mem_alignment);
diff --git a/include/block/block_int.h b/include/block/block_int.h
index 8898c6c..a293e92 100644
--- a/include/block/block_int.h
+++ b/include/block/block_int.h
@@ -289,6 +289,9 @@ typedef struct BlockLimits {
/* optimal transfer length in sectors */
int opt_transfer_length;
+ /* maximal transfer length in sectors */
+ int max_transfer_length;
+
/* memory alignment so that no bounce buffer is needed */
size_t opt_mem_alignment;
} BlockLimits;
--
1.7.9.5
- Re: [Qemu-devel] [PATCHv5 5/6] block/iscsi: limit to INT_MAX throughout iscsi_refresh_limits, (continued)
[Qemu-devel] [PATCHv5 1/6] util: introduce MIN_NON_ZERO, Peter Lieven, 2014/10/25
[Qemu-devel] [PATCHv5 3/6] block/iscsi: set max_transfer_length, Peter Lieven, 2014/10/25
[Qemu-devel] [PATCHv5 2/6] BlockLimits: introduce max_transfer_length,
Peter Lieven <=