qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC V7 06/13] quorum: Add quorum mechanism.


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [RFC V7 06/13] quorum: Add quorum mechanism.
Date: Mon, 28 Jan 2013 17:18:21 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Jan 28, 2013 at 02:22:52PM +0100, Benoît Canet wrote:
> +static void quorum_vote(QuorumAIOCB *acb)
> +{
> +    bool quorum = true;
> +    int i, j, ret;
> +    QuorumVoteValue hash;
> +    BDRVQuorumState *s = acb->bqs;
> +    QuorumVoteVersion *winner;
> +
> +    /* get the index of the first successful read */
> +    for (i = 0; i < s->total; i++) {
> +        if (!acb->aios[i].ret) {
> +            break;
> +        }
> +    }
> +
> +    /* compare this read with all other successful read looking for quorum */
> +    for (j = i + 1; j < s->total; j++) {
> +        if (acb->aios[j].ret) {
> +            continue;
> +        }
> +        quorum = quorum_compare(acb, &acb->qiovs[i], &acb->qiovs[j]);
> +        if (!quorum) {
> +            break;
> +       }

4 space indentation



reply via email to

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