aboutsummaryrefslogtreecommitdiff
path: root/hw/kvm/ioapic.c
diff options
context:
space:
mode:
authorAnthony Liguori <aliguori@us.ibm.com>2012-01-24 13:12:29 -0600
committerAnthony Liguori <aliguori@us.ibm.com>2012-01-27 10:50:50 -0600
commit999e12bbe85c5dcf49bef13bce4f97399c7105f4 (patch)
tree73b6ed8633a73134e9f728baa1ed2b1dab58b5b0 /hw/kvm/ioapic.c
parent40021f08882aaef93c66c8c740087b6d3031b63a (diff)
sysbus: apic: ioapic: convert to QEMU Object Model
This converts three devices because apic and ioapic are subclasses of sysbus. Converting subclasses independently of their base class is prohibitively hard. Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/kvm/ioapic.c')
-rw-r--r--hw/kvm/ioapic.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/hw/kvm/ioapic.c b/hw/kvm/ioapic.c
index 10ffdd4b20..f8ea0cc31a 100644
--- a/hw/kvm/ioapic.c
+++ b/hw/kvm/ioapic.c
@@ -93,17 +93,24 @@ static void kvm_ioapic_init(IOAPICCommonState *s, int instance_no)
qdev_init_gpio_in(&s->busdev.qdev, kvm_ioapic_set_irq, IOAPIC_NUM_PINS);
}
-static IOAPICCommonInfo kvm_ioapic_info = {
- .busdev.qdev.name = "kvm-ioapic",
- .busdev.qdev.size = sizeof(KVMIOAPICState),
- .busdev.qdev.reset = kvm_ioapic_reset,
- .busdev.qdev.props = (Property[]) {
+static void kvm_ioapic_class_init(ObjectClass *klass, void *data)
+{
+ IOAPICCommonClass *k = IOAPIC_COMMON_CLASS(klass);
+
+ k->init = kvm_ioapic_init;
+ k->pre_save = kvm_ioapic_get;
+ k->post_load = kvm_ioapic_put;
+}
+
+static DeviceInfo kvm_ioapic_info = {
+ .name = "kvm-ioapic",
+ .size = sizeof(KVMIOAPICState),
+ .reset = kvm_ioapic_reset,
+ .class_init = kvm_ioapic_class_init,
+ .props = (Property[]) {
DEFINE_PROP_UINT32("gsi_base", KVMIOAPICState, kvm_gsi_base, 0),
DEFINE_PROP_END_OF_LIST()
},
- .init = kvm_ioapic_init,
- .pre_save = kvm_ioapic_get,
- .post_load = kvm_ioapic_put,
};
static void kvm_ioapic_register_device(void)