Am 28.01.2013 18:07, schrieb Benoît Canet:
> Makes a vote to select error if any.
> 
> Signed-off-by: Benoit Canet <ben...@irqsave.net>
> ---
>  block/quorum.c |   34 ++++++++++++++++++++++++++++++++++
>  1 file changed, 34 insertions(+)
> 
> diff --git a/block/quorum.c b/block/quorum.c
> index 459434f..306a2df 100644
> --- a/block/quorum.c
> +++ b/block/quorum.c
> @@ -577,12 +577,46 @@ static int coroutine_fn 
> quorum_co_is_allocated(BlockDriverState *bs,
>      return result;
>  }
>  
> +static coroutine_fn int quorum_co_flush(BlockDriverState *bs)
> +{
> +    BDRVQuorumState *s = bs->opaque;
> +    QuorumVoteVersion *winner = NULL;
> +    QuorumVotes error_votes;
> +    QuorumVoteValue result_value;
> +    int i;
> +    int result = 0;
> +    bool error = false;
> +
> +    QLIST_INIT(&error_votes.vote_list);
> +    error_votes.compare = quorum_long_compare;
> +
> +    for (i = 0; i < s->total; i++) {
> +        result = bdrv_co_flush(s->bs[i]);
> +        if (result) {
> +            error = true;
> +            result_value.l = result;

You've got a negative result here, and result_value.l is unsigned. Sure
that this is a good idea?

Kevin

Reply via email to