We connect to NBD server when starting block replication, so the length is 0 before starting block replication.
Signed-off-by: Wen Congyang <[email protected]> Signed-off-by: zhanghailiang <[email protected]> Signed-off-by: Gonglei <[email protected]> --- block/quorum.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/block/quorum.c b/block/quorum.c index 5ed1ff8..e6aff5f 100644 --- a/block/quorum.c +++ b/block/quorum.c @@ -734,6 +734,11 @@ static int64_t quorum_getlength(BlockDriverState *bs) if (value < 0) { return value; } + + if (!value) { + continue; + } + if (value != result) { return -EIO; } -- 2.1.0
