From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49143) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VS6SX-0001KQ-MR for qemu-devel@nongnu.org; Fri, 04 Oct 2013 10:34:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VS6SS-0005Aw-Cd for qemu-devel@nongnu.org; Fri, 04 Oct 2013 10:34:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7565) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VS6SS-0005Aq-2t for qemu-devel@nongnu.org; Fri, 04 Oct 2013 10:34:20 -0400 Message-ID: <524ED1E5.5000805@redhat.com> Date: Fri, 04 Oct 2013 16:34:13 +0200 From: Max Reitz MIME-Version: 1.0 References: <1380717564-11098-1-git-send-email-benoit@irqsave.net> <1380717564-11098-3-git-send-email-benoit@irqsave.net> In-Reply-To: <1380717564-11098-3-git-send-email-benoit@irqsave.net> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH V9 02/11] quorum: Create BDRVQuorumState and BlkDriver and do init. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?ISO-8859-15?Q?Beno=EEt_Canet?= Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com On 2013-10-02 14:39, Beno=EEt Canet wrote: > Signed-off-by: Benoit Canet > --- > block/quorum.c | 25 +++++++++++++++++++++++++ > 1 file changed, 25 insertions(+) > > diff --git a/block/quorum.c b/block/quorum.c > index 76a1fbb..9557e61 100644 > --- a/block/quorum.c > +++ b/block/quorum.c > @@ -15,6 +15,16 @@ > =20 > #include "block/block_int.h" > =20 > +/* the following structure hold the state of one quorum instance */ s/hold/holds/ > +typedef struct { > + BlockDriverState *bs; /* children BlockDriverStates */ > + int total; /* children count */ > + int threshold; /* if less than threshold children reads gav= e the same > + * result a quorum error occur. s/occur/occurs/ Max > + */ > + bool is_blkverify; /* true if the driver is in blkverify mode *= / > +} BDRVQuorumState; > + > typedef struct QuorumAIOCB QuorumAIOCB; > =20 > /* Quorum will create one instance of the following structure per rea= d/write > @@ -37,6 +47,7 @@ typedef struct QuorumSingleAIOCB { > */ > struct QuorumAIOCB { > BlockDriverAIOCB common; > + BDRVQuorumState *bqs; > =20 > /* Request metadata */ > uint64_t sector_num; > @@ -52,3 +63,17 @@ struct QuorumAIOCB { > bool is_read; > int vote_ret; > }; > + > +static BlockDriver bdrv_quorum =3D { > + .format_name =3D "quorum", > + .protocol_name =3D "quorum", > + > + .instance_size =3D sizeof(BDRVQuorumState), > +}; > + > +static void bdrv_quorum_init(void) > +{ > + bdrv_register(&bdrv_quorum); > +} > + > +block_init(bdrv_quorum_init);