[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 04/24] qom: make Object a type
From: |
Andreas Färber |
Subject: |
Re: [Qemu-devel] [PATCH v2 04/24] qom: make Object a type |
Date: |
Thu, 12 Apr 2012 18:09:25 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120312 Thunderbird/11.0 |
Am 11.04.2012 23:30, schrieb Paolo Bonzini:
> Right now the base Object class has a special NULL type. Change this so
> that we will be able to add class_init and class_base_init callbacks.
> To do this, remove some special casing of ObjectClass that is not really
> necessary.
>
> Signed-off-by: Paolo Bonzini <address@hidden>
> ---
> include/qemu/object.h | 2 +-
> qom/object.c | 59
> +++++++++++++++++++++++++------------------------
> 2 files changed, 31 insertions(+), 30 deletions(-)
[...]
> diff --git a/qom/object.c b/qom/object.c
> index 6ff1c19..585619d 100644
> --- a/qom/object.c
> +++ b/qom/object.c
[...]
> @@ -1233,3 +1214,23 @@ void object_property_add_str(Object *obj, const char
> *name,
> property_release_str,
> prop, errp);
> }
> +
> +static void register_types(void)
> +{
> + static TypeInfo interface_info = {
> + .name = TYPE_INTERFACE,
> + .instance_size = sizeof(Interface),
> + .abstract = true,
> + };
> +
> + static TypeInfo object_info = {
> + .name = TYPE_OBJECT,
> + .instance_size = sizeof(Object),
> + .abstract = true,
> + };
> +
> + type_interface = type_register_static(&interface_info);
> + type_register_static(&object_info);
> +}
> +
> +type_init(register_types)
I think I had suggested static const and moving them to before the
register_types() function?
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
- [Qemu-devel] [PATCH 00/24] qdev properties final installment: push, push!, Paolo Bonzini, 2012/04/11
- [Qemu-devel] [PATCH v2 01/24] qom: add object_class_get_parent, Paolo Bonzini, 2012/04/11
- [Qemu-devel] [PATCH v2 02/24] qom: add object_child_foreach, Paolo Bonzini, 2012/04/11
- [Qemu-devel] [PATCH v2 03/24] qom: add class_base_init, Paolo Bonzini, 2012/04/11
- [Qemu-devel] [PATCH v2 04/24] qom: make Object a type, Paolo Bonzini, 2012/04/11
- Re: [Qemu-devel] [PATCH v2 04/24] qom: make Object a type,
Andreas Färber <=
- Re: [Qemu-devel] [PATCH v2 04/24] qom: make Object a type, Andreas Färber, 2012/04/12
- [Qemu-devel] [PATCH v2 05/24] qdev: push "type" property up to Object, Paolo Bonzini, 2012/04/11
- [Qemu-devel] [PATCH v2 06/24] qdev: fix -device foo,?, Paolo Bonzini, 2012/04/11