diff options
author | Peter Lieven <pl@kamp.de> | 2014-10-27 10:18:46 +0100 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2014-11-03 09:48:41 +0000 |
commit | 6c5a42ac344306bb3711140a3267c61276c1567b (patch) | |
tree | e1460a5f23274d81ed881000d2603a2dd0377d8a /block.c | |
parent | 52f6fa1430209125d1c13fec7d6bbb501aedf322 (diff) | |
download | qemu-6c5a42ac344306bb3711140a3267c61276c1567b.tar.gz qemu-6c5a42ac344306bb3711140a3267c61276c1567b.tar.bz2 qemu-6c5a42ac344306bb3711140a3267c61276c1567b.zip |
block: avoid creating oversized writes in multiwrite_merge
Signed-off-by: Peter Lieven <pl@kamp.de>
Reviewed-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r-- | block.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -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)); |