From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Mark Cave-Ayland <mark.caveayland@nutanix.com>
Cc: palmer@dabbelt.com, alistair.francis@wdc.com,
liwei1518@gmail.com, daniel.barboza@oss.qualcomm.com,
zhiwei_liu@linux.alibaba.com, chao.liu@processmission.com,
pbonzini@redhat.com, qemu-riscv@nongnu.org,
qemu-devel@nongnu.org
Subject: Re: [PATCH 5/5] qom/object.c: rename object_class_property_uint*_ptr() to object_class_static_property_uint*_ptr()
Date: Fri, 17 Jul 2026 13:32:23 +0100 [thread overview]
Message-ID: <alog1_vFOi0agPww@redhat.com> (raw)
In-Reply-To: <20260717112022.444367-6-mark.caveayland@nutanix.com>
On Fri, Jul 17, 2026 at 12:19:12PM +0100, Mark Cave-Ayland wrote:
> This more accurately reflects that these properties are held within the class and
> not the object.
>
> Signed-off-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>
> ---
> include/qom/object.h | 32 ++++++++++++++++----------------
> hw/riscv/spike.c | 5 +++--
> qom/object.c | 28 ++++++++++++++++------------
> 3 files changed, 35 insertions(+), 30 deletions(-)
>
> diff --git a/include/qom/object.h b/include/qom/object.h
> index 95fdf01e30..9df02de93b 100644
> --- a/include/qom/object.h
> +++ b/include/qom/object.h
> @@ -2038,18 +2038,18 @@ ObjectProperty *object_property_add_uint8_ptr(Object *obj, const char *name,
> ObjectPropertyFlags flags);
>
> /**
> - * object_class_property_add_uint8_ptr:
> - * @klass: the object class to add a property to
> + * object_class_static_property_add_uint8_ptr:
> + * @klass: the object class to add a static property to
> * @name: the name of the property
> * @v: pointer to value
> * @flags: bitwise-or'd ObjectPropertyFlags
> *
> - * Add an integer property in memory. This function will add a
> + * Add a static integer property in memory. This function will add a
> * property of type 'uint8'.
> *
Can we add a bit boiler guidance here, something like
"A static property is one which is stored outside of
the object instance, typically in global variables.
It is only appropropriate to use static properties
when the class is designed as a singleton. If there
is a possibility of multiple instances, then properties
must be stored per-instance."
> * Returns: The newly added property on success, or %NULL on failure.
> */
> -ObjectProperty *object_class_property_add_uint8_ptr(ObjectClass *klass,
> +ObjectProperty *object_class_static_property_add_uint8_ptr(ObjectClass *klass,
> const char *name,
> const uint8_t *v,
> ObjectPropertyFlags flags);
> @@ -2071,18 +2071,18 @@ ObjectProperty *object_property_add_uint16_ptr(Object *obj, const char *name,
> ObjectPropertyFlags flags);
>
> /**
> - * object_class_property_add_uint16_ptr:
> - * @klass: the object class to add a property to
> + * object_class_static_property_add_uint16_ptr:
> + * @klass: the object class to add a static property to
> * @name: the name of the property
> * @v: pointer to value
> * @flags: bitwise-or'd ObjectPropertyFlags
> *
> - * Add an integer property in memory. This function will add a
> + * Add a static integer property in memory. This function will add a
> * property of type 'uint16'.
> *
> * Returns: The newly added property on success, or %NULL on failure.
> */
> -ObjectProperty *object_class_property_add_uint16_ptr(ObjectClass *klass,
> +ObjectProperty *object_class_static_property_add_uint16_ptr(ObjectClass *klass,
> const char *name,
> const uint16_t *v,
> ObjectPropertyFlags flags);
> @@ -2104,18 +2104,18 @@ ObjectProperty *object_property_add_uint32_ptr(Object *obj, const char *name,
> ObjectPropertyFlags flags);
>
> /**
> - * object_class_property_add_uint32_ptr:
> - * @klass: the object class to add a property to
> + * object_class_static_property_add_uint32_ptr:
> + * @klass: the object class to add a static property to
> * @name: the name of the property
> * @v: pointer to value
> * @flags: bitwise-or'd ObjectPropertyFlags
> *
> - * Add an integer property in memory. This function will add a
> + * Add a static integer property in memory. This function will add a
> * property of type 'uint32'.
> *
> * Returns: The newly added property on success, or %NULL on failure.
> */
> -ObjectProperty *object_class_property_add_uint32_ptr(ObjectClass *klass,
> +ObjectProperty *object_class_static_property_add_uint32_ptr(ObjectClass *klass,
> const char *name,
> const uint32_t *v,
> ObjectPropertyFlags flags);
> @@ -2137,18 +2137,18 @@ ObjectProperty *object_property_add_uint64_ptr(Object *obj, const char *name,
> ObjectPropertyFlags flags);
>
> /**
> - * object_class_property_add_uint64_ptr:
> - * @klass: the object class to add a property to
> + * object_class_static_property_add_uint64_ptr:
> + * @klass: the object class to add a static property to
> * @name: the name of the property
> * @v: pointer to value
> * @flags: bitwise-or'd ObjectPropertyFlags
> *
> - * Add an integer property in memory. This function will add a
> + * Add a static integer property in memory. This function will add a
> * property of type 'uint64'.
> *
> * Returns: The newly added property on success, or %NULL on failure.
> */
> -ObjectProperty *object_class_property_add_uint64_ptr(ObjectClass *klass,
> +ObjectProperty *object_class_static_property_add_uint64_ptr(ObjectClass *klass,
> const char *name,
> const uint64_t *v,
> ObjectPropertyFlags flags);
> diff --git a/hw/riscv/spike.c b/hw/riscv/spike.c
> index 9fde0faf39..630b65f569 100644
> --- a/hw/riscv/spike.c
> +++ b/hw/riscv/spike.c
> @@ -278,8 +278,9 @@ static void spike_machine_class_init(ObjectClass *oc, const void *data)
> object_class_property_add_str(oc, "signature", NULL, spike_set_signature);
> object_class_property_set_description(oc, "signature",
> "File to write ACT test signature");
> - object_class_property_add_uint8_ptr(oc, "signature-granularity",
> - &line_size, OBJ_PROP_FLAG_WRITE);
> + object_class_static_property_add_uint8_ptr(oc, "signature-granularity",
> + &line_size,
> + OBJ_PROP_FLAG_WRITE);
> object_class_property_set_description(oc, "signature-granularity",
> "Size of each line in ACT signature "
> "file");
> diff --git a/qom/object.c b/qom/object.c
> index 622840f9f8..47977b1f44 100644
> --- a/qom/object.c
> +++ b/qom/object.c
> @@ -2724,9 +2724,10 @@ object_property_add_uint8_ptr(Object *obj, const char *name,
> }
>
> ObjectProperty *
> -object_class_property_add_uint8_ptr(ObjectClass *klass, const char *name,
> - const uint8_t *v,
> - ObjectPropertyFlags flags)
> +object_class_static_property_add_uint8_ptr(ObjectClass *klass,
> + const char *name,
> + const uint8_t *v,
> + ObjectPropertyFlags flags)
> {
> ObjectPropertyAccessor *getter = NULL;
> ObjectPropertyAccessor *setter = NULL;
> @@ -2764,9 +2765,10 @@ object_property_add_uint16_ptr(Object *obj, const char *name,
> }
>
> ObjectProperty *
> -object_class_property_add_uint16_ptr(ObjectClass *klass, const char *name,
> - const uint16_t *v,
> - ObjectPropertyFlags flags)
> +object_class_static_property_add_uint16_ptr(ObjectClass *klass,
> + const char *name,
> + const uint16_t *v,
> + ObjectPropertyFlags flags)
> {
> ObjectPropertyAccessor *getter = NULL;
> ObjectPropertyAccessor *setter = NULL;
> @@ -2804,9 +2806,10 @@ object_property_add_uint32_ptr(Object *obj, const char *name,
> }
>
> ObjectProperty *
> -object_class_property_add_uint32_ptr(ObjectClass *klass, const char *name,
> - const uint32_t *v,
> - ObjectPropertyFlags flags)
> +object_class_static_property_add_uint32_ptr(ObjectClass *klass,
> + const char *name,
> + const uint32_t *v,
> + ObjectPropertyFlags flags)
> {
> ObjectPropertyAccessor *getter = NULL;
> ObjectPropertyAccessor *setter = NULL;
> @@ -2844,9 +2847,10 @@ object_property_add_uint64_ptr(Object *obj, const char *name,
> }
>
> ObjectProperty *
> -object_class_property_add_uint64_ptr(ObjectClass *klass, const char *name,
> - const uint64_t *v,
> - ObjectPropertyFlags flags)
> +object_class_static_property_add_uint64_ptr(ObjectClass *klass,
> + const char *name,
> + const uint64_t *v,
> + ObjectPropertyFlags flags)
> {
> ObjectPropertyAccessor *getter = NULL;
> ObjectPropertyAccessor *setter = NULL;
> --
> 2.43.0
>
With regards,
Daniel
--
|: https://berrange.com ~~ https://hachyderm.io/@berrange :|
|: https://libvirt.org ~~ https://entangle-photo.org :|
|: https://pixelfed.art/berrange ~~ https://fstop138.berrange.com :|
next prev parent reply other threads:[~2026-07-17 12:33 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-17 11:19 [PATCH 0/5] qom: tidy-ups and preparation for class property conversion Mark Cave-Ayland
2026-07-17 11:19 ` [PATCH 1/5] qom/object.c: introduce OBJECT_PROPERTY_SCALAR_GETTER(type) macro Mark Cave-Ayland
2026-07-17 12:22 ` Daniel P. Berrangé
2026-07-17 11:19 ` [PATCH 2/5] qom/object.c: introduce OBJECT_PROPERTY_SCALAR_SETTER(type) macro Mark Cave-Ayland
2026-07-17 12:23 ` Daniel P. Berrangé
2026-07-17 11:19 ` [PATCH 3/5] qom/object.c: introduce DEFINE_OBJECT_PROPERTY_SCALAR_METHODS() macro Mark Cave-Ayland
2026-07-17 12:23 ` Daniel P. Berrangé
2026-07-17 11:19 ` [PATCH 4/5] qom/object.h: add missing documentation for object_class_* property functions Mark Cave-Ayland
2026-07-17 12:26 ` Daniel P. Berrangé
2026-07-17 12:56 ` Mark Cave-Ayland
2026-07-17 13:11 ` Daniel P. Berrangé
2026-07-17 11:19 ` [PATCH 5/5] qom/object.c: rename object_class_property_uint*_ptr() to object_class_static_property_uint*_ptr() Mark Cave-Ayland
2026-07-17 12:32 ` Daniel P. Berrangé [this message]
2026-07-17 12:58 ` Mark Cave-Ayland
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=alog1_vFOi0agPww@redhat.com \
--to=berrange@redhat.com \
--cc=alistair.francis@wdc.com \
--cc=chao.liu@processmission.com \
--cc=daniel.barboza@oss.qualcomm.com \
--cc=liwei1518@gmail.com \
--cc=mark.caveayland@nutanix.com \
--cc=palmer@dabbelt.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=zhiwei_liu@linux.alibaba.com \
/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.