Skip to content

qom: Add object_class_implements_type()

Philippe Mathieu-Daudé qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6qom: Factor object_class_dynamic_cast_ambiguous() outqom/object.c+12 -20 replies
2/6qom: Add object_class_implements_type()include/qom/object.h qom/object.c+21 -00 replies
3/6qom: Test object_class_implements_type()tests/unit/check-qom-interface.c+40 -00 replies
4/6qom: Prefer object_class_implements_type() to check type implementationchardev/char.c hw/arm/xlnx-versal-virt.c hw/core/cpu-common.c +10 more+18 -180 replies
5/6qom: Use object_class_implements_type() in object_class_foreach()qom/object.c+1 -10 replies
6/6qom: Test object_class_get_list()tests/unit/check-qom-interface.c+16 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH-for-10.1 0/6] qom: Add object_class_implements_type()

Hi,

object_class_dynamic_cast() checks whether a class implements a type name, and return the class casted appropriately. This also works with interfaces, except when an interface is implemented multiple times (by intermediate abstract parents / interfaces).

This series factors object_class_implements_type() out of object_class_dynamic_cast() and use it (at least the meaning seems clearer to me when reviewing).

I could get it working with object_class_foreach() but for some reason fail at writing a proper test. Posting the last patch as RFC so we can discuss it on the list.

Regards,

Phil.

Philippe Mathieu-Daudé (6):
qom: Factor object_class_dynamic_cast_ambiguous() out
qom: Add object_class_implements_type()
qom: Test object_class_implements_type()
qom: Prefer object_class_implements_type() to check type
implementation
qom: Use object_class_implements_type() in object_class_foreach() XXX qom: Test object_class_get_list()

 include/qom/object.h             | 10 ++++++
 chardev/char.c                   |  2 +-
 hw/arm/xlnx-versal-virt.c        |  2 +-
 hw/core/cpu-common.c             |  2 +-
 hw/core/machine.c                |  4 +--
 hw/i386/xen/xen_platform.c       |  2 +-
 hw/pci/pci.c                     |  6 ++--
 qom/object.c                     | 29 ++++++++++++++---
 qom/object_interfaces.c          |  2 +-
 qom/qom-qmp-cmds.c               |  4 +--
 system/qdev-monitor.c            |  4 +--
 system/tpm.c                     |  2 +-
 target/alpha/cpu.c               |  2 +-
 target/rx/cpu.c                  |  2 +-
 tests/unit/check-qom-interface.c | 56 ++++++++++++++++++++++++++++++++
 15 files changed, 108 insertions(+), 21 deletions(-)
Signature · 1 line
2.47.1