@@ -182,6 +182,7 @@ static const TypeInfo isa_superio_type_info = {
.name = TYPE_ISA_SUPERIO,
.parent = TYPE_ISA_DEVICE,
.abstract = true,
+ .instance_size = sizeof(ISASuperIODevice),
.class_size = sizeof(ISASuperIOClass),
.class_init = isa_superio_class_init,
};
@@ -200,7 +201,6 @@ static void fdc37m81x_class_init(ObjectClass *klass, void *data)
static const TypeInfo fdc37m81x_type_info = {
.name = TYPE_FDC37M81X_SUPERIO,
.parent = TYPE_ISA_SUPERIO,
- .instance_size = sizeof(ISASuperIODevice),
.class_init = fdc37m81x_class_init,
};
@@ -103,7 +103,6 @@ static void smc37c669_class_init(ObjectClass *klass, void *data)
static const TypeInfo smc37c669_type_info = {
.name = TYPE_SMC37C669_SUPERIO,
.parent = TYPE_ISA_SUPERIO,
- .instance_size = sizeof(ISASuperIODevice),
.class_size = sizeof(ISASuperIOClass),
.class_init = smc37c669_class_init,
};
@@ -533,7 +533,6 @@ static void vt82c686b_superio_class_init(ObjectClass *klass, void *data)
static const TypeInfo via_superio_info = {
.name = TYPE_VT82C686B_SUPERIO,
.parent = TYPE_ISA_SUPERIO,
- .instance_size = sizeof(ISASuperIODevice),
.class_size = sizeof(ISASuperIOClass),
.class_init = vt82c686b_superio_class_init,
};
Instead of setting the instance size on each implementations, set it on the abstract parent, so we are sure no implementation will forget to set it. Reported-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com> --- See: https://www.mail-archive.com/qemu-devel@nongnu.org/msg731954.html --- hw/isa/isa-superio.c | 2 +- hw/isa/smc37c669-superio.c | 1 - hw/isa/vt82c686.c | 1 - 3 files changed, 1 insertion(+), 3 deletions(-)