[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [RFC 09/12] qorum: Add qorum_co_flush().
From: |
Benoît Canet |
Subject: |
[Qemu-devel] [RFC 09/12] qorum: Add qorum_co_flush(). |
Date: |
Thu, 2 Aug 2012 12:16:41 +0200 |
Signed-off-by: Benoit Canet <address@hidden>
---
block/qorum.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/block/qorum.c b/block/qorum.c
index 3dae8e4..eeffac2 100644
--- a/block/qorum.c
+++ b/block/qorum.c
@@ -15,6 +15,10 @@
#include "block_int.h"
+ssize_t blkverify_iovec_compare(QEMUIOVector *a, QEMUIOVector *b);
+void blkverify_iovec_clone(QEMUIOVector *dest, const QEMUIOVector *src,
+ void *buf);
+
typedef struct {
BlockDriverState * bs[3];
} BDRVQorumState;
@@ -244,6 +248,21 @@ static BlockDriverAIOCB *qorum_aio_writev(BlockDriverState
*bs,
return &acb->common;
}
+static coroutine_fn int qorum_co_flush(BlockDriverState *bs)
+{
+ BDRVQorumState *s = bs->opaque;
+ int i, ret;
+
+ for (i = 0; i <= 2; i++) {
+ ret = bdrv_co_flush(s->bs[i]);
+ if (ret < 0) {
+ return ret;
+ }
+ }
+
+ return ret;
+}
+
static BlockDriver bdrv_qorum = {
.format_name = "qorum",
.protocol_name = "qorum",
@@ -254,6 +273,7 @@ static BlockDriver bdrv_qorum = {
.bdrv_file_open = qorum_open,
.bdrv_close = qorum_close,
+ .bdrv_co_flush_to_disk = qorum_co_flush,
.bdrv_aio_writev = qorum_aio_writev,
};
--
1.7.9.5
- Re: [Qemu-devel] [RFC 01/12] qorum: Add GPL v2+ header file., (continued)
- [Qemu-devel] [RFC 06/12] qorum: Add qorum_getlength()., Benoît Canet, 2012/08/02
- [Qemu-devel] [RFC 03/12] qorum: Create BDRVQorumState and BlkDriver and do init., Benoît Canet, 2012/08/02
- [Qemu-devel] [RFC 05/12] qorum: Add qorum_close()., Benoît Canet, 2012/08/02
- [Qemu-devel] [RFC 02/12] qorum: Add QorumSingleAIOCB and QorumAIOCB., Benoît Canet, 2012/08/02
- [Qemu-devel] [RFC 10/12] qorum: Add qorum_aio_readv., Benoît Canet, 2012/08/02
- [Qemu-devel] [RFC 07/12] qorum: Add qorum_aio_writev and its dependencies., Benoît Canet, 2012/08/02
- [Qemu-devel] [RFC 12/12] qorum: build feature into QEMU., Benoît Canet, 2012/08/02
- [Qemu-devel] [RFC 08/12] blkverify: Make blkverify_iovec_clone() and blkverify_iovec_compare() public, Benoît Canet, 2012/08/02
- [Qemu-devel] [RFC 09/12] qorum: Add qorum_co_flush().,
Benoît Canet <=
- [Qemu-devel] [RFC 11/12] qorum: Add qorum mechanism., Benoît Canet, 2012/08/02
- Re: [Qemu-devel] [RFC 00/12] Qorum disk image corruption resiliency, Eric Blake, 2012/08/02
- Re: [Qemu-devel] [RFC 00/12] Qorum disk image corruption resiliency, Anthony Liguori, 2012/08/02
- Re: [Qemu-devel] [RFC 00/12] Qorum disk image corruption resiliency, Blue Swirl, 2012/08/03