qemu-block
[Top][All Lists]
Advanced

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

Re: [Qemu-block] [Qemu-devel] [PATCH v3 01/17] block: enhance QEMUIOVect


From: Eric Blake
Subject: Re: [Qemu-block] [Qemu-devel] [PATCH v3 01/17] block: enhance QEMUIOVector structure
Date: Thu, 7 Feb 2019 08:50:53 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

On 2/7/19 4:24 AM, Vladimir Sementsov-Ogievskiy wrote:
> Add a possibility of embedded iovec, for cases when we need only one
> local iov.
> 
> Signed-off-by: Vladimir Sementsov-Ogievskiy <address@hidden>
> ---
>  include/qemu/iov.h | 64 ++++++++++++++++++++++++++++++++++++++++++++--
>  1 file changed, 62 insertions(+), 2 deletions(-)
> 

> +/*
> + * qemu_iovec_init_buf
> + *
> + * Initialize embedded QEMUIOVector.
> + *
> + * Note: "const" is used over @buf pointer to make it simple to pass
> + * const pointers, appearing in read functions. Then this "const" is
> + * casted away by QEMU_IOVEC_INIT_BUF().

s/casted/cast/ (one of those funny irregular English verbs)

> + */
> +static inline void qemu_iovec_init_buf(QEMUIOVector *qiov,
> +                                       const void *buf, size_t len)
> +{
> +    *qiov = (QEMUIOVector) QEMU_IOVEC_INIT_BUF(*qiov, buf, len);
> +}
> +
> +static inline void *qemu_iovec_get_buf(QEMUIOVector *qiov)
> +{
> +    /* Only supports embedded iov */
> +    assert(qiov->niov == -1 && qiov->iov == &(qiov->local_iov));

The inner () aren't needed here.

> +
> +    return qiov->local_iov.iov_base;
> +}
> +

Both minor, so:
Reviewed-by: Eric Blake <address@hidden>

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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