From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LPHRB-0006wv-2u for qemu-devel@nongnu.org; Tue, 20 Jan 2009 09:18:41 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LPHR9-0006v6-KX for qemu-devel@nongnu.org; Tue, 20 Jan 2009 09:18:40 -0500 Received: from [199.232.76.173] (port=53403 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LPHR9-0006v1-F9 for qemu-devel@nongnu.org; Tue, 20 Jan 2009 09:18:39 -0500 Received: from mx2.redhat.com ([66.187.237.31]:51316) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LPHR9-0005Xs-1J for qemu-devel@nongnu.org; Tue, 20 Jan 2009 09:18:39 -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 n0KEIbdT013234 for ; Tue, 20 Jan 2009 09:18:37 -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 n0KEIcxD014207 for ; Tue, 20 Jan 2009 09:18:38 -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 n0KEIbLY014401 for ; Tue, 20 Jan 2009 09:18:37 -0500 Date: Tue, 20 Jan 2009 16:16:51 +0200 From: Gleb Natapov Subject: Re: [Qemu-devel] [PATCH v4] Stop VM on ENOSPC error. Message-ID: <20090120141651.GF27675@redhat.com> References: <20090120105610.GB27675@redhat.com> <18805.55601.339210.692083@mariner.uk.xensource.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <18805.55601.339210.692083@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:01:21PM +0000, Ian Jackson wrote: > Gleb Natapov writes ("[Qemu-devel] [PATCH v4] Stop VM on ENOSPC error."): > > This version of the patch adds new option "werror" to -drive flag. > > Possible values are: > > > > report - report errors to a guest as IO errors > > ignore - continue as if nothing happened > > stop - stop VM on any error and retry last command on resume > > enospc - stop vm on ENOSPC error and retry last command on resume > > all other errors are reported to a guest. > > Great, thanks. > > 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. > > That way the ide code can remain oblivious. > > What do you think ? > 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. -- Gleb.