From: Gerd Hoffmann Date: Tue, 1 Sep 2009 07:56:14 +0000 (+0200) Subject: qdev: integrate vmstate X-Git-Tag: TizenStudio_2.0_p2.3.2~208^2~10680 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=391a079edbecf047ec2c9e35b18ea4e2f3b6f52d;p=sdk%2Femulator%2Fqemu.git qdev: integrate vmstate Signed-off-by: Gerd Hoffmann Signed-off-by: Anthony Liguori --- diff --git a/hw/qdev.c b/hw/qdev.c index 675248f..6451b8a 100644 --- a/hw/qdev.c +++ b/hw/qdev.c @@ -221,12 +221,18 @@ int qdev_init(DeviceState *dev) return rc; if (dev->info->reset) qemu_register_reset(dev->info->reset, dev); + if (dev->info->vmsd) + vmstate_register(-1, dev->info->vmsd, dev); return 0; } /* Unlink device from bus and free the structure. */ void qdev_free(DeviceState *dev) { +#if 0 /* FIXME: need sane vmstate_unregister function */ + if (dev->info->vmsd) + vmstate_unregister(dev->info->vmsd, dev); +#endif if (dev->info->reset) qemu_unregister_reset(dev->info->reset, dev); LIST_REMOVE(dev, sibling); diff --git a/hw/qdev.h b/hw/qdev.h index b146aa1..6d0d7f4 100644 --- a/hw/qdev.h +++ b/hw/qdev.h @@ -111,6 +111,9 @@ struct DeviceInfo { /* callbacks */ QEMUResetHandler *reset; + /* device state */ + const VMStateDescription *vmsd; + /* Private to qdev / bus. */ qdev_initfn init; BusInfo *bus_info;