diff options
Diffstat (limited to 'hw/kvm')
-rw-r--r-- | hw/kvm/apic.c | 5 | ||||
-rw-r--r-- | hw/kvm/clock.c | 16 | ||||
-rw-r--r-- | hw/kvm/i8259.c | 8 | ||||
-rw-r--r-- | hw/kvm/ioapic.c | 20 |
4 files changed, 29 insertions, 20 deletions
diff --git a/hw/kvm/apic.c b/hw/kvm/apic.c index bc80ae4ede..89e33b0ac8 100644 --- a/hw/kvm/apic.c +++ b/hw/kvm/apic.c @@ -132,14 +132,15 @@ static void kvm_apic_class_init(ObjectClass *klass, void *data) k->external_nmi = kvm_apic_external_nmi; } -static DeviceInfo kvm_apic_info = { +static TypeInfo kvm_apic_info = { .name = "kvm-apic", + .parent = TYPE_APIC_COMMON, .class_init = kvm_apic_class_init, }; static void kvm_apic_register_device(void) { - apic_qdev_register(&kvm_apic_info); + type_register_static(&kvm_apic_info); } device_init(kvm_apic_register_device) diff --git a/hw/kvm/clock.c b/hw/kvm/clock.c index b997d2a388..d5a53869b3 100644 --- a/hw/kvm/clock.c +++ b/hw/kvm/clock.c @@ -94,17 +94,19 @@ static const VMStateDescription kvmclock_vmsd = { static void kvmclock_class_init(ObjectClass *klass, void *data) { + DeviceClass *dc = DEVICE_CLASS(klass); SysBusDeviceClass *k = SYS_BUS_DEVICE_CLASS(klass); k->init = kvmclock_init; + dc->no_user = 1; + dc->vmsd = &kvmclock_vmsd; } -static DeviceInfo kvmclock_info = { - .name = "kvmclock", - .size = sizeof(KVMClockState), - .vmsd = &kvmclock_vmsd, - .no_user = 1, - .class_init = kvmclock_class_init, +static TypeInfo kvmclock_info = { + .name = "kvmclock", + .parent = TYPE_SYS_BUS_DEVICE, + .instance_size = sizeof(KVMClockState), + .class_init = kvmclock_class_init, }; /* Note: Must be called after VCPU initialization. */ @@ -120,7 +122,7 @@ void kvmclock_create(void) static void kvmclock_register_device(void) { if (kvm_enabled()) { - sysbus_register_withprop(&kvmclock_info); + type_register_static(&kvmclock_info); } } diff --git a/hw/kvm/i8259.c b/hw/kvm/i8259.c index b34901c063..297d64e11f 100644 --- a/hw/kvm/i8259.c +++ b/hw/kvm/i8259.c @@ -115,21 +115,23 @@ qemu_irq *kvm_i8259_init(ISABus *bus) static void kvm_i8259_class_init(ObjectClass *klass, void *data) { PICCommonClass *k = PIC_COMMON_CLASS(klass); + DeviceClass *dc = DEVICE_CLASS(klass); + dc->reset = kvm_pic_reset; k->init = kvm_pic_init; k->pre_save = kvm_pic_get; k->post_load = kvm_pic_put; } -static DeviceInfo kvm_i8259_info = { +static TypeInfo kvm_i8259_info = { .name = "kvm-i8259", - .reset = kvm_pic_reset, + .parent = TYPE_PIC_COMMON, .class_init = kvm_i8259_class_init, }; static void kvm_pic_register(void) { - pic_qdev_register(&kvm_i8259_info); + type_register_static(&kvm_i8259_info); } device_init(kvm_pic_register) diff --git a/hw/kvm/ioapic.c b/hw/kvm/ioapic.c index f8ea0cc31a..b316933a96 100644 --- a/hw/kvm/ioapic.c +++ b/hw/kvm/ioapic.c @@ -93,29 +93,33 @@ 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 Property kvm_ioapic_properties[] = { + DEFINE_PROP_UINT32("gsi_base", KVMIOAPICState, kvm_gsi_base, 0), + DEFINE_PROP_END_OF_LIST() +}; + static void kvm_ioapic_class_init(ObjectClass *klass, void *data) { IOAPICCommonClass *k = IOAPIC_COMMON_CLASS(klass); + DeviceClass *dc = DEVICE_CLASS(klass); k->init = kvm_ioapic_init; k->pre_save = kvm_ioapic_get; k->post_load = kvm_ioapic_put; + dc->reset = kvm_ioapic_reset; + dc->props = kvm_ioapic_properties; } -static DeviceInfo kvm_ioapic_info = { +static TypeInfo kvm_ioapic_info = { .name = "kvm-ioapic", - .size = sizeof(KVMIOAPICState), - .reset = kvm_ioapic_reset, + .parent = TYPE_IOAPIC_COMMON, + .instance_size = sizeof(KVMIOAPICState), .class_init = kvm_ioapic_class_init, - .props = (Property[]) { - DEFINE_PROP_UINT32("gsi_base", KVMIOAPICState, kvm_gsi_base, 0), - DEFINE_PROP_END_OF_LIST() - }, }; static void kvm_ioapic_register_device(void) { - ioapic_qdev_register(&kvm_ioapic_info); + type_register_static(&kvm_ioapic_info); } device_init(kvm_ioapic_register_device) |