[PATCH 0/9] hw/i386: convert object props to class props

Mark Cave-Ayland posted 9 patches 3 weeks, 2 days ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20260703090814.2993188-1-mark.caveayland@nutanix.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, "Michael S. Tsirkin" <mst@redhat.com>, Marcelo Tosatti <mtosatti@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>
include/hw/i386/pc.h |   5 ++
include/qom/object.h |  24 ++++++++
hw/i386/pc.c         |  29 ++++++++--
hw/i386/pc_piix.c    |   5 --
hw/i386/pc_q35.c     |   5 --
hw/i386/pc_sysfw.c   |   7 +--
hw/i386/sgx-epc.c    |  12 ++--
hw/rtc/mc146818rtc.c |   4 +-
qom/object.c         | 130 +++++++++++++++++++++++++++++++++++++++----
9 files changed, 181 insertions(+), 40 deletions(-)
[PATCH 0/9] hw/i386: convert object props to class props
Posted by Mark Cave-Ayland 3 weeks, 2 days ago
Since the use of object props is effectively deprecated, here is an attempt
to convert all use of object props in hw/i386 to class props. The eventual
aim is to continue working through the codebase, removing all remaining uses
of object props.

In order to facilitate the conversion of alias properties, this series
introduces a couple of new QOM functions: object_class_property_add_alias()
and object_property_set_alias() to declare the property and to set it within
an instance accordingly. This implementation is hugely inspired by the
existing link class property code: many thanks to Marc-André for doing this
initial work.

The series is lightly tested: it passes "make check", GitLab CI and some
simple local tests. I'm mostly interested for feedback on the conversion
strategy, and to get a feel for the best way to merge this series since once
the basic conversion patterns are in place, the same patterns can be applied
elsewhere and it would be good to minimise the merge window for such changes.

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


Mark Cave-Ayland (9):
  qom/object.c: introduce object_alias_get_targetp() lookup function
  qom/object.c: introduce object_class_property_add_alias()
  qom/object.c: introduce object_property_set_alias() function
  hw/i386/pc.c: convert pcspk-audiodev object prop to a class prop
  hw/rtc/mc146818rtc.c: convert date from object prop to class prop
  hw/i386/pc.c: convert rtc-time object prop to a class prop
  hw/i386/pc.c: convert PC_MACHINE_ACPI_DEVICE_PROP from object prop to
    class prop
  hw/i386/pc_sysfw.c: convert pflash0 and pflash1 object props to class
    props
  hw/i386/sgx-epc.c: convert SGX_EPC_SIZE_PROP object prop to class prop

 include/hw/i386/pc.h |   5 ++
 include/qom/object.h |  24 ++++++++
 hw/i386/pc.c         |  29 ++++++++--
 hw/i386/pc_piix.c    |   5 --
 hw/i386/pc_q35.c     |   5 --
 hw/i386/pc_sysfw.c   |   7 +--
 hw/i386/sgx-epc.c    |  12 ++--
 hw/rtc/mc146818rtc.c |   4 +-
 qom/object.c         | 130 +++++++++++++++++++++++++++++++++++++++----
 9 files changed, 181 insertions(+), 40 deletions(-)

-- 
2.43.0