summaryrefslogtreecommitdiff
path: root/include/qom
diff options
context:
space:
mode:
authorGonglei <arei.gonglei@huawei.com>2014-10-07 14:33:21 +0800
committerAndreas Färber <afaerber@suse.de>2014-10-15 05:03:15 +0200
commit8074264203db3351a4017ea0371c2c5eeb86df82 (patch)
tree55ce63d7421b38fc40eade1084c1189a7b50b462 /include/qom
parent51b2e8c331c1e3de5463bd7fe13676c2a9ec52fe (diff)
downloadqemu-8074264203db3351a4017ea0371c2c5eeb86df82.zip
qom: Add description field in ObjectProperty struct
The descriptions can serve as documentation in the code, and they can be used to provide better help. Copy property descriptions when copying alias properties. Cc: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gonglei <arei.gonglei@huawei.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'include/qom')
-rw-r--r--include/qom/object.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/qom/object.h b/include/qom/object.h
index 8a05a81a99..89c3092967 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -338,6 +338,7 @@ typedef struct ObjectProperty
{
gchar *name;
gchar *type;
+ gchar *description;
ObjectPropertyAccessor *get;
ObjectPropertyAccessor *set;
ObjectPropertyResolve *resolve;
@@ -1275,6 +1276,19 @@ void object_property_add_alias(Object *obj, const char *name,
Error **errp);
/**
+ * object_property_set_description:
+ * @obj: the object owning the property
+ * @name: the name of the property
+ * @description: the description of the property on the object
+ * @errp: if an error occurs, a pointer to an area to store the error
+ *
+ * Set an object property's description.
+ *
+ */
+void object_property_set_description(Object *obj, const char *name,
+ const char *description, Error **errp);
+
+/**
* object_child_foreach:
* @obj: the object whose children will be navigated
* @fn: the iterator function to be called