Revision 2f262e06 qom/object.c

b/qom/object.c
1231 1231
                        prop, errp);
1232 1232
}
1233 1233

  
1234
static char *qdev_get_type(Object *obj, Error **errp)
1235
{
1236
    return g_strdup(object_get_typename(obj));
1237
}
1238

  
1239
static void object_instance_init(Object *obj)
1240
{
1241
    object_property_add_str(obj, "type", qdev_get_type, NULL, NULL);
1242
}
1243

  
1234 1244
static void register_types(void)
1235 1245
{
1236 1246
    static TypeInfo interface_info = {
......
1242 1252
    static TypeInfo object_info = {
1243 1253
        .name = TYPE_OBJECT,
1244 1254
        .instance_size = sizeof(Object),
1255
        .instance_init = object_instance_init,
1245 1256
        .abstract = true,
1246 1257
    };
1247 1258

  

Also available in: Unified diff