diff options
author | Anthony Liguori <aliguori@us.ibm.com> | 2011-12-12 14:29:32 -0600 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2011-12-15 09:20:48 -0600 |
commit | 83e94fb8d5167d08d19eb1a84d058d9cd350bae9 (patch) | |
tree | 7a45a0dbf146639a37cbebf220aea7068b85c9b4 /hw/qdev.h | |
parent | 3de1c3e82d06ac7fe789d912feb8876c0a8b270e (diff) |
qom: add link properties (v2)
Links represent an ephemeral relationship between devices. They are meant to
replace the qdev concept of busses by allowing more informal relationships
between devices.
Links are fairly limited in their usefulness without implementing QOM-style
subclassing and interfaces.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/qdev.h')
-rw-r--r-- | hw/qdev.h | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -547,4 +547,27 @@ DeviceState *qdev_resolve_path(const char *path, bool *ambiguous); void qdev_property_add_child(DeviceState *dev, const char *name, DeviceState *child, Error **errp); +/** + * @qdev_property_add_link - Add a link property to a device + * + * Links establish relationships between devices. Links are unidirectional + * although two links can be combined to form a bidirectional relationship + * between devices. + * + * Links form the graph in the device model. + * + * @dev - the device to add a property to + * + * @name - the name of the property + * + * @type - the qdev type of the link + * + * @child - a pointer to where the link device reference is stored + * + * @errp - if an error occurs, a pointer to an area to store the area + */ +void qdev_property_add_link(DeviceState *dev, const char *name, + const char *type, DeviceState **child, + Error **errp); + #endif |