mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 01:33:56 -06:00
qom: Introduce instance_post_init hook
This will allow classes to specify a function to be called after all instance_init functions were called. This will be used by DeviceState to call qdev_prop_set_globals() at the right moment. Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Andreas Färber <afaerber@suse.de>
This commit is contained in:
parent
747b0cb4b5
commit
8231c2dd22
2 changed files with 17 additions and 0 deletions
|
@ -398,6 +398,8 @@ struct Object
|
|||
* @instance_init: This function is called to initialize an object. The parent
|
||||
* class will have already been initialized so the type is only responsible
|
||||
* for initializing its own members.
|
||||
* @instance_post_init: This function is called to finish initialization of
|
||||
* an object, after all @instance_init functions were called.
|
||||
* @instance_finalize: This function is called during object destruction. This
|
||||
* is called before the parent @instance_finalize function has been called.
|
||||
* An object should only free the members that are unique to its type in this
|
||||
|
@ -433,6 +435,7 @@ struct TypeInfo
|
|||
|
||||
size_t instance_size;
|
||||
void (*instance_init)(Object *obj);
|
||||
void (*instance_post_init)(Object *obj);
|
||||
void (*instance_finalize)(Object *obj);
|
||||
|
||||
bool abstract;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue