Signed-off-by: Benoit Canet <ben...@irqsave.net> --- block/qorum.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
diff --git a/block/qorum.c b/block/qorum.c index 006ab8c..37f6514 100644 --- a/block/qorum.c +++ b/block/qorum.c @@ -119,12 +119,29 @@ static void qorum_close(BlockDriverState *bs) } } +static int64_t qorum_getlength(BlockDriverState *bs) +{ + BDRVQorumState *s = bs->opaque; + int i; + int64_t ret; + + /* return the length of the first available qorum file */ + for (i = 0, ret = bdrv_getlength(s->bs[i]); + ret == -ENOMEDIUM && i <= 2; + i++, ret = bdrv_getlength(s->bs[i])) { + } + + return ret; +} + static BlockDriver bdrv_qorum = { .format_name = "qorum", .protocol_name = "qorum", .instance_size = sizeof(BDRVQorumState), + .bdrv_getlength = qorum_getlength, + .bdrv_file_open = qorum_open, .bdrv_close = qorum_close, }; -- 1.7.9.5