[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH for-3.2 v5 06/19] qom: remove unimplemented class_fi
From: |
Marc-André Lureau |
Subject: |
[Qemu-devel] [PATCH for-3.2 v5 06/19] qom: remove unimplemented class_finalize |
Date: |
Tue, 4 Dec 2018 18:20:10 +0400 |
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 <address@hidden>
Reviewed-by: Igor Mammedov <address@hidden>
Reviewed-by: Eduardo Habkost <address@hidden>
---
include/qom/object.h | 7 ++-----
hw/core/machine.c | 11 -----------
qom/object.c | 2 --
3 files changed, 2 insertions(+), 18 deletions(-)
diff --git a/include/qom/object.h b/include/qom/object.h
index f0b0bf39cc..0139838b69 100644
--- a/include/qom/object.h
+++ b/include/qom/object.h
@@ -455,10 +455,8 @@ struct Object
* parent class initialization has occurred, but before the class itself
* is initialized. This is the function to use to undo the effects of
* memcpy from the parent class to the descendants.
- * @class_finalize: This function is called during class destruction and is
- * meant to release and dynamic parameters allocated by @class_init.
- * @class_data: Data to pass to the @class_init, @class_base_init and
- * @class_finalize functions. This can be useful when building dynamic
+ * @class_data: Data to pass to the @class_init,
+ * @class_base_init. This can be useful when building dynamic
* classes.
* @interfaces: The list of interfaces associated with this type. This
* should point to a static array that's terminated with a zero filled
@@ -479,7 +477,6 @@ struct TypeInfo
void (*class_init)(ObjectClass *klass, void *data);
void (*class_base_init)(ObjectClass *klass, void *data);
- void (*class_finalize)(ObjectClass *klass, void *data);
void *class_data;
InterfaceInfo *interfaces;
diff --git a/hw/core/machine.c b/hw/core/machine.c
index da50ad6de7..c51423b647 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -834,16 +834,6 @@ void machine_run_board_init(MachineState *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)
{
MachineClass *mc = MACHINE_GET_CLASS(machine);
@@ -869,7 +859,6 @@ static const TypeInfo machine_info = {
.class_size = sizeof(MachineClass),
.class_init = machine_class_init,
.class_base_init = machine_class_base_init,
- .class_finalize = machine_class_finalize,
.instance_size = sizeof(MachineState),
.instance_init = machine_initfn,
.instance_finalize = machine_finalize,
diff --git a/qom/object.c b/qom/object.c
index eb770dbf7f..17921c0a71 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -49,7 +49,6 @@ struct TypeImpl
void (*class_init)(ObjectClass *klass, void *data);
void (*class_base_init)(ObjectClass *klass, void *data);
- void (*class_finalize)(ObjectClass *klass, void *data);
void *class_data;
@@ -114,7 +113,6 @@ static TypeImpl *type_new(const TypeInfo *info)
ti->class_init = info->class_init;
ti->class_base_init = info->class_base_init;
- ti->class_finalize = info->class_finalize;
ti->class_data = info->class_data;
ti->instance_init = info->instance_init;
--
2.20.0.rc1
- [Qemu-devel] [PATCH for-3.2 v5 00/19] Generalize machine compatibility properties, Marc-André Lureau, 2018/12/04
- [Qemu-devel] [PATCH for-3.2 v5 01/19] tests: qdev_prop_check_globals() doesn't return "all_used", Marc-André Lureau, 2018/12/04
- [Qemu-devel] [PATCH for-3.2 v5 03/19] qom: make user_creatable_complete() specific to UserCreatable, Marc-André Lureau, 2018/12/04
- [Qemu-devel] [PATCH for-3.2 v5 02/19] qom: make interface types abstract, Marc-André Lureau, 2018/12/04
- [Qemu-devel] [PATCH for-3.2 v5 04/19] accel: register global_props like machine globals, Marc-André Lureau, 2018/12/04
- [Qemu-devel] [PATCH for-3.2 v5 05/19] qdev: move qdev_prop_register_global_list() to tests, Marc-André Lureau, 2018/12/04
- [Qemu-devel] [PATCH for-3.2 v5 06/19] qom: remove unimplemented class_finalize,
Marc-André Lureau <=
- [Qemu-devel] [PATCH for-3.2 v5 07/19] hw: apply accel compat properties without touching globals, Marc-André Lureau, 2018/12/04
- Re: [Qemu-devel] [PATCH for-3.2 v5 07/19] hw: apply accel compat properties without touching globals, Igor Mammedov, 2018/12/11
[Qemu-devel] [PATCH for-3.2 v5 09/19] hw: remove SET_MACHINE_COMPAT, Marc-André Lureau, 2018/12/04
[Qemu-devel] [PATCH for-3.2 v5 10/19] qdev: make a separate helper function to apply compat properties, Marc-André Lureau, 2018/12/04
[Qemu-devel] [PATCH for-3.2 v5 11/19] qdev: all globals are now user-provided, Marc-André Lureau, 2018/12/04