[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 10/11] qom: remove unused InterfaceInfo::concrete_class field
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 10/11] qom: remove unused InterfaceInfo::concrete_class field |
Date: |
Thu, 9 Jan 2025 18:19:47 +0100 |
From: Paolo Bonzini <pbonzini@redhat.com>
The "concrete_class" field of InterfaceClass is only ever written, and as far
as I can tell is not particularly useful when debugging either; remove it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Message-ID: <20250107111308.21886-1-pbonzini@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
include/qom/object.h | 5 ++++-
qom/object.c | 1 -
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/include/qom/object.h b/include/qom/object.h
index 77935572894..9192265db76 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -573,12 +573,15 @@ struct InterfaceInfo {
*
* The class for all interfaces. Subclasses of this class should only add
* virtual methods.
+ *
+ * Note that most of the fields of ObjectClass are unused (all except
+ * "type", in fact). They are only present in InterfaceClass to allow
+ * @object_class_dynamic_cast to work with both regular classes and interfaces.
*/
struct InterfaceClass
{
ObjectClass parent_class;
/* private: */
- ObjectClass *concrete_class;
Type interface_type;
};
diff --git a/qom/object.c b/qom/object.c
index 58897a79a76..ec447f14a78 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -314,7 +314,6 @@ static void type_initialize_interface(TypeImpl *ti,
TypeImpl *interface_type,
g_free((char *)info.name);
new_iface = (InterfaceClass *)iface_impl->class;
- new_iface->concrete_class = ti->class;
new_iface->interface_type = interface_type;
ti->class->interfaces = g_slist_append(ti->class->interfaces, new_iface);
--
2.47.1
- [PULL 00/11] QOM / QDev patches for 2025-01-09, Philippe Mathieu-Daudé, 2025/01/09
- [PULL 01/11] hw/pci: Use -1 as the default value for rombar, Philippe Mathieu-Daudé, 2025/01/09
- [PULL 02/11] qdev: Remove opts member, Philippe Mathieu-Daudé, 2025/01/09
- [PULL 03/11] qdev: Implement qdev_create_fake_machine() for user emulation, Philippe Mathieu-Daudé, 2025/01/09
- [PULL 04/11] qdev: Make qdev_get_machine() not use container_get(), Philippe Mathieu-Daudé, 2025/01/09
- [PULL 05/11] qdev: Add machine_get_container(), Philippe Mathieu-Daudé, 2025/01/09
- [PULL 06/11] qdev: Use machine_get_container(), Philippe Mathieu-Daudé, 2025/01/09
- [PULL 07/11] qom: Add object_get_container(), Philippe Mathieu-Daudé, 2025/01/09
- [PULL 08/11] qom: Use object_get_container(), Philippe Mathieu-Daudé, 2025/01/09
- [PULL 09/11] qom: Remove container_get(), Philippe Mathieu-Daudé, 2025/01/09
- [PULL 10/11] qom: remove unused InterfaceInfo::concrete_class field,
Philippe Mathieu-Daudé <=
- [PULL 11/11] system: Inline machine_containers[] in qemu_create_machine_containers(), Philippe Mathieu-Daudé, 2025/01/09