From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50611) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5Y2p-0000PP-Hx for qemu-devel@nongnu.org; Fri, 11 Jul 2014 06:27:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X5Y2j-0005Dq-J6 for qemu-devel@nongnu.org; Fri, 11 Jul 2014 06:27:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13080) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5Y2j-0005BF-Ag for qemu-devel@nongnu.org; Fri, 11 Jul 2014 06:27:05 -0400 Date: Fri, 11 Jul 2014 12:26:58 +0200 From: Kevin Wolf Message-ID: <20140711102658.GA3976@noname.redhat.com> References: <1405064065-10021-1-git-send-email-namei.unix@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1405064065-10021-1-git-send-email-namei.unix@gmail.com> Subject: Re: [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: Liu Yuan Cc: qemu-devel@nongnu.org, Stefan Hajnoczi , Benoit Canet Am 11.07.2014 um 09:34 hat Liu Yuan geschrieben: > 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 I think it would be better to do this check in quorum_open() instead of relying on bdrv_open() to perform a bdrv_getlength(). As a bonus, quorum_open() has an Error argument, so we wouldn't have to use something like error_printf(), which doesn't work well for QMP commands. Kevin