diff options
author | Hu Tao <hutao@cn.fujitsu.com> | 2014-05-14 17:43:33 +0800 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2014-06-19 18:44:19 +0300 |
commit | 1f21772db0b14049b1b4bfef1f039b40827c676f (patch) | |
tree | cb541c9259741222117f2830ef300922e720b511 /include/qom | |
parent | 7f8f9ef1dac25e76706ee0454bb6cfa097489170 (diff) | |
download | qemu-1f21772db0b14049b1b4bfef1f039b40827c676f.zip qemu-1f21772db0b14049b1b4bfef1f039b40827c676f.tar.gz qemu-1f21772db0b14049b1b4bfef1f039b40827c676f.tar.bz2 |
qom: introduce object_property_get_enum and object_property_get_uint16List
Signed-off-by: Hu Tao <hutao@cn.fujitsu.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Diffstat (limited to 'include/qom')
-rw-r--r-- | include/qom/object.h | 28 |
1 files changed, 28 insertions, 0 deletions
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 |