@@ -238,10 +238,8 @@ static void ioapic_init(IOAPICCommonState *s, int instance_no)
static void ioapic_class_init(ObjectClass *klass, void *data)
{
IOAPICCommonClass *k = IOAPIC_COMMON_CLASS(klass);
- DeviceClass *dc = DEVICE_CLASS(klass);
k->init = ioapic_init;
- dc->reset = ioapic_reset_common;
}
static TypeInfo ioapic_info = {
@@ -52,6 +52,7 @@ static void ioapic_reset_common(DeviceState *dev)
for (i = 0; i < IOAPIC_NUM_PINS; i++) {
s->ioredtbl[i] = 1 << IOAPIC_LVT_MASKED_SHIFT;
}
+ ioapic_put(s);
}
static void ioapic_pre_save(void *opaque)
@@ -109,6 +110,7 @@ static void ioapic_common_class_init(ObjectClass *klass, void *data)
DeviceClass *dc = DEVICE_CLASS(klass);
sc->init = ioapic_init_common;
+ dc->reset = ioapic_reset_common;
dc->vmsd = &vmstate_ioapic_common;
dc->no_user = 1;
}
@@ -97,6 +97,4 @@ struct IOAPICCommonState {
uint64_t ioredtbl[IOAPIC_NUM_PINS];
};
-void ioapic_reset_common(DeviceState *dev);
-
#endif /* !QEMU_IOAPIC_INTERNAL_H */
@@ -69,14 +69,6 @@ static void kvm_ioapic_put(IOAPICCommonState *s)
}
}
-static void kvm_ioapic_reset(DeviceState *dev)
-{
- IOAPICCommonState *s = DO_UPCAST(IOAPICCommonState, busdev.qdev, dev);
-
- ioapic_reset_common(dev);
- kvm_ioapic_put(s);
-}
-
static void kvm_ioapic_set_irq(void *opaque, int irq, int level)
{
KVMIOAPICState *s = opaque;
@@ -106,7 +98,6 @@ static void kvm_ioapic_class_init(ObjectClass *klass, void *data)
k->init = kvm_ioapic_init;
k->get = kvm_ioapic_get;
k->put = kvm_ioapic_put;
- dc->reset = kvm_ioapic_reset;
dc->props = kvm_ioapic_properties;
}
The reset callback of the in-kernel ioapic has to update the kernel state. This can be done for all "models" using ioapic_put. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> --- hw/ioapic.c | 2 -- hw/ioapic_common.c | 2 ++ hw/ioapic_internal.h | 2 -- hw/kvm/ioapic.c | 9 --------- 4 files changed, 2 insertions(+), 13 deletions(-)