]> Git Repo - qemu.git/commitdiff
qom/object: register 'type' property as class property
authorMarc-André Lureau <[email protected]>
Thu, 6 Sep 2018 14:09:32 +0000 (18:09 +0400)
committerMarc-André Lureau <[email protected]>
Fri, 5 Oct 2018 12:14:22 +0000 (16:14 +0400)
Let's save a few byte in each object instance.

Signed-off-by: Marc-André Lureau <[email protected]>
Reviewed-by: Paolo Bonzini <[email protected]>
qom/object.c

index 9eaf08a53c378da7f5d952bc847dd32137153946..547dcf97c3c53415e32d14dd4c39c319e7643953 100644 (file)
@@ -2430,9 +2430,10 @@ void object_class_property_set_description(ObjectClass *klass,
     op->description = g_strdup(description);
 }
 
-static void object_instance_init(Object *obj)
+static void object_class_init(ObjectClass *klass, void *data)
 {
-    object_property_add_str(obj, "type", qdev_get_type, NULL, NULL);
+    object_class_property_add_str(klass, "type", qdev_get_type,
+                                  NULL, &error_abort);
 }
 
 static void register_types(void)
@@ -2446,7 +2447,7 @@ static void register_types(void)
     static TypeInfo object_info = {
         .name = TYPE_OBJECT,
         .instance_size = sizeof(Object),
-        .instance_init = object_instance_init,
+        .class_init = object_class_init,
         .abstract = true,
     };
 
This page took 0.024311 seconds and 4 git commands to generate.