qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC V8 07/13] quorum: Add quorum_getlength().


From: Kevin Wolf
Subject: Re: [Qemu-devel] [RFC V8 07/13] quorum: Add quorum_getlength().
Date: Fri, 08 Feb 2013 13:12:12 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0

Am 28.01.2013 18:07, schrieb BenoƮt Canet:
> Check that every bs file return the same length.
> If not return -EIO to disable the quorum and
> avoid length discrepancy.
> 
> Signed-off-by: Benoit Canet <address@hidden>
> ---
>  block/quorum.c |   20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/block/quorum.c b/block/quorum.c
> index 4c552e4..fe920e7 100644
> --- a/block/quorum.c
> +++ b/block/quorum.c
> @@ -497,12 +497,32 @@ static BlockDriverAIOCB 
> *quorum_aio_writev(BlockDriverState *bs,
>      return &acb->common;
>  }
>  
> +static int64_t quorum_getlength(BlockDriverState *bs)
> +{
> +    BDRVQuorumState *s = bs->opaque;
> +    int64_t result;
> +    int i;
> +
> +    /* check that every file have the same length */

"all files have" or "every file has"

> +    result = bdrv_getlength(s->bs[0]);
> +    for (i = 1; i < s->total; i++) {
> +        int64_t value = bdrv_getlength(s->bs[i]);
> +        if (value != result) {
> +            return -EIO;
> +        }
> +    }
> +
> +    return result;
> +}

Should bdrv_getlength() error returns be handled in some way?

Kevin



reply via email to

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