[PATCH v2 0/6] qom: tidy-ups and preparation for class property conversion

Mark Cave-Ayland posted 6 patches 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260717135254.508701-1-mark.caveayland@nutanix.com
Maintainers: Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Weiwei Li <liwei1518@gmail.com>, Daniel Henrique Barboza <daniel.barboza@oss.qualcomm.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>, Chao Liu <chao.liu@processmission.com>, Paolo Bonzini <pbonzini@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>
include/qom/object.h | 172 +++++++++++++++++++++++++++++++++++++++++--
hw/riscv/spike.c     |   5 +-
qom/object.c         | 126 ++++++++++++-------------------
3 files changed, 215 insertions(+), 88 deletions(-)
[PATCH v2 0/6] qom: tidy-ups and preparation for class property conversion
Posted by Mark Cave-Ayland 1 week ago
Based upon feedback from my existing efforts to start converting from object
properties to class properties, here is an initial preparation series which
I hope can be applied soon after 11.1 is released.

Patches 1-3 introduce macros to generate the QOM scalar get/set functions for scalar
memory-based properties as suggested by Daniel. This makes it trivial to add any
additional scalar types as required in future, and a similar pattern will be used
when introducing proper class properties.

Patch 4 fixes an error in the existing documentation for object_property_add_link().

Patch 5 adds missing documentation for the current object_class_* property functions
since if we're looking to deprecate object properties, it seems only fair to include
the replacement class property functions in our documentation. Again once class
propeties are added, the new functions will be documented in a similar way.

Finally patch 6 renames the existing object_class_property_uint*_ptr() functions to
object_class_static_property_uint*_ptr() to both confirm that the property is shared
amongst all instances, and also clears the object_class_property_*() prefix ready
for the introduction of class properties in subsequent patch series. This is taken
from one of my existing series to convert object properties to class properties, but
it seems convenient to include it here.

Signed-off-by: Mark Cave-Ayland <mark.caveayland@nutanix.com>

v2:
- Add R-B tags from Daniel for patches 1-3
- Add patch 4 to fix up the existing documentation for object_property_add_link()
- Fix up the object_class_property_add_link() documentation in patch 5
- Add Daniel's description of when to use static properties in patch 6


Mark Cave-Ayland (6):
  qom/object.c: introduce OBJECT_PROPERTY_SCALAR_GETTER(type) macro
  qom/object.c: introduce OBJECT_PROPERTY_SCALAR_SETTER(type) macro
  qom/object.c: introduce DEFINE_OBJECT_PROPERTY_SCALAR_METHODS() macro
  qom/object.h: rename @child to @targetp in object_property_add_link()
    documentation
  qom/object.h: add missing documentation for object_class_* property
    functions
  qom/object.c: rename object_class_property_uint*_ptr() to
    object_class_static_property_uint*_ptr()

 include/qom/object.h | 172 +++++++++++++++++++++++++++++++++++++++++--
 hw/riscv/spike.c     |   5 +-
 qom/object.c         | 126 ++++++++++++-------------------
 3 files changed, 215 insertions(+), 88 deletions(-)

-- 
2.43.0