]> xenbits.xensource.com Git - people/vhanquez/xen.git/commitdiff
hvm, ioemu: Fix the ide/cdrom emulation error on FC7 guest.
authorKeir Fraser <keir.fraser@citrix.com>
Tue, 22 Jan 2008 11:27:18 +0000 (11:27 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Tue, 22 Jan 2008 11:27:18 +0000 (11:27 +0000)
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>
xen-unstable changeset:   16776:2af5fb3e34e54e96d0c58e0e4557ee1240df9ce8
xen-unstable date:        Tue Jan 22 09:50:06 2008 +0000

tools/ioemu/hw/ide.c

index 71961f28735146ff22f60a3407b5f6876fa37b8b..222fa9fcb33a640f1b3011ae9176c14ee1eb5cdd 100644 (file)
@@ -774,7 +774,9 @@ static void ide_transfer_start(IDEState *s, uint8_t *buf, int size,
     s->end_transfer_func = end_transfer_func;
     s->data_ptr = buf;
     s->data_end = buf + size;
-    s->status |= DRQ_STAT;
+    /* don't violate the HSM */
+    if (!(s->status & ERR_STAT))
+        s->status |= DRQ_STAT;
     buffered_pio_reset(s);
 }
 
@@ -1950,6 +1952,7 @@ static void ide_ioport_write(void *opaque, uint32_t addr, uint32_t val)
             /* overlapping commands not supported */
             if (s->feature & 0x02)
                 goto abort_cmd;
+            s->status = READY_STAT;
             s->atapi_dma = s->feature & 1;
             s->nsector = 1;
             ide_transfer_start(s, s->io_buffer, ATAPI_PACKET_SIZE,