qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [RFC 02/12] qorum: Add QorumSingleAIOCB and QorumAIOCB.


From: Benoît Canet
Subject: [Qemu-devel] [RFC 02/12] qorum: Add QorumSingleAIOCB and QorumAIOCB.
Date: Thu, 2 Aug 2012 12:16:34 +0200

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

diff --git a/block/qorum.c b/block/qorum.c
index 3341021..5b4f031 100644
--- a/block/qorum.c
+++ b/block/qorum.c
@@ -13,3 +13,33 @@
  * See the COPYING file in the top-level directory.
  */
 
+#include "block_int.h"
+
+typedef struct QorumAIOCB QorumAIOCB;
+
+typedef struct QorumSingleAIOCB {
+    BlockDriverAIOCB *aiocb;
+    char *buf;
+    int ret;
+    QorumAIOCB *parent;
+} QorumSingleAIOCB;
+
+struct QorumAIOCB {
+    BlockDriverAIOCB common;
+    QEMUBH *bh;
+
+    /* Request metadata */
+    bool is_write;
+    int64_t sector_num;
+    int nb_sectors;
+
+    QEMUIOVector *qiov;         /* calling readv IOV */
+
+    QorumSingleAIOCB aios[3];   /* individual AIOs */
+    QEMUIOVector qiovs[3];      /* individual IOVs */
+    int count;                  /* number of completed AIOCB */
+    bool *finished;             /* completion signal for cancel */
+
+    void (*vote)(QorumAIOCB *acb);
+    int vote_ret;
+};
-- 
1.7.9.5




reply via email to

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