From 1f21772db0b14049b1b4bfef1f039b40827c676f Mon Sep 17 00:00:00 2001 From: Hu Tao Date: Wed, 14 May 2014 17:43:33 +0800 Subject: qom: introduce object_property_get_enum and object_property_get_uint16List Signed-off-by: Hu Tao Acked-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/qom/object.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'include/qom') diff --git a/include/qom/object.h b/include/qom/object.h index a641dcd..b882ccc 100644 --- a/include/qom/object.h +++ b/include/qom/object.h @@ -917,6 +917,34 @@ int64_t object_property_get_int(Object *obj, const char *name, Error **errp); /** + * object_property_get_enum: + * @obj: the object + * @name: the name of the property + * @strings: strings corresponding to enums + * @errp: returns an error if this function fails + * + * Returns: the value of the property, converted to an integer, or + * undefined if an error occurs (including when the property value is not + * an enum). + */ +int object_property_get_enum(Object *obj, const char *name, + const char *strings[], Error **errp); + +/** + * object_property_get_uint16List: + * @obj: the object + * @name: the name of the property + * @list: the returned int list + * @errp: returns an error if this function fails + * + * Returns: the value of the property, converted to integers, or + * undefined if an error occurs (including when the property value is not + * an list of integers). + */ +void object_property_get_uint16List(Object *obj, const char *name, + uint16List **list, Error **errp); + +/** * object_property_set: * @obj: the object * @v: the visitor that will be used to write the property value. This should -- cgit v1.1