]> Git Repo - qemu.git/commitdiff
block: avoid creating oversized writes in multiwrite_merge
authorPeter Lieven <[email protected]>
Mon, 27 Oct 2014 09:18:46 +0000 (10:18 +0100)
committerStefan Hajnoczi <[email protected]>
Mon, 3 Nov 2014 09:48:41 +0000 (09:48 +0000)
Signed-off-by: Peter Lieven <[email protected]>
Reviewed-by: Ronnie Sahlberg <[email protected]>
Reviewed-by: Max Reitz <[email protected]>
Signed-off-by: Stefan Hajnoczi <[email protected]>
block.c

diff --git a/block.c b/block.c
index 76fcc1d6d36a754448d36e9f24c81cb17072d12b..41793419d8e1e8b3d429402af077988a02bec899 100644 (file)
--- a/block.c
+++ b/block.c
@@ -4446,6 +4446,11 @@ static int multiwrite_merge(BlockDriverState *bs, BlockRequest *reqs,
             merge = 0;
         }
 
+        if (bs->bl.max_transfer_length && reqs[outidx].nb_sectors +
+            reqs[i].nb_sectors > bs->bl.max_transfer_length) {
+            merge = 0;
+        }
+
         if (merge) {
             size_t size;
             QEMUIOVector *qiov = g_malloc0(sizeof(*qiov));
This page took 0.035724 seconds and 4 git commands to generate.