diff options
author | Anthony Liguori | 2011-12-04 18:52:49 +0100 |
---|---|---|
committer | Anthony Liguori | 2012-01-27 17:50:47 +0100 |
commit | 8f04ee0882aec9fe91fb70f767edf5dacff59835 (patch) | |
tree | 01ebc9678569233858c2343c9cb04e62c2df55ad /hw/kvm | |
parent | qdev: prepare source tree for code conversion (diff) | |
download | qemu-8f04ee0882aec9fe91fb70f767edf5dacff59835.tar.gz qemu-8f04ee0882aec9fe91fb70f767edf5dacff59835.tar.xz qemu-8f04ee0882aec9fe91fb70f767edf5dacff59835.zip |
isa: pic: convert to QEMU Object Model
This converts two devices at once because PIC subclasses ISA and converting
subclasses independently is extremely hard.
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/kvm')
-rw-r--r-- | hw/kvm/i8259.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/hw/kvm/i8259.c b/hw/kvm/i8259.c index 64bb5c26e2..b34901c063 100644 --- a/hw/kvm/i8259.c +++ b/hw/kvm/i8259.c @@ -112,12 +112,19 @@ qemu_irq *kvm_i8259_init(ISABus *bus) return qemu_allocate_irqs(kvm_pic_set_irq, NULL, ISA_NUM_IRQS); } -static PICCommonInfo kvm_i8259_info = { - .isadev.qdev.name = "kvm-i8259", - .isadev.qdev.reset = kvm_pic_reset, - .init = kvm_pic_init, - .pre_save = kvm_pic_get, - .post_load = kvm_pic_put, +static void kvm_i8259_class_init(ObjectClass *klass, void *data) +{ + PICCommonClass *k = PIC_COMMON_CLASS(klass); + + k->init = kvm_pic_init; + k->pre_save = kvm_pic_get; + k->post_load = kvm_pic_put; +} + +static DeviceInfo kvm_i8259_info = { + .name = "kvm-i8259", + .reset = kvm_pic_reset, + .class_init = kvm_i8259_class_init, }; static void kvm_pic_register(void) |