aboutsummaryrefslogtreecommitdiff
path: root/hw/watchdog
diff options
context:
space:
mode:
authorXu Wang <gesaint@linux.vnet.ibm.com>2015-02-05 18:28:34 +0800
committerChristian Borntraeger <borntraeger@de.ibm.com>2015-06-11 17:45:49 +0200
commitd67f5fe63caa0f707fa91c760508c340e050b6f0 (patch)
treef6133465aa57e087795ca49bec7e9f9dda7c7cc9 /hw/watchdog
parent8fc639af4b62930671b6988c1f7eedf9e7c9f7bc (diff)
downloadqemu-d67f5fe63caa0f707fa91c760508c340e050b6f0.zip
qemu-d67f5fe63caa0f707fa91c760508c340e050b6f0.tar.gz
qemu-d67f5fe63caa0f707fa91c760508c340e050b6f0.tar.bz2
s390x/watchdog: diag288 migration support
Add vmstate structure to keep state and data during migration. Signed-off-by: Xu Wang <gesaint@linux.vnet.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'hw/watchdog')
-rw-r--r--hw/watchdog/wdt_diag288.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/hw/watchdog/wdt_diag288.c b/hw/watchdog/wdt_diag288.c
index 351b5a8..1185e06 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);
@@ -90,6 +101,7 @@ static void wdt_diag288_class_init(ObjectClass *klass, void *data)
dc->unrealize = wdt_diag288_unrealize;
dc->reset = wdt_diag288_reset;
set_bit(DEVICE_CATEGORY_MISC, dc->categories);
+ dc->vmsd = &vmstate_diag288;
diag288->handle_timer = wdt_diag288_handle_timer;
}