Revision cadebd7a block/quorum.c
b/block/quorum.c | ||
---|---|---|
15 | 15 |
|
16 | 16 |
#include "block/block_int.h" |
17 | 17 |
|
18 |
/* the following structure holds the state of one quorum instance */ |
|
19 |
typedef struct BDRVQuorumState { |
|
20 |
BlockDriverState **bs; /* children BlockDriverStates */ |
|
21 |
int num_children; /* children count */ |
|
22 |
int threshold; /* if less than threshold children reads gave the |
|
23 |
* same result a quorum error occurs. |
|
24 |
*/ |
|
25 |
bool is_blkverify; /* true if the driver is in blkverify mode |
|
26 |
* Writes are mirrored on two children devices. |
|
27 |
* On reads the two children devices' contents are |
|
28 |
* compared and if a difference is spotted its |
|
29 |
* location is printed and the code aborts. |
|
30 |
* It is useful to debug other block drivers by |
|
31 |
* comparing them with a reference one. |
|
32 |
*/ |
|
33 |
} BDRVQuorumState; |
|
34 |
|
|
18 | 35 |
typedef struct QuorumAIOCB QuorumAIOCB; |
19 | 36 |
|
20 | 37 |
/* Quorum will create one instance of the following structure per operation it |
... | ... | |
51 | 68 |
bool is_read; |
52 | 69 |
int vote_ret; |
53 | 70 |
}; |
71 |
|
|
72 |
static BlockDriver bdrv_quorum = { |
|
73 |
.format_name = "quorum", |
|
74 |
.protocol_name = "quorum", |
|
75 |
|
|
76 |
.instance_size = sizeof(BDRVQuorumState), |
|
77 |
}; |
|
78 |
|
|
79 |
static void bdrv_quorum_init(void) |
|
80 |
{ |
|
81 |
bdrv_register(&bdrv_quorum); |
|
82 |
} |
|
83 |
|
|
84 |
block_init(bdrv_quorum_init); |
Also available in: Unified diff