From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50337) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5VMB-0000tC-JV for qemu-devel@nongnu.org; Fri, 11 Jul 2014 03:35:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X5VM5-0006Jb-J6 for qemu-devel@nongnu.org; Fri, 11 Jul 2014 03:34:59 -0400 Received: from mail-pd0-x22e.google.com ([2607:f8b0:400e:c02::22e]:56080) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5VM5-0006JQ-C4 for qemu-devel@nongnu.org; Fri, 11 Jul 2014 03:34:53 -0400 Received: by mail-pd0-f174.google.com with SMTP id y10so942007pdj.33 for ; Fri, 11 Jul 2014 00:34:52 -0700 (PDT) From: Liu Yuan Date: Fri, 11 Jul 2014 15:34:25 +0800 Message-Id: <1405064065-10021-1-git-send-email-namei.unix@gmail.com> Subject: [Qemu-devel] [PATCH] block/quorum: make quorum_getlength error message user friendly List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , Benoit Canet , Stefan Hajnoczi 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 Cc: Kevin Wolf Cc: Stefan Hajnoczi Signed-off-by: Liu Yuan --- 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