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>
This commit is contained in:
parent
52f6fa1430
commit
6c5a42ac34
5
block.c
5
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));
|
||||
|
Loading…
Reference in New Issue
Block a user