aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorPavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru>2014-08-28 15:19:25 +0400
committerPaolo Bonzini <pbonzini@redhat.com>2014-09-11 12:20:32 +0200
commit0b102153e08648391925bd0071226adf0de67270 (patch)
tree571c47e18f9d0f7cb629a3f54e525d1401e26af4 /hw
parent2c9ecdeb9fbad9e414c2a7da676804992b568d13 (diff)
mc146818rtc: add missed field to vmstate
This patch adds irq_reinject_on_ack_count field to VMState to allow correct saving/loading the state of MC146818 RTC. Signed-off-by: Pavel Dovgalyuk <Pavel.Dovgaluk@ispras.ru> Acked-by: Juan Quintela <quintela@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/timer/mc146818rtc.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/hw/timer/mc146818rtc.c b/hw/timer/mc146818rtc.c
index 17912b847f..f18d1281ca 100644
--- a/hw/timer/mc146818rtc.c
+++ b/hw/timer/mc146818rtc.c
@@ -733,6 +733,22 @@ static int rtc_post_load(void *opaque, int version_id)
return 0;
}
+static const VMStateDescription vmstate_rtc_irq_reinject_on_ack_count = {
+ .name = "irq_reinject_on_ack_count",
+ .version_id = 1,
+ .minimum_version_id = 1,
+ .fields = (VMStateField[]) {
+ VMSTATE_UINT16(irq_reinject_on_ack_count, RTCState),
+ VMSTATE_END_OF_LIST()
+ }
+};
+
+static bool rtc_irq_reinject_on_ack_count_needed(void *opaque)
+{
+ RTCState *s = (RTCState *)opaque;
+ return s->irq_reinject_on_ack_count != 0;
+}
+
static const VMStateDescription vmstate_rtc = {
.name = "mc146818rtc",
.version_id = 3,
@@ -753,6 +769,14 @@ static const VMStateDescription vmstate_rtc = {
VMSTATE_TIMER_V(update_timer, RTCState, 3),
VMSTATE_UINT64_V(next_alarm_time, RTCState, 3),
VMSTATE_END_OF_LIST()
+ },
+ .subsections = (VMStateSubsection[]) {
+ {
+ .vmsd = &vmstate_rtc_irq_reinject_on_ack_count,
+ .needed = rtc_irq_reinject_on_ack_count_needed,
+ }, {
+ /* empty */
+ }
}
};