[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 08/27] qdev: add class_init to DeviceInfo
From: |
Anthony Liguori |
Subject: |
[Qemu-devel] [PATCH 08/27] qdev: add class_init to DeviceInfo |
Date: |
Tue, 20 Dec 2011 10:51:37 -0600 |
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 <address@hidden>
---
hw/qdev.c | 4 ++++
hw/qdev.h | 5 +++++
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/hw/qdev.c b/hw/qdev.c
index 40ca081..51d4fc5 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)
diff --git a/hw/qdev.h b/hw/qdev.h
index c366174..02567db 100644
--- a/hw/qdev.h
+++ b/hw/qdev.h
@@ -230,6 +230,11 @@ struct DeviceInfo {
/* device state */
const VMStateDescription *vmsd;
+ /**
+ * See #TypeInfo::class_init()
+ */
+ void (*class_init)(ObjectClass *klass, void *data);
+
/* Private to qdev / bus. */
qdev_initfn init;
qdev_event unplug;
--
1.7.4.1
- [Qemu-devel] [PATCH 01/27] qom: add the base Object class, (continued)
- [Qemu-devel] [PATCH 01/27] qom: add the base Object class, Anthony Liguori, 2011/12/20
- Re: [Qemu-devel] [PATCH 01/27] qom: add the base Object class, Paolo Bonzini, 2011/12/21
- Re: [Qemu-devel] [PATCH 01/27] qom: add the base Object class, Anthony Liguori, 2011/12/21
- Re: [Qemu-devel] [PATCH 01/27] qom: add the base Object class, Paolo Bonzini, 2011/12/21
- Re: [Qemu-devel] [PATCH 01/27] qom: add the base Object class, Kevin O'Connor, 2011/12/22
- Re: [Qemu-devel] [PATCH 01/27] qom: add the base Object class, Anthony Liguori, 2011/12/22
- Re: [Qemu-devel] [PATCH 01/27] qom: add the base Object class, Kevin O'Connor, 2011/12/22
[Qemu-devel] [PATCH 03/27] qdev: move qdev->info to class, Anthony Liguori, 2011/12/20
[Qemu-devel] [PATCH 06/27] pci: check for an initialized QOM object instead of looking for an info link, Anthony Liguori, 2011/12/20
[Qemu-devel] [PATCH 04/27] qdev: don't access name through info, Anthony Liguori, 2011/12/20
[Qemu-devel] [PATCH 08/27] qdev: add class_init to DeviceInfo,
Anthony Liguori <=
[Qemu-devel] [PATCH 07/27] qdev: add a interface to register subclasses, Anthony Liguori, 2011/12/20
[Qemu-devel] [PATCH 10/27] not-for-upstream: disable non-qdev pci devices, Anthony Liguori, 2011/12/20
[Qemu-devel] [PATCH 11/27] isa: convert to QEMU Object Model, Anthony Liguori, 2011/12/20
[Qemu-devel] [PATCH 13/27] ccid: convert to QEMU Object Model, Anthony Liguori, 2011/12/20
[Qemu-devel] [PATCH 09/27] qdev: prepare source tree for code conversion, Anthony Liguori, 2011/12/20
[Qemu-devel] [PATCH 12/27] usb: convert to QEMU Object Model, Anthony Liguori, 2011/12/20
[Qemu-devel] [PATCH 14/27] ssi: convert to QEMU Object Model, Anthony Liguori, 2011/12/20
[Qemu-devel] [PATCH 15/27] i2c: rename i2c_slave -> I2CSlave, Anthony Liguori, 2011/12/20
[Qemu-devel] [PATCH 17/27] hda-codec: convert to QEMU Object Model, Anthony Liguori, 2011/12/20
[Qemu-devel] [PATCH 19/27] scsi: convert to QEMU Object Model, Anthony Liguori, 2011/12/20