aboutsummaryrefslogtreecommitdiff
path: root/hw/qdev.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2011-12-04 14:37:06 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2012-01-27 10:50:46 -0600
commit3dde52d2fe5fd4783bdd06f88561cbd0695aae06 (patch)
treedca514ef20568c98fef12bd51b8df5c49b80a3b6 /hw/qdev.c
parent3cc90eb2b7c0810fb23ceed57c1f50683ee803fd (diff)
qdev: add class_init to DeviceInfo
Since we are still dynamically creating TypeInfo, we need to chain the class_init function in order to be able to make use of it within subclasses of TYPE_DEVICE. This will disappear once we register TypeInfos directly. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/qdev.c')
-rw-r--r--hw/qdev.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/qdev.c b/hw/qdev.c
index c4b5284fdc..81996bbc36 100644
--- a/hw/qdev.c
+++ b/hw/qdev.c
@@ -54,6 +54,10 @@ static void qdev_subclass_init(ObjectClass *klass, void *data)
/* Poison to try to detect future uses */
dc->info->reset = NULL;
+
+ if (dc->info->class_init) {
+ dc->info->class_init(klass, data);
+ }
}
DeviceInfo *qdev_get_info(DeviceState *dev)