aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2011-02-03 22:54:12 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2011-02-04 06:53:52 -0600
commitf05929b182f279e9ab2ae8c9da5b8db80f8c56c4 (patch)
tree130ba90b7989694da6cc13730677a2fd77c22a35 /hw
parentbc3aaac57b85ade96eeefad400ef1aff0ac73151 (diff)
ioapic: Save/restore irr
This is a guest modifiable state that must be saved/restored properly. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com> (cherry picked from commit 35a74c5c5941b474d8b985237e1bde0b8cd2a20f)
Diffstat (limited to 'hw')
-rw-r--r--hw/ioapic.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/hw/ioapic.c b/hw/ioapic.c
index 8bc31f7cdf..8c46c1dfdb 100644
--- a/hw/ioapic.c
+++ b/hw/ioapic.c
@@ -231,14 +231,27 @@ static void ioapic_mem_writel(void *opaque, target_phys_addr_t addr, uint32_t va
}
}
+static int ioapic_post_load(void *opaque, int version_id)
+{
+ IOAPICState *s = opaque;
+
+ if (version_id == 1) {
+ /* set sane value */
+ s->irr = 0;
+ }
+ return 0;
+}
+
static const VMStateDescription vmstate_ioapic = {
.name = "ioapic",
- .version_id = 1,
+ .version_id = 2,
+ .post_load = ioapic_post_load,
.minimum_version_id = 1,
.minimum_version_id_old = 1,
.fields = (VMStateField []) {
VMSTATE_UINT8(id, IOAPICState),
VMSTATE_UINT8(ioregsel, IOAPICState),
+ VMSTATE_UINT32_V(irr, IOAPICState, 2),
VMSTATE_UINT64_ARRAY(ioredtbl, IOAPICState, IOAPIC_NUM_PINS),
VMSTATE_END_OF_LIST()
}