diff options
author | Stefan Hajnoczi <stefanha@redhat.com> | 2015-07-09 10:56:46 +0100 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2015-12-22 16:01:07 +0800 |
commit | 222565f65c3fba6825912c2561de7831e514ef3c (patch) | |
tree | e1e1753c6481ae4c4f19e0174a68df7898d8e8cf /block | |
parent | 648296e067e617e140032c0ab329fb89ffb92aaa (diff) | |
download | qemu-222565f65c3fba6825912c2561de7831e514ef3c.tar.gz qemu-222565f65c3fba6825912c2561de7831e514ef3c.tar.bz2 qemu-222565f65c3fba6825912c2561de7831e514ef3c.zip |
block: replace IOV_MAX with BlockLimits.max_iov
Request merging must not result in a huge request that exceeds the
maximum number of iovec elements. Use BlockLimits.max_iov instead of
hardcoding IOV_MAX.
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/io.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/block/io.c b/block/io.c index 42050a0598..63e3678036 100644 --- a/block/io.c +++ b/block/io.c @@ -1889,7 +1889,8 @@ static int multiwrite_merge(BlockDriverState *bs, BlockRequest *reqs, merge = 1; } - if (reqs[outidx].qiov->niov + reqs[i].qiov->niov + 1 > IOV_MAX) { + if (reqs[outidx].qiov->niov + reqs[i].qiov->niov + 1 > + bs->bl.max_iov) { merge = 0; } |