qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 4/6] watchdog: Add migration support to diag288 watc


From: Cornelia Huck
Subject: [Qemu-devel] [PATCH 4/6] watchdog: Add migration support to diag288 watchdog device
Date: Fri, 17 Apr 2015 09:52:39 +0200

From: Xu Wang <address@hidden>

Add vmstate structure to keep state and data during migration.

Signed-off-by: Xu Wang <address@hidden>
Reviewed-by: David Hildenbrand <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
 hw/watchdog/wdt_diag288.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/hw/watchdog/wdt_diag288.c b/hw/watchdog/wdt_diag288.c
index 81a0e30..d60431c 100644
--- a/hw/watchdog/wdt_diag288.c
+++ b/hw/watchdog/wdt_diag288.c
@@ -21,6 +21,17 @@ static WatchdogTimerModel model = {
     .wdt_description = "diag288 device for s390x platform",
 };
 
+static const VMStateDescription vmstate_diag288 = {
+    .name = "vmstate_diag288",
+    .version_id = 0,
+    .minimum_version_id = 0,
+    .fields = (VMStateField[]) {
+        VMSTATE_TIMER_PTR(timer, DIAG288State),
+        VMSTATE_BOOL(enabled, DIAG288State),
+        VMSTATE_END_OF_LIST()
+    }
+};
+
 static void wdt_diag288_reset(DeviceState *dev)
 {
     DIAG288State *diag288 = DIAG288(dev);
@@ -89,6 +100,7 @@ static void wdt_diag288_class_init(ObjectClass *klass, void 
*data)
     dc->realize = wdt_diag288_realize;
     dc->unrealize = wdt_diag288_unrealize;
     dc->reset = wdt_diag288_reset;
+    dc->vmsd = &vmstate_diag288;
     set_bit(DEVICE_CATEGORY_MISC, dc->categories);
     diag288->handle_timer = wdt_diag288_handle_timer;
 }
-- 
2.3.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]