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