qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC V3 7/9] quorum: Add quorum_co_flush().


From: Blue Swirl
Subject: Re: [Qemu-devel] [RFC V3 7/9] quorum: Add quorum_co_flush().
Date: Tue, 14 Aug 2012 18:52:41 +0000

On Tue, Aug 14, 2012 at 2:14 PM, Benoît Canet <address@hidden> wrote:
> Signed-off-by: Benoit Canet <address@hidden>
> ---
>  block/quorum.c |   16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
>
> diff --git a/block/quorum.c b/block/quorum.c
> index 0a6647f..86962b4 100644
> --- a/block/quorum.c
> +++ b/block/quorum.c
> @@ -279,6 +279,21 @@ static BlockDriverAIOCB 
> *quorum_aio_writev(BlockDriverState *bs,
>      return &acb->common;
>  }
>
> +static coroutine_fn int quorum_co_flush(BlockDriverState *bs)
> +{
> +    BDRVQuorumState *s = bs->opaque;
> +    int i, ret = 0;
> +
> +    for (i = 0; i < s->m; i++) {
> +        ret = bdrv_co_flush(s->bs[i]);
> +        if (ret < 0) {
> +            return ret;

This stops flushing if any of the replicates fail. Shouldn't we just
ignore error?

> +        }
> +    }
> +
> +    return ret;
> +}
> +
>  static BlockDriver bdrv_quorum = {
>      .format_name        = "quorum",
>      .protocol_name      = "quorum",
> @@ -289,6 +304,7 @@ static BlockDriver bdrv_quorum = {
>
>      .bdrv_file_open     = quorum_open,
>      .bdrv_close         = quorum_close,
> +    .bdrv_co_flush_to_disk = quorum_co_flush,
>
>      .bdrv_aio_writev    = quorum_aio_writev,
>  };
> --
> 1.7.9.5
>



reply via email to

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