diff options
author | xiaoqiang zhao <zxq_yx_007@163.com> | 2013-11-05 18:16:05 +0800 |
---|---|---|
committer | Andreas Färber <afaerber@suse.de> | 2013-12-24 18:02:18 +0100 |
commit | db0f888848bc5cc578d005d04f4cf7a1105bb758 (patch) | |
tree | 3745d7e3d88231ad49cc9a1ffce7b876fc169a0b /hw/i386/kvm | |
parent | f97718584baa6ef919d00067b9787ba7fc5f1a5b (diff) |
ioapic: QOM'ify ioapic
Convert 'init' function to QOM's 'realize' for ioapic and kvm-ioapic.
Change variable 'ioapic_no' from static to global. Then we can drop
the 'instance_no' function argument.
Signed-off-by: xiaoqiang zhao <zxq_yx_007@163.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
Diffstat (limited to 'hw/i386/kvm')
-rw-r--r-- | hw/i386/kvm/ioapic.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/hw/i386/kvm/ioapic.c b/hw/i386/kvm/ioapic.c index 772a7127d4..d2a6c4cf60 100644 --- a/hw/i386/kvm/ioapic.c +++ b/hw/i386/kvm/ioapic.c @@ -127,9 +127,9 @@ static void kvm_ioapic_set_irq(void *opaque, int irq, int level) apic_report_irq_delivered(delivered); } -static void kvm_ioapic_init(IOAPICCommonState *s, int instance_no) +static void kvm_ioapic_realize(DeviceState *dev, Error **errp) { - DeviceState *dev = DEVICE(s); + IOAPICCommonState *s = IOAPIC_COMMON(dev); memory_region_init_reservation(&s->io_memory, NULL, "kvm-ioapic", 0x1000); @@ -146,7 +146,7 @@ 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->realize = kvm_ioapic_realize; k->pre_save = kvm_ioapic_get; k->post_load = kvm_ioapic_put; dc->reset = kvm_ioapic_reset; |