mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 07:13:54 -06:00
qdev: integrate vmstate
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
f82de8f08a
commit
391a079edb
2 changed files with 9 additions and 0 deletions
|
@ -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);
|
||||
|
|
|
@ -111,6 +111,9 @@ struct DeviceInfo {
|
|||
/* callbacks */
|
||||
QEMUResetHandler *reset;
|
||||
|
||||
/* device state */
|
||||
const VMStateDescription *vmsd;
|
||||
|
||||
/* Private to qdev / bus. */
|
||||
qdev_initfn init;
|
||||
BusInfo *bus_info;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue