From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:36493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwsSr-0006N2-0M for qemu-devel@nongnu.org; Thu, 02 Aug 2012 06:17:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SwsSk-0003yM-JF for qemu-devel@nongnu.org; Thu, 02 Aug 2012 06:17:08 -0400 Received: from mail-wi0-f181.google.com ([209.85.212.181]:33626) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwsSk-0003xg-DL for qemu-devel@nongnu.org; Thu, 02 Aug 2012 06:17:02 -0400 Received: by mail-wi0-f181.google.com with SMTP id hm2so3769121wib.10 for ; Thu, 02 Aug 2012 03:17:02 -0700 (PDT) From: "=?UTF-8?q?Beno=C3=AEt=20Canet?=" Date: Thu, 2 Aug 2012 12:16:34 +0200 Message-Id: <1343902604-13981-3-git-send-email-benoit@irqsave.net> In-Reply-To: <1343902604-13981-1-git-send-email-benoit@irqsave.net> References: <1343902604-13981-1-git-send-email-benoit@irqsave.net> Subject: [Qemu-devel] [RFC 02/12] qorum: Add QorumSingleAIOCB and QorumAIOCB. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, pbonzini@redhat.com, stefanha@linux.vnet.ibm.com, =?UTF-8?q?Beno=C3=AEt=20Canet?= Signed-off-by: Benoit Canet --- 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