[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [PATCH v2 05/14] block: Make blk_co_preadv
From: |
Eric Blake |
Subject: |
Re: [Qemu-block] [Qemu-devel] [PATCH v2 05/14] block: Make blk_co_preadv/pwritev() public |
Date: |
Tue, 24 May 2016 18:24:41 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 |
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 <address@hidden>
> ---
> 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
- [Qemu-block] [PATCH v2 03/14] block: Default to enabled write cache in blk_new(), (continued)
- [Qemu-block] [PATCH v2 03/14] block: Default to enabled write cache in blk_new(), Kevin Wolf, 2016/05/24
- [Qemu-block] [PATCH v2 01/14] block: keep a list of block jobs, Kevin Wolf, 2016/05/24
- [Qemu-block] [PATCH v2 04/14] block: Convert block job core to BlockBackend, Kevin Wolf, 2016/05/24
- [Qemu-block] [PATCH v2 09/14] backup: Don't leak BackupBlockJob in error path, Kevin Wolf, 2016/05/24
- [Qemu-block] [PATCH v2 07/14] mirror: Allow target that already has a BlockBackend, Kevin Wolf, 2016/05/24
- [Qemu-block] [PATCH v2 05/14] block: Make blk_co_preadv/pwritev() public, Kevin Wolf, 2016/05/24
- Re: [Qemu-block] [Qemu-devel] [PATCH v2 05/14] block: Make blk_co_preadv/pwritev() public,
Eric Blake <=
- [Qemu-block] [PATCH v2 08/14] mirror: Use BlockBackend for I/O, Kevin Wolf, 2016/05/24
- [Qemu-block] [PATCH v2 06/14] stream: Use BlockBackend for I/O, Kevin Wolf, 2016/05/24
- [Qemu-block] [PATCH v2 10/14] backup: Pack Notifier within BackupBlockJob, Kevin Wolf, 2016/05/24