From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Mark Cave-Ayland <mark.caveayland@nutanix.com>
Cc: mst@redhat.com, imammedo@redhat.com, anisinha@redhat.com,
philmd@mailo.com, aurelien@aurel32.net, peter.maydell@linaro.org,
pbonzini@redhat.com, richard.henderson@linaro.org,
qemu-devel@nongnu.org, qemu-arm@nongnu.org
Subject: Re: [PATCH v2 01/12] qom/object.c: rename object_class_property_uint*_ptr() to object_class_static_property_uint*_ptr()
Date: Tue, 7 Jul 2026 14:19:51 +0100 [thread overview]
Message-ID: <akz897Y2c4cs_XBM@redhat.com> (raw)
In-Reply-To: <40fcfa42-ff8a-49a7-bc69-6a3c2ae03e38@nutanix.com>
On Tue, Jul 07, 2026 at 02:08:25PM +0100, Mark Cave-Ayland wrote:
> On 07/07/2026 13:05, Daniel P. Berrangé wrote:
>
> > On Fri, Jul 03, 2026 at 02:53:03PM +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 | 8 ++++----
> > > hw/riscv/spike.c | 5 +++--
> > > qom/object.c | 28 ++++++++++++++++------------
> > > 3 files changed, 23 insertions(+), 18 deletions(-)
> > >
> > > diff --git a/include/qom/object.h b/include/qom/object.h
> > > index 11f55613fc..89c23d45ab 100644
> > > --- a/include/qom/object.h
> > > +++ b/include/qom/object.h
> > > @@ -1956,7 +1956,7 @@ ObjectProperty *object_property_add_uint8_ptr(Object *obj, const char *name,
> > > const uint8_t *v,
> > > ObjectPropertyFlags flags);
> > > -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);
> > > @@ -1977,7 +1977,7 @@ ObjectProperty *object_property_add_uint16_ptr(Object *obj, const char *name,
> > > const uint16_t *v,
> > > ObjectPropertyFlags flags);
> > > -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);
> > > @@ -1998,7 +1998,7 @@ ObjectProperty *object_property_add_uint32_ptr(Object *obj, const char *name,
> > > const uint32_t *v,
> > > ObjectPropertyFlags flags);
> > > -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);
> > > @@ -2019,7 +2019,7 @@ ObjectProperty *object_property_add_uint64_ptr(Object *obj, const char *name,
> > > const uint64_t *v,
> > > ObjectPropertyFlags flags);
> > > -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);
> >
> > When we have just one use of these "static property" API in the code base,
> > I wonder if we genuinely need these APIs ?
>
> There are actually more uses in hw/acpi later on in the series: see patches
> 7, 9 and 12.
Ok, I missed that, only looking an existnig code.
> > I wonder why "line_size" isn't merely a field in the machine class ?
> > External code ought to be able to fetch the current machine and read
> > a line_size struct field, surely ?
>
> It certainly looks odd from here: one of things I wanted to discuss on the
> call was how to approach the conversion.
>
> My current thinking is that the aim should be simply to convert everything
> as-is, and avoid attempting any refactorings or converting to a device class
> prop via device_class_set_props() if possible. Otherwise anyone attempting
> conversions will get stuck in the details of the individual devices, which I
> would argue is more the remit of maintainers.
Yeah, ok, that is probably a wise approach to minimizing complexity.
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-07 13:20 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-03 13:53 [PATCH v2 00/12] hw/acpi: convert object props to class props Mark Cave-Ayland
2026-07-03 13:53 ` [PATCH v2 01/12] qom/object.c: rename object_class_property_uint*_ptr() to object_class_static_property_uint*_ptr() Mark Cave-Ayland
2026-07-07 12:05 ` Daniel P. Berrangé
2026-07-07 13:08 ` Mark Cave-Ayland
2026-07-07 13:19 ` Daniel P. Berrangé [this message]
2026-07-07 14:19 ` Peter Maydell
2026-07-08 9:24 ` Mark Cave-Ayland
2026-07-03 13:53 ` [PATCH v2 02/12] qom/object.c: add object_class_property_add_uint8_ptr() Mark Cave-Ayland
2026-07-07 12:17 ` Daniel P. Berrangé
2026-07-07 13:13 ` Mark Cave-Ayland
2026-07-07 13:20 ` Daniel P. Berrangé
2026-07-03 13:53 ` [PATCH v2 03/12] qom/object.c: add object_class_property_add_uint16_ptr() Mark Cave-Ayland
2026-07-03 13:53 ` [PATCH v2 04/12] qom/object.c: add object_class_property_add_uint32_ptr() Mark Cave-Ayland
2026-07-03 13:53 ` [PATCH v2 05/12] qom/object.c: add object_class_property_add_uint64_ptr() Mark Cave-Ayland
2026-07-03 13:53 ` [PATCH v2 06/12] hw/acpi/ich9.c: move initial property values into ich9_reset_properties() Mark Cave-Ayland
2026-07-06 7:06 ` Philippe Mathieu-Daudé
2026-07-03 13:53 ` [PATCH v2 07/12] hw/isa/lpc_ich9.c: convert ich9_lpc_initfn() object props to class props Mark Cave-Ayland
2026-07-03 13:53 ` [PATCH v2 08/12] hw/acpi/ich9.c: don't pass ICH9LPCPMRegs via opaque for ACPI_PM_PROP_GPE0_BLK prop Mark Cave-Ayland
2026-07-06 7:07 ` Philippe Mathieu-Daudé
2026-07-03 13:53 ` [PATCH v2 09/12] hw/acpi/ich9.c: convert object props in ICH9_LPC_DEVICE to class props Mark Cave-Ayland
2026-07-03 13:53 ` [PATCH v2 10/12] hw/acpi/pcihp.c: convert ACPI_PCIHP_IO_BASE_PROP and ACPI_PCIHP_IO_BASE_PROP " Mark Cave-Ayland
2026-07-03 13:53 ` [PATCH v2 11/12] hw/acpi/pcihp.c: convert ACPI_PCIHP_PROP_BSEL from object prop to class prop Mark Cave-Ayland
2026-07-03 13:53 ` [PATCH v2 12/12] hw/acpi/piix4.c: convert object props in PIIX4_PM to class props 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=akz897Y2c4cs_XBM@redhat.com \
--to=berrange@redhat.com \
--cc=anisinha@redhat.com \
--cc=aurelien@aurel32.net \
--cc=imammedo@redhat.com \
--cc=mark.caveayland@nutanix.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@mailo.com \
--cc=qemu-arm@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.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.