On Fri, May 29, 2026 at 02:36:13PM +0200, Daniel Gomez wrote:
> From: Daniel Gomez <[email protected]>
> 
> dma_blk_cb() submits dbs->iov to io_func() in one shot, so callers
> must keep dbs->iov.niov below IOV_MAX or the host preadv()/pwritev()
> rejects the call.
> 
> Break the accumulation loop when niov reaches IOV_MAX. The existing
> re-entry path resumes mapping and submits a follow-up chunk under
> the same AIOCB, so callers no longer carry that constraint.

Thanks, I like the idea. One question below.

> -        if (!mem)
> +        if (!mem || dbs->iov.niov >= IOV_MAX) {
>              break;
> +        }

Won't this leak "mem" if it is not NULL, but we've hit the iov.niov
condition? If so, I think you can move this new check to after the
qemu_iovec_add call.

Reply via email to