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: Alberto Garcia
Subject: Re: [Qemu-devel] [RFC PATCH 3/8] quorum: Implement .bdrv_co_readv/writev
Date: Wed, 16 Nov 2016 16:57:44 +0100
User-agent: Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu)

On Thu 10 Nov 2016 06:19:04 PM CET, Kevin Wolf wrote:

> +typedef struct QuorumCo {
> +    QuorumAIOCB *acb;
>      int i;

Maybe 'i' could rename to something a bit more descriptive ('idx', I
don't know).

> +} QuorumCo;
> +
> +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 */

I also don't understand this last line. Is it to make sure that no one
tries to use it after the bdrv_co_preadv() call?

> +    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);
> +}

Otherwise the patch looks good to me.

Berto



reply via email to

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