diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2018-09-06 18:09:32 +0400 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2018-10-05 16:14:22 +0400 |
commit | 7439a036d58f0def85751d6d4d3232461a35ebee (patch) | |
tree | 4d9b4d441e21512ca55aa0e1802c80d721171f5f | |
parent | 684546d8e9b5adefa5b499d4371b83f9163593b6 (diff) | |
download | qemu-7439a036d58f0def85751d6d4d3232461a35ebee.zip qemu-7439a036d58f0def85751d6d4d3232461a35ebee.tar.gz qemu-7439a036d58f0def85751d6d4d3232461a35ebee.tar.bz2 |
qom/object: register 'type' property as class property
Let's save a few byte in each object instance.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | qom/object.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/qom/object.c b/qom/object.c index 9eaf08a..547dcf9 100644 --- a/qom/object.c +++ b/qom/object.c @@ -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, }; |