i8259: move TYPE_INTERRUPT_STATS_PROVIDER upper
Now both classes (i8259, i8259-kvm) support this. Move this upper to the common class code. Signed-off-by: Peter Xu <peterx@redhat.com> Message-Id: <20171210063819.14892-6-peterx@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
e267d16496
commit
b8c7723440
@ -140,15 +140,12 @@ static void kvm_i8259_class_init(ObjectClass *klass, void *data)
|
|||||||
KVMPICClass *kpc = KVM_PIC_CLASS(klass);
|
KVMPICClass *kpc = KVM_PIC_CLASS(klass);
|
||||||
PICCommonClass *k = PIC_COMMON_CLASS(klass);
|
PICCommonClass *k = PIC_COMMON_CLASS(klass);
|
||||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||||
InterruptStatsProviderClass *ic = INTERRUPT_STATS_PROVIDER_CLASS(klass);
|
|
||||||
|
|
||||||
dc->reset = kvm_pic_reset;
|
dc->reset = kvm_pic_reset;
|
||||||
kpc->parent_realize = dc->realize;
|
kpc->parent_realize = dc->realize;
|
||||||
dc->realize = kvm_pic_realize;
|
dc->realize = kvm_pic_realize;
|
||||||
k->pre_save = kvm_pic_get;
|
k->pre_save = kvm_pic_get;
|
||||||
k->post_load = kvm_pic_put;
|
k->post_load = kvm_pic_put;
|
||||||
ic->get_statistics = pic_get_statistics;
|
|
||||||
ic->print_info = pic_print_info;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo kvm_i8259_info = {
|
static const TypeInfo kvm_i8259_info = {
|
||||||
@ -157,10 +154,6 @@ static const TypeInfo kvm_i8259_info = {
|
|||||||
.instance_size = sizeof(PICCommonState),
|
.instance_size = sizeof(PICCommonState),
|
||||||
.class_init = kvm_i8259_class_init,
|
.class_init = kvm_i8259_class_init,
|
||||||
.class_size = sizeof(KVMPICClass),
|
.class_size = sizeof(KVMPICClass),
|
||||||
.interfaces = (InterfaceInfo[]) {
|
|
||||||
{ TYPE_INTERRUPT_STATS_PROVIDER },
|
|
||||||
{ }
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static void kvm_pic_register_types(void)
|
static void kvm_pic_register_types(void)
|
||||||
|
@ -442,13 +442,10 @@ static void i8259_class_init(ObjectClass *klass, void *data)
|
|||||||
{
|
{
|
||||||
PICClass *k = PIC_CLASS(klass);
|
PICClass *k = PIC_CLASS(klass);
|
||||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||||
InterruptStatsProviderClass *ic = INTERRUPT_STATS_PROVIDER_CLASS(klass);
|
|
||||||
|
|
||||||
k->parent_realize = dc->realize;
|
k->parent_realize = dc->realize;
|
||||||
dc->realize = pic_realize;
|
dc->realize = pic_realize;
|
||||||
dc->reset = pic_reset;
|
dc->reset = pic_reset;
|
||||||
ic->get_statistics = pic_get_statistics;
|
|
||||||
ic->print_info = pic_print_info;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo i8259_info = {
|
static const TypeInfo i8259_info = {
|
||||||
@ -457,10 +454,6 @@ static const TypeInfo i8259_info = {
|
|||||||
.parent = TYPE_PIC_COMMON,
|
.parent = TYPE_PIC_COMMON,
|
||||||
.class_init = i8259_class_init,
|
.class_init = i8259_class_init,
|
||||||
.class_size = sizeof(PICClass),
|
.class_size = sizeof(PICClass),
|
||||||
.interfaces = (InterfaceInfo[]) {
|
|
||||||
{ TYPE_INTERRUPT_STATS_PROVIDER },
|
|
||||||
{ }
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static void pic_register_types(void)
|
static void pic_register_types(void)
|
||||||
|
@ -178,6 +178,7 @@ static Property pic_properties_common[] = {
|
|||||||
static void pic_common_class_init(ObjectClass *klass, void *data)
|
static void pic_common_class_init(ObjectClass *klass, void *data)
|
||||||
{
|
{
|
||||||
DeviceClass *dc = DEVICE_CLASS(klass);
|
DeviceClass *dc = DEVICE_CLASS(klass);
|
||||||
|
InterruptStatsProviderClass *ic = INTERRUPT_STATS_PROVIDER_CLASS(klass);
|
||||||
|
|
||||||
dc->vmsd = &vmstate_pic_common;
|
dc->vmsd = &vmstate_pic_common;
|
||||||
dc->props = pic_properties_common;
|
dc->props = pic_properties_common;
|
||||||
@ -189,6 +190,8 @@ static void pic_common_class_init(ObjectClass *klass, void *data)
|
|||||||
* code.
|
* code.
|
||||||
*/
|
*/
|
||||||
dc->user_creatable = false;
|
dc->user_creatable = false;
|
||||||
|
ic->get_statistics = pic_get_statistics;
|
||||||
|
ic->print_info = pic_print_info;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const TypeInfo pic_common_type = {
|
static const TypeInfo pic_common_type = {
|
||||||
@ -198,6 +201,10 @@ static const TypeInfo pic_common_type = {
|
|||||||
.class_size = sizeof(PICCommonClass),
|
.class_size = sizeof(PICCommonClass),
|
||||||
.class_init = pic_common_class_init,
|
.class_init = pic_common_class_init,
|
||||||
.abstract = true,
|
.abstract = true,
|
||||||
|
.interfaces = (InterfaceInfo[]) {
|
||||||
|
{ TYPE_INTERRUPT_STATS_PROVIDER },
|
||||||
|
{ }
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
static void pic_common_register_types(void)
|
static void pic_common_register_types(void)
|
||||||
|
Loading…
Reference in New Issue
Block a user