Patchwork [6/6] mc146818rtc: Register vmstate via qdev

login
register
mail settings
Submitter Jan Kiszka
Date May 12, 2010, 9:19 p.m.
Message ID <11280de4beb922dbe9eb8e83a6d591c09f6f6375.1273699147.git.jan.kiszka@web.de>
Download mbox | patch
Permalink /patch/52443/
State New
Headers show

Comments

Jan Kiszka - May 12, 2010, 9:19 p.m.
From: Jan Kiszka <jan.kiszka@siemens.com>

After defining the required alias ID, we can push vmstate registration
of mc146818rtc to qdev.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 hw/mc146818rtc.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

Patch

diff --git a/hw/mc146818rtc.c b/hw/mc146818rtc.c
index 89a423e..16b033a 100644
--- a/hw/mc146818rtc.c
+++ b/hw/mc146818rtc.c
@@ -609,7 +609,7 @@  static int rtc_initfn(ISADevice *dev)
     register_ioport_write(base, 2, 1, cmos_ioport_write, s);
     register_ioport_read(base, 2, 1, cmos_ioport_read, s);
 
-    vmstate_register(base, &vmstate_rtc, s);
+    qdev_set_instance_id_alias(&dev->qdev, base);
     qemu_register_reset(rtc_reset, s);
     return 0;
 }
@@ -628,6 +628,7 @@  static ISADeviceInfo mc146818rtc_info = {
     .qdev.name     = "mc146818rtc",
     .qdev.size     = sizeof(RTCState),
     .qdev.no_user  = 1,
+    .qdev.vmsd     = &vmstate_rtc,
     .init          = rtc_initfn,
     .qdev.props    = (Property[]) {
         DEFINE_PROP_INT32("base_year", RTCState, base_year, 1980),