mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
qom: Do not register interface "types" in the type table and fix names
There should be no need to look up nor enumerate the interface "types", whose "classes" are really just vtables. Just create the types and add them to the interface list of the parent type. Interfaces not registering their type anymore means that accessing superclass::interface by type name will fail when initializing subclass::interface. Thus, we need to pre-initialize the subclass's parent_type field before calling type_initialize. Apart from this, the interface "types" should never be used and thus it is harmless to leave them out of the hashtable. Further, the interface types had a bug with interfaces that are inherited from a superclass: The implementation type name was wrong (for example it was subclass::superclass::interface rather than just subclass::interface). This patch fixes this as well. Reported-by: Igor Mammedov <imammedo@redhat.com> Tested-by: Igor Mammedov <imammedo@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
0ab4c94c84
commit
b061dc41f6
2 changed files with 22 additions and 11 deletions
|
@ -536,6 +536,7 @@ struct InterfaceClass
|
|||
ObjectClass parent_class;
|
||||
/*< private >*/
|
||||
ObjectClass *concrete_class;
|
||||
Type interface_type;
|
||||
};
|
||||
|
||||
#define TYPE_INTERFACE "interface"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue