mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
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>
This commit is contained in:
parent
648296e067
commit
222565f65c
2 changed files with 3 additions and 2 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue