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

Philippe Mathieu-Daudé posted 6 patches 10 months, 3 weeks ago
Maintainers: "Marc-André Lureau" <marcandre.lureau@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Alistair Francis <alistair@alistair23.me>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, Peter Maydell <peter.maydell@linaro.org>, Eduardo Habkost <eduardo@habkost.net>, Marcel Apfelbaum <marcel.apfelbaum@gmail.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Yanan Wang <wangyanan55@huawei.com>, Zhao Liu <zhao1.liu@intel.com>, Stefano Stabellini <sstabellini@kernel.org>, Anthony PERARD <anthony@xenproject.org>, Paul Durrant <paul@xen.org>, Richard Henderson <richard.henderson@linaro.org>, "Michael S. Tsirkin" <mst@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Stefan Berger <stefanb@linux.vnet.ibm.com>, Yoshinori Sato <ysato@users.sourceforge.jp>
[PATCH-for-10.1 5/6] qom: Use object_class_implements_type() in object_class_foreach()
Posted by Philippe Mathieu-Daudé 10 months, 3 weeks ago
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 --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;
     }
 
-- 
2.47.1