From: Eduardo Habkost <ehabkost@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Eduardo Habkost" <ehabkost@redhat.com>,
"Peter Maydell" <peter.maydell@linaro.org>
Subject: [PATCH 1/9] qom: Document all function parameters in doc comments
Date: Thu, 10 Sep 2020 18:15:18 -0400 [thread overview]
Message-ID: <20200910221526.10041-2-ehabkost@redhat.com> (raw)
In-Reply-To: <20200910221526.10041-1-ehabkost@redhat.com>
kernel-doc requires all function parameters to be documented, so
document them all.
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
include/qom/object.h | 47 ++++++++++++++++++++++++++++++++++++++++++--
1 file changed, 45 insertions(+), 2 deletions(-)
diff --git a/include/qom/object.h b/include/qom/object.h
index 056f67ab3b..ad2b91ec6c 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -1176,6 +1176,11 @@ Object *object_dynamic_cast(Object *obj, const char *typename);
/**
* object_dynamic_cast_assert:
+ * @obj: The object to cast.
+ * @typename: The @typename to cast to.
+ * @file: Source code file where function was called
+ * @line: Source code line where function was called
+ * @func: Name of function where this function was called
*
* See object_dynamic_cast() for a description of the parameters of this
* function. The only difference in behavior is that this function asserts
@@ -1252,6 +1257,9 @@ type_init(do_qemu_init_ ## type_array)
* object_class_dynamic_cast_assert:
* @klass: The #ObjectClass to attempt to cast.
* @typename: The QOM typename of the class to cast to.
+ * @file: Source code file where function was called
+ * @line: Source code line where function was called
+ * @func: Name of function where this function was called
*
* See object_class_dynamic_cast() for a description of the parameters
* of this function. The only difference in behavior is that this function
@@ -1403,6 +1411,23 @@ ObjectProperty *object_property_try_add(Object *obj, const char *name,
* object_property_add:
* Same as object_property_try_add() with @errp hardcoded to
* &error_abort.
+ *
+ * @obj: the object to add a property to
+ * @name: the name of the property. This can contain any character except for
+ * a forward slash. In general, you should use hyphens '-' instead of
+ * underscores '_' when naming properties.
+ * @type: the type name of the property. This namespace is pretty loosely
+ * defined. Sub namespaces are constructed by using a prefix and then
+ * to angle brackets. For instance, the type 'virtio-net-pci' in the
+ * 'link' namespace would be 'link<virtio-net-pci>'.
+ * @get: The getter to be called to read a property. If this is NULL, then
+ * the property cannot be read.
+ * @set: the setter to be called to write a property. If this is NULL,
+ * then the property cannot be written.
+ * @release: called when the property is removed from the object. This is
+ * meant to allow a property to free its opaque upon object
+ * destruction. This may be NULL.
+ * @opaque: an opaque pointer to pass to the callbacks for the property
*/
ObjectProperty *object_property_add(Object *obj, const char *name,
const char *type,
@@ -1476,6 +1501,7 @@ typedef struct ObjectPropertyIterator {
/**
* object_property_iter_init:
+ * @iter: the iterator instance
* @obj: the object
*
* Initializes an iterator for traversing all properties
@@ -1504,6 +1530,7 @@ void object_property_iter_init(ObjectPropertyIterator *iter,
/**
* object_class_property_iter_init:
+ * @iter: the iterator instance
* @klass: the class
*
* Initializes an iterator for traversing all properties
@@ -1551,6 +1578,7 @@ bool object_property_get(Object *obj, const char *name, Visitor *v,
/**
* object_property_set_str:
+ * @obj: the object
* @name: the name of the property
* @value: the value to be written to the property
* @errp: returns an error if this function fails
@@ -1577,6 +1605,7 @@ char *object_property_get_str(Object *obj, const char *name,
/**
* object_property_set_link:
+ * @obj: the object
* @name: the name of the property
* @value: the value to be written to the property
* @errp: returns an error if this function fails
@@ -1607,6 +1636,7 @@ Object *object_property_get_link(Object *obj, const char *name,
/**
* object_property_set_bool:
+ * @obj: the object
* @name: the name of the property
* @value: the value to be written to the property
* @errp: returns an error if this function fails
@@ -1632,6 +1662,7 @@ bool object_property_get_bool(Object *obj, const char *name,
/**
* object_property_set_int:
+ * @obj: the object
* @name: the name of the property
* @value: the value to be written to the property
* @errp: returns an error if this function fails
@@ -1657,6 +1688,7 @@ int64_t object_property_get_int(Object *obj, const char *name,
/**
* object_property_set_uint:
+ * @obj: the object
* @name: the name of the property
* @value: the value to be written to the property
* @errp: returns an error if this function fails
@@ -1780,6 +1812,7 @@ Object *object_get_internal_root(void);
/**
* object_get_canonical_path_component:
+ * @obj: the object
*
* Returns: The final component in the object's canonical path. The canonical
* path is the path within the composition tree starting from the root.
@@ -1789,6 +1822,7 @@ const char *object_get_canonical_path_component(const Object *obj);
/**
* object_get_canonical_path:
+ * @obj: the object
*
* Returns: The canonical path for a object, newly allocated. This is
* the path within the composition tree starting from the root. Use
@@ -1878,6 +1912,10 @@ ObjectProperty *object_property_try_add_child(Object *obj, const char *name,
/**
* object_property_add_child:
+ * @obj: the object to add a property to
+ * @name: the name of the property
+ * @child: the child object
+ *
* Same as object_property_try_add_child() with @errp hardcoded to
* &error_abort
*/
@@ -1895,13 +1933,17 @@ typedef enum {
/**
* object_property_allow_set_link:
+ * @obj: the object to add a property to
+ * @name: the name of the property
+ * @child: the child object
+ * @errp: pointer to error object
*
* The default implementation of the object_property_add_link() check()
* callback function. It allows the link property to be set and never returns
* an error.
*/
-void object_property_allow_set_link(const Object *, const char *,
- Object *, Error **);
+void object_property_allow_set_link(const Object *obj, const char *name,
+ Object *child, Error **errp);
/**
* object_property_add_link:
@@ -1995,6 +2037,7 @@ ObjectProperty *object_class_property_add_bool(ObjectClass *klass,
* @obj: the object to add a property to
* @name: the name of the property
* @typename: the name of the enum data type
+ * @lookup: enum value namelookup table
* @get: the getter or %NULL if the property is write-only.
* @set: the setter or %NULL if the property is read-only
*
--
2.26.2
next prev parent reply other threads:[~2020-09-10 22:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-10 22:15 [PATCH 0/9] docs: Convert QOM documentation to kernel-doc + Sphinx Eduardo Habkost
2020-09-10 22:15 ` Eduardo Habkost [this message]
2020-09-10 22:15 ` [PATCH 2/9] qom: Use kernel-doc private/public tags in structs Eduardo Habkost
2020-09-10 22:15 ` [PATCH 3/9] qom: Use ``code`` Sphinx syntax where appropriate Eduardo Habkost
2020-09-10 22:15 ` [PATCH 4/9] qom: Add kernel-doc markup to introduction doc comment Eduardo Habkost
2020-09-10 22:15 ` [PATCH 5/9] qom: Reformat section titles using Sphinx syntax Eduardo Habkost
2020-09-10 22:15 ` [PATCH 6/9] qom: Indent existing code examples Eduardo Habkost
2020-09-10 22:15 ` [PATCH 7/9] qom: Add code block markup to all code blocks Eduardo Habkost
2020-09-10 22:15 ` [PATCH 8/9] docs: Create docs/devel/qom.rst Eduardo Habkost
2020-09-10 22:15 ` [PATCH 9/9] docs: Move object.h overview doc comment to qom.rst Eduardo Habkost
2020-09-11 0:23 ` fixup! " Eduardo Habkost
2020-09-22 9:38 ` [PATCH 0/9] docs: Convert QOM documentation to kernel-doc + Sphinx Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200910221526.10041-2-ehabkost@redhat.com \
--to=ehabkost@redhat.com \
--cc=berrange@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).