diff mbox series

[03/18] hw/core/qdev: Add vmstate_qdev_no_state_to_migrate

Message ID 20200703201911.26573-4-f4bug@amsat.org
State New
Headers show
Series [01/18] migration/vmstate: Document vmstate_dummy | expand

Commit Message

Philippe Mathieu-Daudé July 3, 2020, 8:18 p.m. UTC
Add vmstate_qdev_no_state_to_migrate, which is simply a
pointer to vmstate_no_state_to_migrate. This way all
qdev devices (including "hw/qdev-core.h") don't have to
include "migration/vmstate.h".

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 include/hw/qdev-core.h | 2 ++
 hw/core/qdev.c         | 3 +++
 2 files changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h
index fe78073c70..2e4ddfd75f 100644
--- a/include/hw/qdev-core.h
+++ b/include/hw/qdev-core.h
@@ -139,6 +139,8 @@  typedef struct DeviceClass {
     const char *bus_type;
 } DeviceClass;
 
+extern const VMStateDescription *vmstate_qdev_no_state_to_migrate;
+
 typedef struct NamedGPIOList NamedGPIOList;
 
 struct NamedGPIOList {
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index 2131c7f951..0d18bc6d93 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -45,6 +45,9 @@  bool qdev_hotplug = false;
 static bool qdev_hot_added = false;
 bool qdev_hot_removed = false;
 
+const VMStateDescription *vmstate_qdev_no_state_to_migrate =
+        &vmstate_no_state_to_migrate;
+
 const VMStateDescription *qdev_get_vmsd(DeviceState *dev)
 {
     DeviceClass *dc = DEVICE_GET_CLASS(dev);