@samitouri / QOSamiQemu / commits / 478542dd83

qom/object.h: add missing documentation for object_class_* property functions

This is so that the object_class_* property functions appear in the generated QOM documentation at devel/qom-api.html. Signed-off-by: Mark Cave-Ayland <mark.caveayland@nutanix.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Message-Id: <20260717135254.508701-6-mark.caveayland@nutanix.com>

Mark Cave-Ayland committed Jul 17, 2026 at 14:51 UTC 478542dd83ad805e1f7c9676a91541bf4aa9fd5d
1 file changed +136
include/qom/object.h
+136
@@ -1818,6 +1818,33 @@ ObjectProperty *object_property_add_link(Object *obj, const char *name,
1818 Object *val, Error **errp),
1819 ObjectPropertyLinkFlags flags);
1820
1821 +/**
1822 + * object_class_property_add_link:
1823 + * @oc: the object class to add a property to
1824 + * @name: the name of the property
1825 + * @type: the qobj type of the link
1826 + * @offset: the offset from the object instance where the link object reference
1827 + * is stored
1828 + * @check: callback to veto setting or NULL if the property is read-only
1829 + * @flags: additional options for the link
1830 + *
1831 + * Links establish relationships between objects. Links are unidirectional
1832 + * although two links can be combined to form a bidirectional relationship
1833 + * between objects.
1834 + *
1835 + * Links form the graph in the object model.
1836 + *
1837 + * The @check() callback is invoked when object_property_set_link() is called
1838 + * and can raise an error to prevent the link being set. If @check is NULL, the
1839 + * property is read-only and cannot be set. Care must be taken to handle NULL
1840 + * values for @val.
1841 + *
1842 + * If the @flags %OBJ_PROP_LINK_STRONG bit is set, the reference count of the
1843 + * linked object is incremented when the property is set, and decremented again
1844 + * when the property is modified.
1845 + *
1846 + * Returns: The newly added property on success, or %NULL on failure.
1847 + */
1848 ObjectProperty *object_class_property_add_link(ObjectClass *oc,
1849 const char *name,
1850 const char *type, ptrdiff_t offset,
@@ -1859,6 +1886,19 @@ ObjectProperty *object_property_add_str(Object *obj, const char *name,
1886 char *(*get)(Object *, Error **),
1887 void (*set)(Object *, const char *, Error **));
1888
1889 +/**
1890 + * object_class_property_add_str:
1891 + * @klass: the object class to add a property to
1892 + * @name: the name of the property
1893 + * @get: the getter or NULL if the property is write-only. This function must
1894 + * return a string to be freed by g_free().
1895 + * @set: the setter or NULL if the property is read-only
1896 + *
1897 + * Add a string property using getters/setters. This function will add a
1898 + * property of type 'string'.
1899 + *
1900 + * Returns: The newly added property on success, or %NULL on failure.
1901 + */
1902 ObjectProperty *object_class_property_add_str(ObjectClass *klass,
1903 const char *name,
1904 char *(*get)(Object *, Error **),
@@ -1881,6 +1921,18 @@ ObjectProperty *object_property_add_bool(Object *obj, const char *name,
1921 bool (*get)(Object *, Error **),
1922 void (*set)(Object *, bool, Error **));
1923
1924 +/**
1925 + * object_class_property_add_bool:
1926 + * @klass: the object class to add a property to
1927 + * @name: the name of the property
1928 + * @get: the getter or NULL if the property is write-only.
1929 + * @set: the setter or NULL if the property is read-only
1930 + *
1931 + * Add a bool property using getters/setters. This function will add a
1932 + * property of type 'bool'.
1933 + *
1934 + * Returns: The newly added property on success, or %NULL on failure.
1935 + */
1936 ObjectProperty *object_class_property_add_bool(ObjectClass *klass,
1937 const char *name,
1938 bool (*get)(Object *, Error **),
@@ -1906,6 +1958,20 @@ ObjectProperty *object_property_add_enum(Object *obj, const char *name,
1958 int (*get)(Object *, Error **),
1959 void (*set)(Object *, int, Error **));
1960
1961 +/**
1962 + * object_class_property_add_enum:
1963 + * @klass: the object class to add a property to
1964 + * @name: the name of the property
1965 + * @typename: the name of the enum data type
1966 + * @lookup: enum value namelookup table
1967 + * @get: the getter or %NULL if the property is write-only.
1968 + * @set: the setter or %NULL if the property is read-only
1969 + *
1970 + * Add an enum property using getters/setters. This function will add a
1971 + * property of type '@typename'.
1972 + *
1973 + * Returns: The newly added property on success, or %NULL on failure.
1974 + */
1975 ObjectProperty *object_class_property_add_enum(ObjectClass *klass,
1976 const char *name,
1977 const char *typename,
@@ -1927,6 +1993,17 @@ ObjectProperty *object_class_property_add_enum(ObjectClass *klass,
1993 ObjectProperty *object_property_add_tm(Object *obj, const char *name,
1994 void (*get)(Object *, struct tm *, Error **));
1995
1996 +/**
1997 + * object_class_property_add_tm:
1998 + * @klass: the object class to add a property to
1999 + * @name: the name of the property
2000 + * @get: the getter or NULL if the property is write-only.
2001 + *
2002 + * Add a read-only struct tm valued property using a getter function.
2003 + * This function will add a property of type 'struct tm'.
2004 + *
2005 + * Returns: The newly added property on success, or %NULL on failure.
2006 + */
2007 ObjectProperty *object_class_property_add_tm(ObjectClass *klass,
2008 const char *name,
2009 void (*get)(Object *, struct tm *, Error **));
@@ -1956,6 +2033,18 @@ ObjectProperty *object_property_add_uint8_ptr(Object *obj, const char *name,
2033 const uint8_t *v,
2034 ObjectPropertyFlags flags);
2035
2036 +/**
2037 + * object_class_property_add_uint8_ptr:
2038 + * @klass: the object class to add a property to
2039 + * @name: the name of the property
2040 + * @v: pointer to value
2041 + * @flags: bitwise-or'd ObjectPropertyFlags
2042 + *
2043 + * Add an integer property in memory. This function will add a
2044 + * property of type 'uint8'.
2045 + *
2046 + * Returns: The newly added property on success, or %NULL on failure.
2047 + */
2048 ObjectProperty *object_class_property_add_uint8_ptr(ObjectClass *klass,
2049 const char *name,
2050 const uint8_t *v,
@@ -1977,6 +2066,18 @@ ObjectProperty *object_property_add_uint16_ptr(Object *obj, const char *name,
2066 const uint16_t *v,
2067 ObjectPropertyFlags flags);
2068
2069 +/**
2070 + * object_class_property_add_uint16_ptr:
2071 + * @klass: the object class to add a property to
2072 + * @name: the name of the property
2073 + * @v: pointer to value
2074 + * @flags: bitwise-or'd ObjectPropertyFlags
2075 + *
2076 + * Add an integer property in memory. This function will add a
2077 + * property of type 'uint16'.
2078 + *
2079 + * Returns: The newly added property on success, or %NULL on failure.
2080 + */
2081 ObjectProperty *object_class_property_add_uint16_ptr(ObjectClass *klass,
2082 const char *name,
2083 const uint16_t *v,
@@ -1998,6 +2099,18 @@ ObjectProperty *object_property_add_uint32_ptr(Object *obj, const char *name,
2099 const uint32_t *v,
2100 ObjectPropertyFlags flags);
2101
2102 +/**
2103 + * object_class_property_add_uint32_ptr:
2104 + * @klass: the object class to add a property to
2105 + * @name: the name of the property
2106 + * @v: pointer to value
2107 + * @flags: bitwise-or'd ObjectPropertyFlags
2108 + *
2109 + * Add an integer property in memory. This function will add a
2110 + * property of type 'uint32'.
2111 + *
2112 + * Returns: The newly added property on success, or %NULL on failure.
2113 + */
2114 ObjectProperty *object_class_property_add_uint32_ptr(ObjectClass *klass,
2115 const char *name,
2116 const uint32_t *v,
@@ -2019,6 +2132,18 @@ ObjectProperty *object_property_add_uint64_ptr(Object *obj, const char *name,
2132 const uint64_t *v,
2133 ObjectPropertyFlags flags);
2134
2135 +/**
2136 + * object_class_property_add_uint64_ptr:
2137 + * @klass: the object class to add a property to
2138 + * @name: the name of the property
2139 + * @v: pointer to value
2140 + * @flags: bitwise-or'd ObjectPropertyFlags
2141 + *
2142 + * Add an integer property in memory. This function will add a
2143 + * property of type 'uint64'.
2144 + *
2145 + * Returns: The newly added property on success, or %NULL on failure.
2146 + */
2147 ObjectProperty *object_class_property_add_uint64_ptr(ObjectClass *klass,
2148 const char *name,
2149 const uint64_t *v,
@@ -2075,6 +2200,17 @@ ObjectProperty *object_property_add_const_link(Object *obj, const char *name,
2200 */
2201 void object_property_set_description(Object *obj, const char *name,
2202 const char *description);
2203 +
2204 +/**
2205 + * object_class_property_set_description:
2206 + * @klass: the object class owning the property
2207 + * @name: the name of the property
2208 + * @description: the description of the property on the object
2209 + *
2210 + * Set an object property's description.
2211 + *
2212 + * Returns: %true on success, %false on failure.
2213 + */
2214 void object_class_property_set_description(ObjectClass *klass, const char *name,
2215 const char *description);
2216