On 05/24/2016 07:47 AM, Kevin Wolf wrote: > Also add trace points now that the function can be directly called. > > Signed-off-by: Kevin Wolf <[email protected]> > --- > block/block-backend.c | 21 ++++++++++++++------- > include/sysemu/block-backend.h | 6 ++++++ > trace-events | 4 ++++ > 3 files changed, 24 insertions(+), 7 deletions(-) >
> @@ -741,11 +742,15 @@ static int blk_check_request(BlockBackend *blk, int64_t
> sector_num,
> nb_sectors * BDRV_SECTOR_SIZE);
> }
>
> -static int coroutine_fn blk_co_preadv(BlockBackend *blk, int64_t offset,
> - unsigned int bytes, QEMUIOVector *qiov,
> - BdrvRequestFlags flags)
> +int coroutine_fn blk_co_preadv(BlockBackend *blk, int64_t offset,
> + unsigned int bytes, QEMUIOVector *qiov,
Isn't bytes redundant with qiov->size? Or can qiov be NULL? Should we
assert(!qiov || qiov->size == bytes)?
> +int coroutine_fn blk_co_pwritev(BlockBackend *blk, int64_t offset,
> + unsigned int bytes, QEMUIOVector *qiov,
> + BdrvRequestFlags flags)
> {
Ditto. When doing write_zeroes, do we want qiov == NULL, must we always
have qiov but just leave qiov->iov[0].base as NULL? Probably worth
documenting as part of making it public.
> +++ b/include/sysemu/block-backend.h
> @@ -113,6 +113,12 @@ void *blk_get_attached_dev(BlockBackend *blk);
> void blk_set_dev_ops(BlockBackend *blk, const BlockDevOps *ops, void
> *opaque);
> int blk_pread_unthrottled(BlockBackend *blk, int64_t offset, uint8_t *buf,
> int count);
> +int coroutine_fn blk_co_preadv(BlockBackend *blk, int64_t offset,
> + unsigned int bytes, QEMUIOVector *qiov,
> + BdrvRequestFlags flags);
> +int coroutine_fn blk_co_pwritev(BlockBackend *blk, int64_t offset,
> + unsigned int bytes, QEMUIOVector *qiov,
> + BdrvRequestFlags flags);
Note that my earlier addition of blk_aio_pwritev intentionally omitted
the bytes argument, relying solely on qiov->size.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature
