diff mbox

[17/17] rtc: use qidl-generated vmstate bindings

Message ID 1338858018-17189-18-git-send-email-mdroth@linux.vnet.ibm.com
State New
Headers show

Commit Message

Michael Roth June 5, 2012, 1 a.m. UTC
Make use of the qidl-generated vmstate bindings

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
 hw/mc146818rtc.c |   21 ++-------------------
 1 files changed, 2 insertions(+), 19 deletions(-)
diff mbox

Patch

diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c
index 2dfc233..14a9b4d 100644
--- a/hw/mc146818rtc.c
+++ b/hw/mc146818rtc.c
@@ -27,6 +27,7 @@ 
 #include "mc146818rtc.h"
 #include "mc146818rtc_state.h"
 #include "qapi-generated/mc146818rtc-qapi-visit.h"
+#include "mc146818rtc_vmstate.h"
 
 #ifdef TARGET_I386
 #include "apic.h"
@@ -505,25 +506,7 @@  static const VMStateDescription vmstate_rtc = {
     .minimum_version_id = 1,
     .minimum_version_id_old = 1,
     .post_load = rtc_post_load,
-    .fields      = (VMStateField []) {
-        VMSTATE_BUFFER(cmos_data, RTCState),
-        VMSTATE_UINT8(cmos_index, RTCState),
-        VMSTATE_INT32(current_tm.tm_sec, RTCState),
-        VMSTATE_INT32(current_tm.tm_min, RTCState),
-        VMSTATE_INT32(current_tm.tm_hour, RTCState),
-        VMSTATE_INT32(current_tm.tm_wday, RTCState),
-        VMSTATE_INT32(current_tm.tm_mday, RTCState),
-        VMSTATE_INT32(current_tm.tm_mon, RTCState),
-        VMSTATE_INT32(current_tm.tm_year, RTCState),
-        VMSTATE_TIMER(periodic_timer, RTCState),
-        VMSTATE_INT64(next_periodic_time, RTCState),
-        VMSTATE_INT64(next_second_time, RTCState),
-        VMSTATE_TIMER(second_timer, RTCState),
-        VMSTATE_TIMER(second_timer2, RTCState),
-        VMSTATE_UINT32_V(irq_coalesced, RTCState, 2),
-        VMSTATE_UINT32_V(period, RTCState, 2),
-        VMSTATE_END_OF_LIST()
-    }
+    .fields = vmstate_rtcstate,
 };
 
 static void rtc_notify_clock_reset(Notifier *notifier, void *data)