summaryrefslogtreecommitdiff
path: root/hw/qdev.h
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-12-12 14:29:31 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2011-12-15 09:20:48 -0600
commit3de1c3e82d06ac7fe789d912feb8876c0a8b270e (patch)
treed454680822a190b55b710aac509c5713643cd171 /hw/qdev.h
parentdc45c21f39f826e7ab4b8e86fc4d0c987fad3fb7 (diff)
downloadqemu-3de1c3e82d06ac7fe789d912feb8876c0a8b270e.tar.gz
qom: add child properties (composition) (v3)
Child properties express a relationship of composition. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/qdev.h')
-rw-r--r--hw/qdev.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/hw/qdev.h b/hw/qdev.h
index 641d1341e5..38b36e8b91 100644
--- a/hw/qdev.h
+++ b/hw/qdev.h
@@ -527,4 +527,24 @@ gchar *qdev_get_canonical_path(DeviceState *dev);
*/
DeviceState *qdev_resolve_path(const char *path, bool *ambiguous);
+/**
+ * @qdev_property_add_child - Add a child property to a device
+ *
+ * Child properties form the composition tree. All devices need to be a child
+ * of another device. Devices can only be a child of one device.
+ *
+ * There is no way for a child to determine what its parent is. It is not
+ * a bidirectional relationship. This is by design.
+ *
+ * @dev - the device to add a property to
+ *
+ * @name - the name of the property
+ *
+ * @child - the child device
+ *
+ * @errp - if an error occurs, a pointer to an area to store the area
+ */
+void qdev_property_add_child(DeviceState *dev, const char *name,
+ DeviceState *child, Error **errp);
+
#endif