mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
qom: add child properties (composition) (v3)
Child properties express a relationship of composition. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
dc45c21f39
commit
3de1c3e82d
2 changed files with 46 additions and 0 deletions
20
hw/qdev.h
20
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue