WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] QEMU report I/O errors to guest via IDE status regis

To: xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH] QEMU report I/O errors to guest via IDE status registers
From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
Date: Sun, 3 Dec 2006 23:28:56 +0000
Delivery-date: Sun, 03 Dec 2006 15:28:59 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Reply-to: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.4.1i
Following on from my patch to make blktap report I/O errors back to guest
OS[1], a similar problem exists in the QEMU codebase. The IDE driver never
reports I/O errors during read/write operations back to the guest OS. 
Instead all I/O operations are reported as succesfull. If, for example,
the host FS holding the disk image fills up, then writes may fail due to
lack of space. Since the guest OS never sees these failures, it assumes
all is well & will continue writing. Eventually this can lead to severe 
& unrecoverable filesystem corruption.

The attached patch fixes QEMU ide driver such that any failure of a read
or write operation sets the appropriate IDE status/error registers. Having
read the ATA-6 spec I think the most compliant behaviour is to set the
status register to 'READY_STAT | ERR_STAT', and the error register to 
ABRT_ERR. There is already a convenience function ide_abort_command() in
the QEMU codebase which does just this, so the attached patch simply calls
that function.

With this patch the guest OS sees the I/O failure & the kernel logs
IDE errors and then retries the operation. This at least ensures that 
the guest can be shutdown the out of space issue in the host corrected
and the guest restarted, without any serious filesystem damage having
occurred.

Regards,
Dan.

[1] http://lists.xensource.com/archives/html/xen-devel/2006-12/msg00029.html
-- 
|=- Red Hat, Engineering, Emerging Technologies, Boston.  +1 978 392 2496 -=|
|=-           Perl modules: http://search.cpan.org/~danberr/              -=|
|=-               Projects: http://freshmeat.net/~danielpb/               -=|
|=-  GnuPG: 7D3B9505   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505  -=| 

Attachment: xen-qemu-ide-error-handling-2.patch
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] QEMU report I/O errors to guest via IDE status registers, Daniel P. Berrange <=