diff mbox series

[PATCH-for-10.1,5/6] qom: Use object_class_implements_type() in object_class_foreach()

Message ID 20250320154722.27349-6-philmd@linaro.org
State New
Headers show
Series qom: Add object_class_implements_type() | expand

Commit Message

Philippe Mathieu-Daudé March 20, 2025, 3:47 p.m. UTC
Previously classes indirectly implementing an interface more than
once were triggering the ambiguous cast assertion. Since we are not
interested in the returned class, but only whether it implements or
not, use object_class_implements_type().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 qom/object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/qom/object.c b/qom/object.c
index 536308c0553..6733adcd6b2 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -1136,7 +1136,7 @@  static void object_class_foreach_tramp(gpointer key, gpointer value,
     }
 
     if (data->implements_type && 
-        !object_class_dynamic_cast(k, data->implements_type)) {
+        !object_class_implements_type(k, data->implements_type)) {
         return;
     }