mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 09:13:55 -06:00
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>
This commit is contained in:
parent
f97718584b
commit
db0f888848
4 changed files with 21 additions and 10 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue