summaryrefslogtreecommitdiffstats
path: root/include/qom
diff options
context:
space:
mode:
authorEduardo Habkost <ehabkost@redhat.com>2013-07-10 17:08:41 -0300
committerAndreas Färber <afaerber@suse.de>2013-08-16 18:44:33 +0200
commit8231c2dd220336bbc7522c490d95742f6ba0adae (patch)
tree0c3fa9d769747a93ad5260e4451c531aa1bacf90 /include/qom
parent747b0cb4b51296e85add0a23d5fc1d24e250ec08 (diff)
downloadhqemu-8231c2dd220336bbc7522c490d95742f6ba0adae.zip
hqemu-8231c2dd220336bbc7522c490d95742f6ba0adae.tar.gz
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>
Diffstat (limited to 'include/qom')
-rw-r--r--include/qom/object.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/qom/object.h b/include/qom/object.h
index 23fc048..9b69065 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -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;
OpenPOWER on IntegriCloud