summaryrefslogtreecommitdiffstats
path: root/hw/ide/internal.h
diff options
context:
space:
mode:
authorDr. David Alan Gilbert <dgilbert@redhat.com>2014-12-09 18:15:09 +0000
committerKevin Wolf <kwolf@redhat.com>2015-02-06 17:24:20 +0100
commita71754e5b03fd3b8b8c6d3bc2a39f75bead729de (patch)
tree4e31554afb7c37219fa4a626c71c86abc56e9240 /hw/ide/internal.h
parent819fa276311ce328a8e38ad9306c1093961b3f4b (diff)
downloadhqemu-a71754e5b03fd3b8b8c6d3bc2a39f75bead729de.zip
hqemu-a71754e5b03fd3b8b8c6d3bc2a39f75bead729de.tar.gz
atapi migration: Throw recoverable error to avoid recovery
(With the previous atapi_dma flag recovery) If migration happens between the ATAPI command being written and the bmdma being started, the DMA is dropped. Eventually the guest times out and recovers, but that can take many seconds. (This is rare, on a pingpong reading the CD continuously I hit this about ~1/30-1/50 migrates) I don't think we've got enough state to be able to recover safely at this point, so I throw a 'medium error, no seek complete' that I'm assuming guests will try and recover from an apparently dirty CD. OK, it's a hack, the real solution is probably to push a lot of ATAPI state into the migration stream, but this is a fix that works with no stream changes. Tested only on Linux (both RHEL5 (pre-libata) and RHEL7). Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Reviewed-by: John Snow <jsnow@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/ide/internal.h')
-rw-r--r--hw/ide/internal.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/hw/ide/internal.h b/hw/ide/internal.h
index c998003..ee9a57f 100644
--- a/hw/ide/internal.h
+++ b/hw/ide/internal.h
@@ -289,6 +289,7 @@ typedef struct IDEDMAOps IDEDMAOps;
#define ATAPI_INT_REASON_TAG 0xf8
/* same constants as bochs */
+#define ASC_NO_SEEK_COMPLETE 0x02
#define ASC_ILLEGAL_OPCODE 0x20
#define ASC_LOGICAL_BLOCK_OOR 0x21
#define ASC_INV_FIELD_IN_CMD_PACKET 0x24
@@ -530,6 +531,7 @@ void ide_dma_error(IDEState *s);
void ide_atapi_cmd_ok(IDEState *s);
void ide_atapi_cmd_error(IDEState *s, int sense_key, int asc);
+void ide_atapi_dma_restart(IDEState *s);
void ide_atapi_io_error(IDEState *s, int ret);
void ide_ioport_write(void *opaque, uint32_t addr, uint32_t val);
OpenPOWER on IntegriCloud