qom: remove unimplemented class_finalize

Instead of trying to implement something that isn't well specified,
remove it. (it would be tricky to implement, since a class struct is
memcpy on children types...)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Reviewed-by: Eduardo Habkost <ehabkost@redhat.com>
Message-Id: <20181204142023.15982-7-marcandre.lureau@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
Marc-André Lureau 2018-12-04 18:20:10 +04:00 committed by Eduardo Habkost
parent e6add65b9c
commit 37fdb2c56c
3 changed files with 2 additions and 18 deletions

View File

@ -834,16 +834,6 @@ void machine_run_board_init(MachineState *machine)
machine_class->init(machine); machine_class->init(machine);
} }
static void machine_class_finalize(ObjectClass *klass, void *data)
{
MachineClass *mc = MACHINE_CLASS(klass);
if (mc->compat_props) {
g_array_free(mc->compat_props, true);
}
g_free(mc->name);
}
void machine_register_compat_props(MachineState *machine) void machine_register_compat_props(MachineState *machine)
{ {
MachineClass *mc = MACHINE_GET_CLASS(machine); MachineClass *mc = MACHINE_GET_CLASS(machine);
@ -869,7 +859,6 @@ static const TypeInfo machine_info = {
.class_size = sizeof(MachineClass), .class_size = sizeof(MachineClass),
.class_init = machine_class_init, .class_init = machine_class_init,
.class_base_init = machine_class_base_init, .class_base_init = machine_class_base_init,
.class_finalize = machine_class_finalize,
.instance_size = sizeof(MachineState), .instance_size = sizeof(MachineState),
.instance_init = machine_initfn, .instance_init = machine_initfn,
.instance_finalize = machine_finalize, .instance_finalize = machine_finalize,

View File

@ -454,10 +454,8 @@ struct Object
* parent class initialization has occurred, but before the class itself * parent class initialization has occurred, but before the class itself
* is initialized. This is the function to use to undo the effects of * is initialized. This is the function to use to undo the effects of
* memcpy from the parent class to the descendants. * memcpy from the parent class to the descendants.
* @class_finalize: This function is called during class destruction and is * @class_data: Data to pass to the @class_init,
* meant to release and dynamic parameters allocated by @class_init. * @class_base_init. This can be useful when building dynamic
* @class_data: Data to pass to the @class_init, @class_base_init and
* @class_finalize functions. This can be useful when building dynamic
* classes. * classes.
* @interfaces: The list of interfaces associated with this type. This * @interfaces: The list of interfaces associated with this type. This
* should point to a static array that's terminated with a zero filled * should point to a static array that's terminated with a zero filled
@ -478,7 +476,6 @@ struct TypeInfo
void (*class_init)(ObjectClass *klass, void *data); void (*class_init)(ObjectClass *klass, void *data);
void (*class_base_init)(ObjectClass *klass, void *data); void (*class_base_init)(ObjectClass *klass, void *data);
void (*class_finalize)(ObjectClass *klass, void *data);
void *class_data; void *class_data;
InterfaceInfo *interfaces; InterfaceInfo *interfaces;

View File

@ -49,7 +49,6 @@ struct TypeImpl
void (*class_init)(ObjectClass *klass, void *data); void (*class_init)(ObjectClass *klass, void *data);
void (*class_base_init)(ObjectClass *klass, void *data); void (*class_base_init)(ObjectClass *klass, void *data);
void (*class_finalize)(ObjectClass *klass, void *data);
void *class_data; void *class_data;
@ -114,7 +113,6 @@ static TypeImpl *type_new(const TypeInfo *info)
ti->class_init = info->class_init; ti->class_init = info->class_init;
ti->class_base_init = info->class_base_init; ti->class_base_init = info->class_base_init;
ti->class_finalize = info->class_finalize;
ti->class_data = info->class_data; ti->class_data = info->class_data;
ti->instance_init = info->instance_init; ti->instance_init = info->instance_init;