From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46909) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5oDM-0003Y4-Uz for qemu-devel@nongnu.org; Fri, 11 Jul 2014 23:43:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X5oDG-00061V-SD for qemu-devel@nongnu.org; Fri, 11 Jul 2014 23:43:08 -0400 Received: from mail-pd0-x22f.google.com ([2607:f8b0:400e:c02::22f]:40941) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X5oDG-000617-MB for qemu-devel@nongnu.org; Fri, 11 Jul 2014 23:43:02 -0400 Received: by mail-pd0-f175.google.com with SMTP id v10so2371321pde.34 for ; Fri, 11 Jul 2014 20:43:01 -0700 (PDT) Date: Sat, 12 Jul 2014 11:42:57 +0800 From: Liu Yuan Message-ID: <20140712034257.GC23778@ubuntu-trusty> References: <1405064065-10021-1-git-send-email-namei.unix@gmail.com> <20140711102658.GA3976@noname.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140711102658.GA3976@noname.redhat.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: Kevin Wolf Cc: qemu-devel@nongnu.org, Stefan Hajnoczi , Benoit Canet On Fri, Jul 11, 2014 at 12:26:58PM +0200, Kevin Wolf wrote: > 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 Make sense. I'll do it after we settle down my 'add simple read pattern' patch since they are conflicted. Yuan