qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 05/14] block: Make blk_co_preadv/pwritev() pu


From: Eric Blake
Subject: Re: [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

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]