diff options
| author | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2006-12-04 09:29:26 +0000 |
|---|---|---|
| committer | kfraser@localhost.localdomain <kfraser@localhost.localdomain> | 2006-12-04 09:29:26 +0000 |
| commit | a52cacaef95c4d42492298af9fb5281e6939e55c (patch) | |
| tree | 0e45153b8c3e90016f05ce2a427ef7b4ac7da574 /tools/ioemu/hw/mc146818rtc.c | |
| parent | 00f75a257f970be28fce18fcea14dc124fd73540 (diff) | |
| download | xen-a52cacaef95c4d42492298af9fb5281e6939e55c.tar.gz xen-a52cacaef95c4d42492298af9fb5281e6939e55c.tar.bz2 xen-a52cacaef95c4d42492298af9fb5281e6939e55c.zip | |
[QEMU] Error reporting in IDE device model.
Following on from my patch to make blktap report I/O errors back to
guest OS, 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.
From: Daniel Berrange <berrange@redhat.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
Diffstat (limited to 'tools/ioemu/hw/mc146818rtc.c')
0 files changed, 0 insertions, 0 deletions
