summaryrefslogtreecommitdiffstats
path: root/include/qom
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2013-12-03 16:41:59 +0100
committerAndreas Färber <afaerber@suse.de>2013-12-24 17:27:17 +0100
commitb061dc41f62048acd4a34c6570c0ea396cd9d0b4 (patch)
tree9e510dcc3264c1e8fc8f75df0119871ddc2691ed /include/qom
parent0ab4c94c844cb3953adedbd27adc378b3cf31d9e (diff)
downloadhqemu-b061dc41f62048acd4a34c6570c0ea396cd9d0b4.zip
hqemu-b061dc41f62048acd4a34c6570c0ea396cd9d0b4.tar.gz
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>
Diffstat (limited to 'include/qom')
-rw-r--r--include/qom/object.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/qom/object.h b/include/qom/object.h
index 5f78847..e0ff212 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -536,6 +536,7 @@ struct InterfaceClass
ObjectClass parent_class;
/*< private >*/
ObjectClass *concrete_class;
+ Type interface_type;
};
#define TYPE_INTERFACE "interface"
OpenPOWER on IntegriCloud