Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/block.c b/block.c
- index 80d55ff..3e252a2 100644
- --- a/block.c
- +++ b/block.c
- @@ -3056,13 +3056,16 @@ static int coroutine_fn bdrv_aligned_preadv(BlockDriverState *bs,
- align >> BDRV_SECTOR_BITS);
- if (max_nb_sectors > 0) {
- QEMUIOVector local_qiov;
- + size_t local_sectors;
- +
- + max_nb_sectors = MIN(max_nb_sectors, SIZE_MAX / BDRV_SECTOR_BITS);
- + local_sectors = MIN(max_nb_sectors, nb_sectors);
- qemu_iovec_init(&local_qiov, qiov->niov);
- qemu_iovec_concat(&local_qiov, qiov, 0,
- - max_nb_sectors * BDRV_SECTOR_SIZE);
- + local_sectors * BDRV_SECTOR_SIZE);
- - ret = drv->bdrv_co_readv(bs, sector_num,
- - MIN(nb_sectors, max_nb_sectors),
- + ret = drv->bdrv_co_readv(bs, sector_num, local_sectors,
- &local_qiov);
- qemu_iovec_destroy(&local_qiov);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement