Patchwork [RFC,03/12] qorum: Create BDRVQorumState and BlkDriver and do init.

login
register
mail settings
Submitter Benoit Canet
Date Aug. 2, 2012, 10:16 a.m.
Message ID <1343902604-13981-4-git-send-email-benoit@irqsave.net>
Download mbox | patch
Permalink /patch/174711/
State New
Headers show

Comments

Benoit Canet - Aug. 2, 2012, 10:16 a.m.
Signed-off-by: Benoit Canet <benoit@irqsave.net>
---
 block/qorum.c |   18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Patch

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);