Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Jh5pK-0000gu-MH for qemu-devel@nongnu.org; Wed, 02 Apr 2008 12:28:42 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Jh5pI-0000gf-2w for qemu-devel@nongnu.org; Wed, 02 Apr 2008 12:28:41 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Jh5pH-0000gc-Qx for qemu-devel@nongnu.org; Wed, 02 Apr 2008 12:28:39 -0400 Received: from smtp02.citrix.com ([66.165.176.63]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Jh5pH-0001xh-Bk for qemu-devel@nongnu.org; Wed, 02 Apr 2008 12:28:39 -0400 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Message-ID: <18419.46090.542427.977863@mariner.uk.xensource.com> Date: Wed, 2 Apr 2008 17:27:54 +0100 Subject: Re: [Qemu-devel] [PATCH] Asynchronous reliable and configurable cache flush In-Reply-To: <200804011846.25975.paul@codesourcery.com> References: <18418.28291.689482.198484@mariner.uk.xensource.com> <200804011846.25975.paul@codesourcery.com> From: Ian Jackson Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paul Brook Cc: qemu-devel@nongnu.org Paul Brook writes ("Re: [Qemu-devel] [PATCH] Asynchronous reliable and configurable cache flush"): > On Tuesday 01 April 2008, Ian Jackson wrote: > > +static void scsi_flush_cb(void *opaque, int ret) { > > +    SCSIRequest *r = opaque; > > +    if (ret) { > > +        BADF("scsi-disc: IO error on flush: %s\n", strerror(-ret)); > > This is wrong for two reasons: BADF already adds a suitable prefix, > and is for reporting qemu bugs (i.e. missing features or things that > should never happen). This is just a normal IO error, which we > correctly report to the guest. I don't think flush failures are a normal IO error. They can only occur when the corresponding host block device is having serious trouble. Normally (if it's actually a host disk) this is very bad. The principle I'm trying to follow with this is to not throw away the errno value. When we turn a block device write failure (which might be EIO or perhaps something weirder like EBADF indicating a bug in qemu) into a SCSI error, we don't have the ability to properly report that errno value to the guest. So we should log it somewhere. In a previous thread on this subject we seemed to conclude that qemu's stderr is fine for this purpose. But if not then I'm happy to be advised to send it somewhere else ... You're right about the prefix though (and it was the wrong prefix, too, with a variant spelling of `disk'). Ian.