[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

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


[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



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.