ia64/xen-unstable

changeset 16831:2af5fb3e34e5

hvm, ioemu: Fix the ide/cdrom emulation error on FC7 guest.

The new libata-eh in the Linux kernel is throwing a fit over the QEMU
cdrom device for two reasons:

1) DRQ can be set with ERR_STAT set. This is a violation of the ATAPI
state machine.

2) After a TEST_UNIT_READY ATAPI command is sent ERR_STAT is getting
set
which is correct. But, when the OS issues another ATAPI command
ERR_STAT is still set. Which is bad since the next expected command
from the OS is REQUEST_SENSE to find out why ERR_STAT is set.

bug this fixes: https://bugzilla.novell.com/show_bug.cgi?id=3D291775

Signed-off-by: Brandon Philips <bphilips@suse.de>

Porting this qemu fix to xen.

Signed-off-by: Xu Dongxiao <dongxiao.xu@intel.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Jan 22 09:50:06 2008 +0000 (2008-01-22)
parents cc5bb500df5f
children 6f3fb3f86b68
files tools/ioemu/hw/ide.c
line diff
     1.1 --- a/tools/ioemu/hw/ide.c	Tue Jan 22 09:48:51 2008 +0000
     1.2 +++ b/tools/ioemu/hw/ide.c	Tue Jan 22 09:50:06 2008 +0000
     1.3 @@ -756,7 +756,9 @@ static void ide_transfer_start(IDEState 
     1.4      s->end_transfer_func = end_transfer_func;
     1.5      s->data_ptr = buf;
     1.6      s->data_end = buf + size;
     1.7 -    s->status |= DRQ_STAT;
     1.8 +    /* don't violate the HSM */
     1.9 +    if (!(s->status & ERR_STAT))
    1.10 +        s->status |= DRQ_STAT;
    1.11      buffered_pio_reset(s);
    1.12  }
    1.13  
    1.14 @@ -2011,6 +2013,7 @@ static void ide_ioport_write(void *opaqu
    1.15              /* overlapping commands not supported */
    1.16              if (s->feature & 0x02)
    1.17                  goto abort_cmd;
    1.18 +            s->status = READY_STAT;
    1.19              s->atapi_dma = s->feature & 1;
    1.20              s->nsector = 1;
    1.21              ide_transfer_start(s, s->io_buffer, ATAPI_PACKET_SIZE,