diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2012-05-02 13:30:55 +0200 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2012-06-18 15:14:37 +0200 |
commit | 3b50e311b48795707fed6d4f474711db87e341b9 (patch) | |
tree | 6d98cae92d080f1a282d823daf4479b430e3edec /include | |
parent | 32efc535b86626646442de7fe5793f3a47f4ce91 (diff) |
qom: Add class_base_init
The class_base_init TypeInfo callback was present in one of the early
QOM versions but removed (on my request...) before committing. We
will need it soon, add it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/qemu/object.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/qemu/object.h b/include/qemu/object.h index ce9e51f2ae..3c29c17bc0 100644 --- a/include/qemu/object.h +++ b/include/qemu/object.h @@ -291,10 +291,15 @@ struct Object * has occurred to allow a class to set its default virtual method pointers. * This is also the function to use to override virtual methods from a parent * class. + * @class_base_init: This function is called for all base classes after all + * parent class initialization has occurred, but before the class itself + * is initialized. This is the function to use to undo the effects of + * memcpy from the parent class to the descendents. * @class_finalize: This function is called during class destruction and is * meant to release and dynamic parameters allocated by @class_init. - * @class_data: Data to pass to the @class_init and @class_finalize functions. - * This can be useful when building dynamic classes. + * @class_data: Data to pass to the @class_init, @class_base_init and + * @class_finalize functions. This can be useful when building dynamic + * classes. * @interfaces: The list of interfaces associated with this type. This * should point to a static array that's terminated with a zero filled * element. @@ -312,6 +317,7 @@ struct TypeInfo size_t class_size; void (*class_init)(ObjectClass *klass, void *data); + void (*class_base_init)(ObjectClass *klass, void *data); void (*class_finalize)(ObjectClass *klass, void *data); void *class_data; |