qom: Add object_class_implements_type()
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest6 patches 1 replyIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | qom: Factor object_class_dynamic_cast_ambiguous() outqom/ | +12 | 0 replies | |
| 2/6 | qom: Add object_class_implements_type()include/ qom/ | +21 | 0 replies | |
| 3/6 | qom: Test object_class_implements_type()tests/ | +40 | 0 replies | |
| 4/6 | qom: Prefer object_class_implements_type() to check type implementationchardev/ hw/ hw/ +10 more | +18 | 0 replies | |
| 5/6 | qom: Use object_class_implements_type() in object_class_foreach()qom/ | +1 | 0 replies | |
| 6/6 | qom: Test object_class_get_list()tests/ | +16 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
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