summary refs log tree commit diff stats
path: root/hw/ide/internal.h
diff options
context:
space:
mode:
authorKevin Wolf <kwolf@redhat.com>2011-05-26 15:00:34 +0200
committerKevin Wolf <kwolf@redhat.com>2011-06-15 14:36:15 +0200
commitdef93791f22a3536c3508244ec7d270098484c7d (patch)
treed2730ee2e84d06a24048e8d1abbe937207b60824 /hw/ide/internal.h
parent9e2a3701a1fcfec0316b9dc1a6cd62869de5542c (diff)
downloadfocaccia-qemu-def93791f22a3536c3508244ec7d270098484c7d.tar.gz
focaccia-qemu-def93791f22a3536c3508244ec7d270098484c7d.zip
ide: Split error status from status register
When adding the werror=stop mode, some flags were added to s->status
which are used to determine what kind of operation should be restarted
when the VM is continued.

Unfortunately, it turns out that s->status is in fact a device register
and as such is visible to the guest (some of the abused bits are even
writable for the guest).

For migration we keep on using the old VMState field (renamed to
migration_compat_status) if the status register doesn't use any of the
previously abused bits. If it does, we use a subsection with a clean copy of
the status register.

The error status is always sent in a subsection if there is any error. It can't
use the old field because errors happen even without PCI.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'hw/ide/internal.h')
-rw-r--r--hw/ide/internal.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/hw/ide/internal.h b/hw/ide/internal.h
index c2b35ec5e6..8d18cc3733 100644
--- a/hw/ide/internal.h
+++ b/hw/ide/internal.h
@@ -486,6 +486,8 @@ struct IDEBus {
     uint8_t unit;
     uint8_t cmd;
     qemu_irq irq;
+
+    int error_status;
 };
 
 struct IDEDevice {
@@ -505,11 +507,17 @@ struct IDEDeviceInfo {
 #define BM_STATUS_DMAING 0x01
 #define BM_STATUS_ERROR  0x02
 #define BM_STATUS_INT    0x04
+
+/* FIXME These are not status register bits */
 #define BM_STATUS_DMA_RETRY  0x08
 #define BM_STATUS_PIO_RETRY  0x10
 #define BM_STATUS_RETRY_READ  0x20
 #define BM_STATUS_RETRY_FLUSH 0x40
 
+#define BM_MIGRATION_COMPAT_STATUS_BITS \
+        (BM_STATUS_DMA_RETRY | BM_STATUS_PIO_RETRY | \
+        BM_STATUS_RETRY_READ | BM_STATUS_RETRY_FLUSH)
+
 #define BM_CMD_START     0x01
 #define BM_CMD_READ      0x08