Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LPI2w-0007Cq-UN for qemu-devel@nongnu.org; Tue, 20 Jan 2009 09:57:42 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LPI2w-0007BA-4Y for qemu-devel@nongnu.org; Tue, 20 Jan 2009 09:57:42 -0500 Received: from [199.232.76.173] (port=42915 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LPI2w-0007At-06 for qemu-devel@nongnu.org; Tue, 20 Jan 2009 09:57:42 -0500 Received: from smtp02.citrix.com ([66.165.176.63]:2107) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LPI2v-0002aT-DB for qemu-devel@nongnu.org; Tue, 20 Jan 2009 09:57:41 -0500 Received: from mariner.uk.xensource.com ([10.80.2.22]) by smtp01.ad.xensource.com (8.13.1/8.13.1) with ESMTP id n0KEvSVV015162 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Tue, 20 Jan 2009 06:57:30 -0800 Received: from iwj by mariner.uk.xensource.com with local (Exim 4.63) (envelope-from ) id 1LPI2i-00053k-Bz for qemu-devel@nongnu.org; Tue, 20 Jan 2009 14:57:28 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18805.58968.356765.658443@mariner.uk.xensource.com> Date: Tue, 20 Jan 2009 14:57:28 +0000 Subject: Re: [Qemu-devel] [PATCH v4] Stop VM on ENOSPC error. In-Reply-To: <20090120141651.GF27675@redhat.com> References: <20090120105610.GB27675@redhat.com> <18805.55601.339210.692083@mariner.uk.xensource.com> <20090120141651.GF27675@redhat.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: qemu-devel@nongnu.org Gleb Natapov writes ("Re: [Qemu-devel] [PATCH v4] Stop VM on ENOSPC error."): > On Tue, Jan 20, 2009 at 02:01:21PM +0000, Ian Jackson wrote: > > Are we sure that the ide layer is the right place to do this ? > > Perhaps it would be better to do it in block.c. That way it would > > seamlessly affect scsi too and other kinds of weird block devices > > on other platforms. ... > I thought about it and I see only two places where this can be done. In > ide/scsi/pv-block layer or in individual block implementations > (qcow,raw, etc). The problem doing it in generic block.c layer is that > how should it handle errors during blocking writes? It can't return > error to the caller and it can't wait inside the function. Doing this in > the ide layer allows for error handling flexibility that this patch > provides. Hrm, yes, I see. We could abolish the blocking calls. Or rather, we could say that a device emulation which wants the stop-on-enospc behaviour must never make the blocking calls. That way there would still have to be some additional complexity in ide.c and scsi.c but only the minimum necessary. Ian.