qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [RFC V5 06/11] quorum: Add quorum_co_flush().


From: Benoît Canet
Subject: [Qemu-devel] [RFC V5 06/11] quorum: Add quorum_co_flush().
Date: Mon, 27 Aug 2012 09:30:24 +0200

Signed-off-by: Benoit Canet <address@hidden>
---
 block/quorum.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/block/quorum.c b/block/quorum.c
index cd11cfb..f83b4cf 100644
--- a/block/quorum.c
+++ b/block/quorum.c
@@ -282,6 +282,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",
@@ -290,6 +302,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]