[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 01/11] qom: do not register interface "types" in the
From: |
Igor Mammedov |
Subject: |
[Qemu-devel] [PATCH 01/11] qom: do not register interface "types" in the type table |
Date: |
Wed, 11 Dec 2013 02:01:16 +0100 |
From: Paolo Bonzini <address@hidden>
There should be no need to look them 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.
Signed-off-by: Paolo Bonzini <address@hidden>
Signed-off-by: Igor Mammedov <address@hidden>
---
qom/object.c | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/qom/object.c b/qom/object.c
index fc19cf6..3a43186 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -88,7 +88,7 @@ static TypeImpl *type_table_lookup(const char *name)
return g_hash_table_lookup(type_table_get(), name);
}
-static TypeImpl *type_register_internal(const TypeInfo *info)
+static TypeImpl *type_new(const TypeInfo *info)
{
TypeImpl *ti = g_malloc0(sizeof(*ti));
int i;
@@ -122,8 +122,15 @@ static TypeImpl *type_register_internal(const TypeInfo
*info)
}
ti->num_interfaces = i;
- type_table_add(ti);
+ return ti;
+}
+static TypeImpl *type_register_internal(const TypeInfo *info)
+{
+ TypeImpl *ti;
+ ti = type_new(info);
+
+ type_table_add(ti);
return ti;
}
@@ -216,7 +223,7 @@ static void type_initialize_interface(TypeImpl *ti, const
char *parent)
info.name = g_strdup_printf("%s::%s", ti->name, info.parent);
info.abstract = true;
- iface_impl = type_register(&info);
+ iface_impl = type_new(&info);
type_initialize(iface_impl);
g_free((char *)info.name);
--
1.7.1
- [Qemu-devel] [PATCH 00/11 v2] Refactor PCI/SHPC/PCIE hotplug to use a more generic hotplug API, Igor Mammedov, 2013/12/10
- [Qemu-devel] [PATCH 01/11] qom: do not register interface "types" in the type table,
Igor Mammedov <=
- [Qemu-devel] [PATCH 02/11] qom: detect bad reentrance during object_class_foreach, Igor Mammedov, 2013/12/10
- [Qemu-devel] [PATCH 03/11] define hotplug interface, Igor Mammedov, 2013/12/10
- [Qemu-devel] [PATCH 04/11] qdev: add to BusState "hotplug-handler" link, Igor Mammedov, 2013/12/10
- [Qemu-devel] [PATCH 05/11] qdev: add "hotplugable" property to Device, Igor Mammedov, 2013/12/10
- Re: [Qemu-devel] [PATCH 05/11] qdev: add "hotplugable" property to Device, Igor Mammedov, 2013/12/11
- Re: [Qemu-devel] [PATCH 05/11] qdev: add "hotplugable" property to Device, Paolo Bonzini, 2013/12/11