aboutsummaryrefslogtreecommitdiff
path: root/hw/core
diff options
context:
space:
mode:
authorZhu Guihua <zhugh.fnst@cn.fujitsu.com>2014-10-21 19:46:04 +0800
committerLuiz Capitulino <lcapitulino@redhat.com>2014-10-23 09:02:51 -0400
commit66e56b13ad432cdb51b3319476fbb4746af5770b (patch)
tree65ef11d19ee31ded25bf95b4a631c79fe7c9b087 /hw/core
parentf3582ba41c22bfa39fae0c771d943e8c28a7936c (diff)
qdev: add qdev_build_hotpluggable_device_list helper
For peripheral device del completion, add a function to build a list for hotpluggable devices. Signed-off-by: Zhu Guihua <zhugh.fnst@cn.fujitsu.com> Reviewed-by: Marcel Apfelbaum <marcel.a@redhat.com> Reviewed-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Diffstat (limited to 'hw/core')
-rw-r--r--hw/core/qdev.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/hw/core/qdev.c b/hw/core/qdev.c
index a1e9247772..9357aba455 100644
--- a/hw/core/qdev.c
+++ b/hw/core/qdev.c
@@ -866,6 +866,19 @@ 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)
+{
+ GSList **list = opaque;
+ DeviceState *dev = DEVICE(obj);
+
+ if (dev->realized && object_property_get_bool(obj, "hotpluggable", NULL)) {
+ *list = g_slist_append(*list, dev);
+ }
+
+ object_child_foreach(obj, qdev_build_hotpluggable_device_list, opaque);
+ return 0;
+}
+
static bool device_get_realized(Object *obj, Error **errp)
{
DeviceState *dev = DEVICE(obj);