When start quorum driver with 2 different sized images, we get: qemu-system-x86_64: -drive if=virtio,driver=quorum...: Could not refresh total \ sector count: Input/output error
EIO would confuse users. With this patch, the error message goes like Children images are not in the same size qemu-system-x86_64: -drive if=virtio,driver=quorum...: Could not refresh total \ sector count: Invalid argument Cc: Benoit Canet <ben...@irqsave.net> Cc: Kevin Wolf <kw...@redhat.com> Cc: Stefan Hajnoczi <stefa...@redhat.com> Signed-off-by: Liu Yuan <namei.u...@gmail.com> --- block/quorum.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/quorum.c b/block/quorum.c index 2f18755..51437ad 100644 --- a/block/quorum.c +++ b/block/quorum.c @@ -736,7 +736,8 @@ static int64_t quorum_getlength(BlockDriverState *bs) return value; } if (value != result) { - return -EIO; + error_printf("Children images are not in the same size\n"); + return -EINVAL; } } -- 1.9.1