All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/9] hw/i386: convert object props to class props
@ 2026-09-21 11:35 Mark Cave-Ayland
  2026-09-21 11:35 ` [PATCH v4 1/9] qom/object.c: improve duplicate class property detection assert() Mark Cave-Ayland
                   ` (8 more replies)
  0 siblings, 9 replies; 14+ messages in thread
From: Mark Cave-Ayland @ 2026-09-21 11:35 UTC (permalink / raw)
  To: pbonzini, richard.henderson, mst, mtosatti, marcandre.lureau,
	armbru, qemu-devel

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>

(Patches still needing review: 1-4)

v4:
- Rebase onto master

- Add patch 1 to make it clearer to developers that they have introduced a duplicate
  class property as suggested by Daniel

- Remove extra semi-colon from property_get_alias() in patch 3 as reported by
  Marc-André

- Return an error instead of a null visitor from property_set_alias() in patch 4 if
  we are unable to resolve a target object as reported by Marc-André

- Add R-B tag from Phil for patch 5


v3:
- Rebase onto master

- Add R-B tags from Phil

- Add kernel-doc to patch 2 for the object_class_property_add_alias() function

- Update refcounting for alias class properties according to the description
  in the kernel-doc for object_property_set_alias() which is taken from
  the existing object_property_add_alias() kernel-doc


v2:
- Rebase onto master

- Add R-B tags from Daniel

- Update comment on patch 7 to explicitly describe the change in behaviour
  of the pflash0 and pflash1 PC machine properties


Mark Cave-Ayland (9):
  qom/object.c: improve duplicate class property detection assert()
  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/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 |  42 +++++++++++++
 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 ++--
 qom/object.c         | 146 +++++++++++++++++++++++++++++++++++++++----
 8 files changed, 212 insertions(+), 39 deletions(-)

-- 
2.43.0



^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2026-09-21 12:29 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-21 11:35 [PATCH v4 0/9] hw/i386: convert object props to class props Mark Cave-Ayland
2026-09-21 11:35 ` [PATCH v4 1/9] qom/object.c: improve duplicate class property detection assert() Mark Cave-Ayland
2026-09-21 12:14   ` Daniel P. Berrangé
2026-09-21 11:35 ` [PATCH v4 2/9] qom/object.c: introduce object_alias_get_targetp() lookup function Mark Cave-Ayland
2026-09-21 12:17   ` Daniel P. Berrangé
2026-09-21 11:35 ` [PATCH v4 3/9] qom/object.c: introduce object_class_property_add_alias() Mark Cave-Ayland
2026-09-21 12:21   ` Daniel P. Berrangé
2026-09-21 11:35 ` [PATCH v4 4/9] qom/object.c: introduce object_property_set_alias() function Mark Cave-Ayland
2026-09-21 12:28   ` Daniel P. Berrangé
2026-09-21 11:35 ` [PATCH v4 5/9] hw/i386/pc.c: convert pcspk-audiodev object prop to a class prop Mark Cave-Ayland
2026-09-21 11:35 ` [PATCH v4 6/9] hw/i386/pc.c: convert rtc-time " Mark Cave-Ayland
2026-09-21 11:35 ` [PATCH v4 7/9] hw/i386/pc.c: convert PC_MACHINE_ACPI_DEVICE_PROP from object prop to " Mark Cave-Ayland
2026-09-21 11:35 ` [PATCH v4 8/9] hw/i386/pc_sysfw.c: convert pflash0 and pflash1 object props to class props Mark Cave-Ayland
2026-09-21 11:35 ` [PATCH v4 9/9] hw/i386/sgx-epc.c: convert SGX_EPC_SIZE_PROP object prop to class prop Mark Cave-Ayland

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.