mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
qom: add string property type
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
ad6d45fa08
commit
6a146eba33
2 changed files with 81 additions and 0 deletions
22
hw/qdev.h
22
hw/qdev.h
|
@ -574,4 +574,26 @@ void qdev_property_add_link(DeviceState *dev, const char *name,
|
|||
const char *type, DeviceState **child,
|
||||
Error **errp);
|
||||
|
||||
/**
|
||||
* @qdev_property_add_str
|
||||
*
|
||||
* Add a string property using getters/setters. This function will add a
|
||||
* property of type 'string'.
|
||||
*
|
||||
* @dev - the device to add a property to
|
||||
*
|
||||
* @name - the name of the property
|
||||
*
|
||||
* @get - the getter or NULL if the property is write-only. This function must
|
||||
* return a string to be freed by @g_free().
|
||||
*
|
||||
* @set - the setter or NULL if the property is read-only
|
||||
*
|
||||
* @errp - if an error occurs, a pointer to an area to store the error
|
||||
*/
|
||||
void qdev_property_add_str(DeviceState *dev, const char *name,
|
||||
char *(*get)(DeviceState *, Error **),
|
||||
void (*set)(DeviceState *, const char *, Error **),
|
||||
Error **errp);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue