qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH 3/8] quorum: Implement .bdrv_co_readv/writev


From: Eric Blake
Subject: Re: [Qemu-devel] [RFC PATCH 3/8] quorum: Implement .bdrv_co_readv/writev
Date: Thu, 10 Nov 2016 19:56:06 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0

On 11/10/2016 11:19 AM, Kevin Wolf wrote:
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
>  block/quorum.c | 194 
> ++++++++++++++++++++++++++++++++++-----------------------
>  1 file changed, 117 insertions(+), 77 deletions(-)
> 


> +
> +static void read_quorum_children_entry(void *opaque)
> +{
> +    QuorumCo *co = opaque;
> +    QuorumAIOCB *acb = co->acb;
> +    BDRVQuorumState *s = acb->bs->opaque;
> +    int i = co->i;
> +    int ret;
> +    co = NULL; /* Not valid after the first yield */

Why bother to invalidate co...

> +
> +    acb->qcrs[i].bs = s->children[i]->bs;
> +    ret = bdrv_co_preadv(s->children[i], acb->sector_num * BDRV_SECTOR_SIZE,
> +                         acb->nb_sectors * BDRV_SECTOR_SIZE,
> +                         &acb->qcrs[i].qiov, 0);
> +    quorum_aio_cb(&acb->qcrs[i], ret);
> +}

...when it isn't used later? Is it just for future-proofing edits made
in later patches?

> +static void write_quorum_entry(void *opaque)
> +{
> +    QuorumCo *co = opaque;
> +    QuorumAIOCB *acb = co->acb;
> +    BDRVQuorumState *s = acb->bs->opaque;
> +    int i = co->i;
> +    int ret;
> +    co = NULL; /* Not valid after the first yield */
> +
> +    acb->qcrs[i].bs = s->children[i]->bs;
> +    ret = bdrv_co_pwritev(s->children[i], acb->sector_num * BDRV_SECTOR_SIZE,
> +                          acb->nb_sectors * BDRV_SECTOR_SIZE, acb->qiov, 0);
> +    quorum_aio_cb(&acb->qcrs[i], ret);
>  }

and again

Otherwise, the conversion looks sane to me, but I'm just weak enough on
coroutines that I won't give R-b while this is still in RFC

-- 
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]