From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LPIby-0000jV-PQ for qemu-devel@nongnu.org; Tue, 20 Jan 2009 10:33:54 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LPIbw-0000jA-9r for qemu-devel@nongnu.org; Tue, 20 Jan 2009 10:33:53 -0500 Received: from [199.232.76.173] (port=51795 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LPIbw-0000j7-4i for qemu-devel@nongnu.org; Tue, 20 Jan 2009 10:33:52 -0500 Received: from mx2.redhat.com ([66.187.237.31]:43479) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LPIbu-0007x6-Se for qemu-devel@nongnu.org; Tue, 20 Jan 2009 10:33:51 -0500 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n0KFXlBi029524 for ; Tue, 20 Jan 2009 10:33:47 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n0KFXllp007848 for ; Tue, 20 Jan 2009 10:33:47 -0500 Received: from dhcp-1-237.tlv.redhat.com (dhcp-1-237.tlv.redhat.com [10.35.1.237]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n0KFXjYT002420 for ; Tue, 20 Jan 2009 10:33:46 -0500 Date: Tue, 20 Jan 2009 17:31:59 +0200 From: Gleb Natapov Subject: Re: [Qemu-devel] [PATCH v4] Stop VM on ENOSPC error. Message-ID: <20090120153159.GA8319@redhat.com> References: <20090120105610.GB27675@redhat.com> <18805.55601.339210.692083@mariner.uk.xensource.com> <20090120141651.GF27675@redhat.com> <18805.58968.356765.658443@mariner.uk.xensource.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <18805.58968.356765.658443@mariner.uk.xensource.com> 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 On Tue, Jan 20, 2009 at 02:57:28PM +0000, Ian Jackson wrote: > 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. > I would like to abolish the blocking calls from all file formats, but in reality it is almost impossible. Qcow2 metadata updates is a big mess to do asynchronously. The best thing we can do is to move it to another thread. So are you OK with my current approach? -- Gleb.