return strdup(path);
}
-static char *qdev_get_type(Object *obj, Error **errp)
-{
- return g_strdup(object_get_typename(obj));
-}
-
/**
* Legacy property handling
*/
qdev_property_add_static(dev, prop, NULL);
}
- object_property_add_str(OBJECT(dev), "type", qdev_get_type, NULL, NULL);
qdev_prop_set_defaults(dev, qdev_get_props(dev));
}
prop, errp);
}
+static char *qdev_get_type(Object *obj, Error **errp)
+{
+ return g_strdup(object_get_typename(obj));
+}
+
+static void object_instance_init(Object *obj)
+{
+ object_property_add_str(obj, "type", qdev_get_type, NULL, NULL);
+}
+
static void register_types(void)
{
static TypeInfo interface_info = {
static TypeInfo object_info = {
.name = TYPE_OBJECT,
.instance_size = sizeof(Object),
+ .instance_init = object_instance_init,
.abstract = true,
};