Am 06.03.2026 um 15:28 hat Peter Lieven geschrieben:
> libnfs v6 added a new api structure for read and write requests.
>
> This effectively also adds zero copy read support for cases where
> the qiov coming from the block layer has only one vector.
>
> The .brdv_refresh_limits implementation is needed because libnfs v6
> silently dropped support for splitting large read/write request into
> chunks.
>
> Signed-off-by: Ronnie Sahlberg <[email protected]>
> Signed-off-by: Peter Lieven <[email protected]>
Thanks, applied to the block branch.
> @@ -280,6 +307,13 @@ static int coroutine_fn nfs_co_preadv(BlockDriverState
> *bs, int64_t offset,
> }
> qemu_coroutine_yield();
>
> + if (my_buffer) {
> + if (task.ret > 0) {
> + qemu_iovec_from_buf(iov, 0, buf, task.ret);
> + }
> + g_free(buf);
> + }
I wonder if it wouldn't be easier to just always do the copy in the
callback. The only thing that would need to be version dependent is the
buffer that contains the actual data (the @data parameter in
nfs_co_generic_cb or the bounce buffer).
But I assume we'll touch this code again soon enough, because I saw that
libnfs recently added vectored reads. If we can use them, that would be
even more efficient. (But somehow it didn't add vectored writes at the
same time? Strange.)
Kevin