Message ID | 1350995029-29128-7-git-send-email-benoit@irqsave.net |
---|---|
State | New |
Headers | show |
On 10/23/2012 06:23 AM, Benoît Canet wrote: > Signed-off-by: Benoit Canet <benoit@irqsave.net> > --- > block/quorum.c | 13 +++++++++++++ > 1 file changed, 13 insertions(+) > > diff --git a/block/quorum.c b/block/quorum.c > index 878d930..1b40081 100644 > --- a/block/quorum.c > +++ b/block/quorum.c > @@ -281,6 +281,18 @@ 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; > + > + for (i = 0; i < s->total; i++) { > + bdrv_co_flush(s->bs[i]); What if any of the individual flush calls return non-zero? > + } > + > + return 0; Shouldn't you then do likewise?
diff --git a/block/quorum.c b/block/quorum.c index 878d930..1b40081 100644 --- a/block/quorum.c +++ b/block/quorum.c @@ -281,6 +281,18 @@ 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; + + for (i = 0; i < s->total; i++) { + bdrv_co_flush(s->bs[i]); + } + + return 0; +} + static BlockDriver bdrv_quorum = { .format_name = "quorum", .protocol_name = "quorum", @@ -289,6 +301,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, };
Signed-off-by: Benoit Canet <benoit@irqsave.net> --- block/quorum.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)