[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 66/93] block: Inherit opt_transfer_length
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 66/93] block: Inherit opt_transfer_length |
Date: |
Fri, 24 Jan 2014 18:21:49 +0100 |
When there is a format driver between the backend, it's not guaranteed
that exposing the opt_transfer_length for the format driver results in
the optimal requests (because of fragmentation etc.), but it can't make
things worse, so let's just do it.
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Wenchao Xia <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
Reviewed-by: BenoƮt Canet <address@hidden>
---
block.c | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/block.c b/block.c
index 0a3d12c..8a66927 100644
--- a/block.c
+++ b/block.c
@@ -489,7 +489,25 @@ static int bdrv_refresh_limits(BlockDriverState *bs)
memset(&bs->bl, 0, sizeof(bs->bl));
- if (drv && drv->bdrv_refresh_limits) {
+ if (!drv) {
+ return 0;
+ }
+
+ /* Take some limits from the children as a default */
+ if (bs->file) {
+ bdrv_refresh_limits(bs->file);
+ bs->bl.opt_transfer_length = bs->file->bl.opt_transfer_length;
+ }
+
+ if (bs->backing_hd) {
+ bdrv_refresh_limits(bs->backing_hd);
+ bs->bl.opt_transfer_length =
+ MAX(bs->bl.opt_transfer_length,
+ bs->backing_hd->bl.opt_transfer_length);
+ }
+
+ /* Then let the driver override it */
+ if (drv->bdrv_refresh_limits) {
return drv->bdrv_refresh_limits(bs);
}
--
1.8.1.4
- [Qemu-devel] [PULL 51/93] vmdk: Fix format specific information (create type) for streamOptimized, (continued)
- [Qemu-devel] [PULL 51/93] vmdk: Fix format specific information (create type) for streamOptimized, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 50/93] drive mirror:fix memory leak, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 52/93] qapi: Add "backing" to BlockStats, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 54/93] block: Allow the user to define "node-name" option both on command line and QMP., Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 53/93] block: Add bs->node_name to hold the name of a bs node of the bs graph., Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 61/93] block: resize backing file image during offline commit, if necessary, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 62/93] block: resize backing image during active layer commit, if needed, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 64/93] block: Fix bdrv_commit return value, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 63/93] block: update block commit documentation regarding image truncation, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 65/93] block: Move initialisation of BlockLimits to bdrv_refresh_limits(), Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 66/93] block: Inherit opt_transfer_length,
Kevin Wolf <=
- [Qemu-devel] [PULL 68/93] qemu_memalign: Allow small alignments, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 67/93] block: Update BlockLimits when they might have changed, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 69/93] block: Detect unaligned length in bdrv_qiov_is_aligned(), Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 70/93] block: Don't use guest sector size for qemu_blockalign(), Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 71/93] block: rename buffer_alignment to guest_block_size, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 72/93] raw: Probe required direct I/O alignment, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 76/93] block: write: Handle COR dependency after I/O throttling, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 77/93] block: Introduce bdrv_co_do_pwritev(), Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 78/93] block: Switch BdrvTrackedRequest to byte granularity, Kevin Wolf, 2014/01/24
- [Qemu-devel] [PULL 79/93] block: Allow waiting for overlapping requests between begin/end, Kevin Wolf, 2014/01/24