@@ -1386,6 +1386,10 @@ static void uhci_register_types(void)
.instance_size = sizeof(UHCIState),
.class_size = sizeof(UHCIPCIDeviceClass),
.class_init = uhci_class_init,
+ .interfaces = (InterfaceInfo[]) {
+ { TYPE_INTERFACE },
+ { }
+ }
};
int i;
@@ -76,8 +76,10 @@ static GHashTable *type_table_get(void)
return type_table;
}
+static bool enumerating = false;
static void type_table_add(TypeImpl *ti)
{
+ assert(!enumerating);
g_hash_table_insert(type_table_get(), (void *)ti->name, ti);
}
@@ -579,7 +581,9 @@ void object_class_foreach(void (*fn)(ObjectClass *klass, void *opaque),
{
OCFData data = { fn, implements_type, include_abstract, opaque };
+ enumerating = true;
g_hash_table_foreach(type_table_get(), object_class_foreach_tramp, &data);
+ enumerating = false;
}
int object_child_foreach(Object *obj, int (*fn)(Object *child, void *opaque),