From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43654) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gS3wK-0000wT-Q2 for qemu-devel@nongnu.org; Wed, 28 Nov 2018 12:47:59 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gS3t7-0005wl-LW for qemu-devel@nongnu.org; Wed, 28 Nov 2018 12:44:41 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39431) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gS3t7-0005st-EA for qemu-devel@nongnu.org; Wed, 28 Nov 2018 12:44:37 -0500 Date: Wed, 28 Nov 2018 18:44:32 +0100 From: Igor Mammedov Message-ID: <20181128184432.0f8fbac5@redhat.com> In-Reply-To: <20181127092801.21777-15-marcandre.lureau@redhat.com> References: <20181127092801.21777-1-marcandre.lureau@redhat.com> <20181127092801.21777-15-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH for-3.2 v4 14/28] qom: remove unimplemented class_finalize List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?B?TWFyYy1BbmRyw6k=?= Lureau Cc: qemu-devel@nongnu.org, Andreas =?UTF-8?B?RsOkcmJlcg==?= , Eduardo Habkost On Tue, 27 Nov 2018 13:27:47 +0400 Marc-Andr=C3=A9 Lureau wrote: > 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...) >=20 > Signed-off-by: Marc-Andr=C3=A9 Lureau Reviewed-by: Igor Mammedov > --- > include/qom/object.h | 7 ++----- > hw/core/machine.c | 11 ----------- > qom/object.c | 2 -- > 3 files changed, 2 insertions(+), 18 deletions(-) >=20 > 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 itse= lf > * 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 > =20 > 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; > =20 > 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); > } > =20 > -static void machine_class_finalize(ObjectClass *klass, void *data) > -{ > - MachineClass *mc =3D 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 =3D MACHINE_GET_CLASS(machine); > @@ -869,7 +859,6 @@ static const TypeInfo machine_info =3D { > .class_size =3D sizeof(MachineClass), > .class_init =3D machine_class_init, > .class_base_init =3D machine_class_base_init, > - .class_finalize =3D machine_class_finalize, > .instance_size =3D sizeof(MachineState), > .instance_init =3D machine_initfn, > .instance_finalize =3D 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 > =20 > void (*class_init)(ObjectClass *klass, void *data); > void (*class_base_init)(ObjectClass *klass, void *data); > - void (*class_finalize)(ObjectClass *klass, void *data); > =20 > void *class_data; > =20 > @@ -114,7 +113,6 @@ static TypeImpl *type_new(const TypeInfo *info) > =20 > ti->class_init =3D info->class_init; > ti->class_base_init =3D info->class_base_init; > - ti->class_finalize =3D info->class_finalize; > ti->class_data =3D info->class_data; > =20 > ti->instance_init =3D info->instance_init;