From patchwork Thu Aug 2 10:16:35 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benoit Canet X-Patchwork-Id: 174711 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 58D942C00A2 for ; Thu, 2 Aug 2012 20:17:29 +1000 (EST) Received: from localhost ([::1]:60320 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwsT9-0006av-CZ for incoming@patchwork.ozlabs.org; Thu, 02 Aug 2012 06:17:27 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36477) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwsSo-0006Gh-LN for qemu-devel@nongnu.org; Thu, 02 Aug 2012 06:17:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SwsSl-0003yS-Mk for qemu-devel@nongnu.org; Thu, 02 Aug 2012 06:17:06 -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 1SwsSl-0003xg-GZ for qemu-devel@nongnu.org; Thu, 02 Aug 2012 06:17:03 -0400 Received: by mail-wi0-f181.google.com with SMTP id hm2so3769121wib.10 for ; Thu, 02 Aug 2012 03:17:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=thrW8U0u225jrYF+ItxE0yQIlAU8RGuJPjJYFFAy42M=; b=tFw5vXa9etTke+eLxTYUNGhUs/ctXMHvxooB7Wld14BD8ko7LwOFGkxsuB//wNA9a5 MYOeN8iP9ymKIaScXAurVDsCAZhFTw1fsV2nGp37ZRbhGF+FCyH7/3dOegs9w74p4ZH4 dIJNGx0sMEOsM7H9j0p7o8jFvOMHYZvw7wCYC4TjbpnGENybIcsyPgWlbinBbfzB1T0g nrGqqPNWJDNcbPGchvuY3LdFQBRAlOf6mLv1EKoAp5WUBkN0gSOO5zsrwQddECtPjjSS StTJibO5HVL38J9wCGhYbwXaVF3z/J38EKfSa3EGPd5Em4btkb/cP+zAvujIdxCYTOTL C/uQ== Received: by 10.216.122.203 with SMTP id t53mr7296471weh.5.1343902623228; Thu, 02 Aug 2012 03:17:03 -0700 (PDT) Received: from Laure.box.in.irqsave.net (paradis.irqsave.net. [109.190.18.76]) by mx.google.com with ESMTPS id bc2sm16181243wib.0.2012.08.02.03.17.02 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 02 Aug 2012 03:17:02 -0700 (PDT) From: "=?UTF-8?q?Beno=C3=AEt=20Canet?=" To: qemu-devel@nongnu.org Date: Thu, 2 Aug 2012 12:16:35 +0200 Message-Id: <1343902604-13981-4-git-send-email-benoit@irqsave.net> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1343902604-13981-1-git-send-email-benoit@irqsave.net> References: <1343902604-13981-1-git-send-email-benoit@irqsave.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.212.181 Cc: kwolf@redhat.com, pbonzini@redhat.com, stefanha@linux.vnet.ibm.com, =?UTF-8?q?Beno=C3=AEt=20Canet?= Subject: [Qemu-devel] [RFC 03/12] qorum: Create BDRVQorumState and BlkDriver and do init. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Benoit Canet --- block/qorum.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/block/qorum.c b/block/qorum.c index 5b4f031..ea2a720 100644 --- a/block/qorum.c +++ b/block/qorum.c @@ -15,6 +15,10 @@ #include "block_int.h" +typedef struct { + BlockDriverState * bs[3]; +} BDRVQorumState; + typedef struct QorumAIOCB QorumAIOCB; typedef struct QorumSingleAIOCB { @@ -43,3 +47,17 @@ struct QorumAIOCB { void (*vote)(QorumAIOCB *acb); int vote_ret; }; + +static BlockDriver bdrv_qorum = { + .format_name = "qorum", + .protocol_name = "qorum", + + .instance_size = sizeof(BDRVQorumState), +}; + +static void bdrv_qorum_init(void) +{ + bdrv_register(&bdrv_qorum); +} + +block_init(bdrv_qorum_init);