mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
qom: add generic string parsing/printing
Add generic property accessors that take a string and parse it appropriately for the property type. All the magic here is done by the new string-based visitors. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
@@ -729,6 +729,30 @@ int64_t object_property_get_int(Object *obj, const char *name,
|
||||
void object_property_set(Object *obj, struct Visitor *v, const char *name,
|
||||
struct Error **errp);
|
||||
|
||||
/**
|
||||
* object_property_parse:
|
||||
* @obj: the object
|
||||
* @string: the string that will be used to parse the property value.
|
||||
* @name: the name of the property
|
||||
* @errp: returns an error if this function fails
|
||||
*
|
||||
* Parses a string and writes the result into a property of an object.
|
||||
*/
|
||||
void object_property_parse(Object *obj, const char *string,
|
||||
const char *name, struct Error **errp);
|
||||
|
||||
/**
|
||||
* object_property_print:
|
||||
* @obj: the object
|
||||
* @name: the name of the property
|
||||
* @errp: returns an error if this function fails
|
||||
*
|
||||
* Returns a string representation of the value of the property. The
|
||||
* caller shall free the string.
|
||||
*/
|
||||
char *object_property_print(Object *obj, const char *name,
|
||||
struct Error **errp);
|
||||
|
||||
/**
|
||||
* object_property_get_type:
|
||||
* @obj: the object
|
||||
|
||||
Reference in New Issue
Block a user