From: "Daniel P. Berrangé" <berrange@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Daniel P. Berrangé" <berrange@redhat.com>,
"Mark Cave-Ayland" <mark.caveayland@nutanix.com>,
"Philippe Mathieu-Daudé" <philmd@oss.qualcomm.com>
Subject: [PULL 4/8] qom: deprecate use of instance level properties
Date: Fri, 16 Oct 2026 10:43:44 +0100 [thread overview]
Message-ID: <20261016094348.2616374-5-berrange@redhat.com> (raw)
In-Reply-To: <20261016094348.2616374-1-berrange@redhat.com>
Add API docs to object_property_(add/try_add/del) to recommend
use of class properties instead.
Reviewed-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
include/qom/object.h | 27 ++++++++++++++++++++++++---
1 file changed, 24 insertions(+), 3 deletions(-)
diff --git a/include/qom/object.h b/include/qom/object.h
index 4c0645817a5..90c1a34e49a 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -1171,6 +1171,16 @@ void object_unref(void *obj);
* @opaque: an opaque pointer to pass to the callbacks for the property
* @errp: pointer to error object
*
+ * Further use of this method is deprecated. Properties for an
+ * object should be statically declared against the class, and
+ * not be permitted to vary at runtime. Use the
+ * object_class_property_add() method (and its variants) instead.
+ *
+ * If usage scenarios require differing subsets of properties
+ * to be present, this should be handled by creating further
+ * specialized subclasses instead of dynamically registering
+ * properties against instances.
+ *
* Returns: The #ObjectProperty; this can be used to set the @resolve
* callback for child and link properties.
*/
@@ -1183,9 +1193,6 @@ 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
@@ -1202,6 +1209,12 @@ ObjectProperty *object_property_try_add(Object *obj, const char *name,
* 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
+ *
+ * Same as object_property_try_add() with @errp hardcoded to
+ * &error_abort.
+ *
+ * Further use of this method is deprecated, see
+ * object_property_try_add() for details.
*/
ObjectProperty *object_property_add(Object *obj, const char *name,
const char *type,
@@ -1210,6 +1223,14 @@ ObjectProperty *object_property_add(Object *obj, const char *name,
ObjectPropertyRelease *release,
void *opaque);
+/**
+ * object_property_del:
+ * @obj: the object to remove a property from
+ * @name: the property to be deleted
+ *
+ * Further use of this method is deprecated, see
+ * object_property_try_add() for details.
+ */
void object_property_del(Object *obj, const char *name);
ObjectProperty *object_class_property_add(ObjectClass *klass, const char *name,
--
2.56.0
next prev parent reply other threads:[~2026-10-16 9:44 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 9:43 [PULL 0/8] Misc fixes patches Daniel P. Berrangé
2026-10-16 9:43 ` [PULL 1/8] seccomp: really fix blocking of setns/execveat/unshare Daniel P. Berrangé
2026-10-16 9:43 ` [PULL 2/8] seccomp: drop redundant match for clone() flags == 0 Daniel P. Berrangé
2026-10-16 9:43 ` [PULL 3/8] qtest: fail fast when QEMU terminates early Daniel P. Berrangé
2026-10-16 9:43 ` Daniel P. Berrangé [this message]
2026-10-16 9:43 ` [PULL 5/8] Revert "migration: activate TLS thread safety workaround" Daniel P. Berrangé
2026-10-16 9:43 ` [PULL 6/8] Revert "io: add support for activating " Daniel P. Berrangé
2026-10-16 9:43 ` [PULL 7/8] Revert "crypto: add tracing & warning about GNUTLS countermeasures" Daniel P. Berrangé
2026-10-16 9:43 ` [PULL 8/8] Revert "crypto: implement workaround for GNUTLS thread safety problems" Daniel P. Berrangé
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=20261016094348.2616374-5-berrange@redhat.com \
--to=berrange@redhat.com \
--cc=mark.caveayland@nutanix.com \
--cc=philmd@oss.qualcomm.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.