aboutsummaryrefslogtreecommitdiff
path: root/hw/block
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@redhat.com>2015-07-09 10:56:46 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2015-12-22 16:01:07 +0800
commit222565f65c3fba6825912c2561de7831e514ef3c (patch)
treee1e1753c6481ae4c4f19e0174a68df7898d8e8cf /hw/block
parent648296e067e617e140032c0ab329fb89ffb92aaa (diff)
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 'hw/block')
-rw-r--r--hw/block/virtio-blk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c
index f72d4b6069..51f867b513 100644
--- a/hw/block/virtio-blk.c
+++ b/hw/block/virtio-blk.c
@@ -414,7 +414,7 @@ void virtio_blk_submit_multireq(BlockBackend *blk, MultiReqBuffer *mrb)
* 3. merge would exceed maximum transfer length of backend device
*/
if (sector_num + nb_sectors != req->sector_num ||
- niov > IOV_MAX - req->qiov.niov ||
+ niov > blk_get_max_iov(blk) - req->qiov.niov ||
req->qiov.size / BDRV_SECTOR_SIZE > max_xfer_len ||
nb_sectors > max_xfer_len - req->qiov.size / BDRV_SECTOR_SIZE) {
submit_requests(blk, mrb, start, num_reqs, niov);