]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
qom: remove unused field
authorPaolo Bonzini <pbonzini@redhat.com>
Tue, 7 Jan 2025 10:42:49 +0000 (11:42 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 10 Jan 2025 22:34:44 +0000 (23:34 +0100)
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>
include/qom/object.h
qom/object.c

index 95d6e064d9be96fcc2be5ba709f094ae1ae12424..f28ffea9a64e4ac5081afd7e0da3bffffcd0f1b4 100644 (file)
@@ -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;
 };
 
index b4c52d055d92d7554a82f67d4805005588ffbfec..e9dfad854bdaa3fe03fd8906ec82f6b0c14e7767 100644 (file)
@@ -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);