diff options
Diffstat (limited to 'hw/core/qdev.c')
| -rw-r--r-- | hw/core/qdev.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/hw/core/qdev.c b/hw/core/qdev.c index 413b41376f..901f289860 100644 --- a/hw/core/qdev.c +++ b/hw/core/qdev.c @@ -935,7 +935,7 @@ void qdev_alias_all_properties(DeviceState *target, Object *source) } while (class != object_class_by_name(TYPE_DEVICE)); } -int qdev_build_hotpluggable_device_list(Object *obj, void *opaque) +static int qdev_add_hotpluggable_device(Object *obj, void *opaque) { GSList **list = opaque; DeviceState *dev = DEVICE(obj); @@ -944,10 +944,18 @@ int qdev_build_hotpluggable_device_list(Object *obj, void *opaque) *list = g_slist_append(*list, dev); } - object_child_foreach(obj, qdev_build_hotpluggable_device_list, opaque); return 0; } +GSList *qdev_build_hotpluggable_device_list(Object *peripheral) +{ + GSList *list = NULL; + + object_child_foreach(peripheral, qdev_add_hotpluggable_device, &list); + + return list; +} + static bool device_get_realized(Object *obj, Error **errp) { DeviceState *dev = DEVICE(obj); @@ -1133,9 +1141,7 @@ static void device_finalize(Object *obj) NamedGPIOList *ngl, *next; DeviceState *dev = DEVICE(obj); - if (dev->opts) { - qemu_opts_del(dev->opts); - } + qemu_opts_del(dev->opts); QLIST_FOREACH_SAFE(ngl, &dev->gpios, node, next) { QLIST_REMOVE(ngl, node); |