For peripheral device del completion, add a function to build a list for devices.
Signed-off-by: Zhu Guihua <zhugh.f...@cn.fujitsu.com> --- hw/core/qdev.c | 13 +++++++++++++ include/hw/qdev-core.h | 2 ++ 2 files changed, 15 insertions(+) diff --git a/hw/core/qdev.c b/hw/core/qdev.c index fcb1638..041ac38 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -1074,6 +1074,19 @@ void device_reset(DeviceState *dev) } } +int device_built_list(Object *obj, void *opaque) +{ + GSList **list = opaque; + DeviceState *dev = DEVICE(obj); + + if (dev->realized) { + *list = g_slist_append(*list, dev); + } + + return 0; + +} + Object *qdev_get_machine(void) { static Object *dev; diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 178fee2..3c30837 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -348,6 +348,8 @@ void qdev_machine_init(void); */ void device_reset(DeviceState *dev); +int device_built_list(Object *obj, void *opaque); + const struct VMStateDescription *qdev_get_vmsd(DeviceState *dev); const char *qdev_fw_name(DeviceState *dev); -- 1.9.3