From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KfmeI-0006x1-A4 for qemu-devel@nongnu.org; Tue, 16 Sep 2008 22:20:10 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KfmeG-0006wW-0M for qemu-devel@nongnu.org; Tue, 16 Sep 2008 22:20:09 -0400 Received: from [199.232.76.173] (port=52552 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KfmeF-0006wR-R9 for qemu-devel@nongnu.org; Tue, 16 Sep 2008 22:20:07 -0400 Received: from rv-out-0708.google.com ([209.85.198.247]:63816) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KfmeF-0001tx-D3 for qemu-devel@nongnu.org; Tue, 16 Sep 2008 22:20:07 -0400 Received: by rv-out-0708.google.com with SMTP id f25so2850594rvb.22 for ; Tue, 16 Sep 2008 19:20:05 -0700 (PDT) Message-ID: Date: Wed, 17 Sep 2008 04:20:05 +0200 From: "andrzej zaborowski" Subject: Re: [Qemu-devel] [REPOST] [PATCH 0/2] IDE error checking In-Reply-To: <48C343CB.2000208@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <18620.5409.570126.428085@mariner.uk.xensource.com> <48C343CB.2000208@codemonkey.ws> 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 2008/9/7 Anthony Liguori : > Ian Jackson wrote: >> >> In these two patches I make the IDE controller emulation pay attention >> to errors returned by the bdrv functions. >> >> The first of these patches was first posted in February 2008 and has >> been discussed extensively. >> >> There was some discussion as to whether it would be better, in cases >> where the error was ENOSPC, to stop the guest than to pass it an IDE >> error. However it must be clear that regardless of whether that would >> be better in some circumstances, giving the guest an IDE error is >> better than silently ignoring the error, throwing away the guest's >> data. >> > > The proper solution is not significantly more difficult. Just add a > switch(errno) { case ENOSPC: vm_stop(0); term_printf("Ran out of disk > space\n"); break; }. That's all I'm asking for. I will commit these two patches if there are no further comments / iterations to them. There's been enough discussion about the issue and this is definitely an improvement, there can be perhaps further improvements later. I will not commit a patch that does the vm_stop(0) thing because I don't see a reason hard discs should be treated differently than other peripherals. Any peripheral being physically distroyed is a critical situation to the OS and the OS should be left to decide what to do with it. Furthermore a ENOSPC doesn't destroy all the capability of the emulated drive, it's just a disc that lost the capability to write changes. It should report write errors. It should continue to read. Note that the disc isn't any more critical than other peripherals to the system, there are diskless systems, with possibly hotpluggable storage, there are VMs using many images in different formats some of which can't return an ENOSPC. I submitted a patch to report IDE errors in early 2006 when I lost data due to lack of write error reporting and there's no change till today. Cheers