Received: from eggs.gnu.org ([2001:4830:134:3::10]:46678) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPQoP-0000tL-OE for qemu-devel@nongnu.org; Tue, 19 Jul 2016 04:55:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bPQoN-0007gj-J2 for qemu-devel@nongnu.org; Tue, 19 Jul 2016 04:55:32 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50252) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bPQoN-0007gf-B0 for qemu-devel@nongnu.org; Tue, 19 Jul 2016 04:55:31 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D90067304C for ; Tue, 19 Jul 2016 08:55:30 +0000 (UTC) From: marcandre.lureau@redhat.com Date: Tue, 19 Jul 2016 12:54:12 +0400 Message-Id: <20160719085432.4572-18-marcandre.lureau@redhat.com> In-Reply-To: <20160719085432.4572-1-marcandre.lureau@redhat.com> References: <20160719085432.4572-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 17/37] machine: use class base init generated name List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= From: Marc-Andr=C3=A9 Lureau Remove machine class name initialization from DEFINE_PC_MACHINE, rely on class base init name generation instead. Get rid of some leaks that way. Signed-off-by: Marc-Andr=C3=A9 Lureau --- hw/core/machine.c | 1 + include/hw/boards.h | 2 +- include/hw/i386/pc.h | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/core/machine.c b/hw/core/machine.c index 2fe6ff6..07a7a97 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -558,6 +558,7 @@ static void machine_class_finalize(ObjectClass *klass= , void *data) if (mc->compat_props) { g_array_free(mc->compat_props, true); } + g_free(mc->name); } =20 void machine_register_compat_props(MachineState *machine) diff --git a/include/hw/boards.h b/include/hw/boards.h index 3e69eca..e46a744 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -93,7 +93,7 @@ struct MachineClass { /*< public >*/ =20 const char *family; /* NULL iff @name identifies a standalone machty= pe */ - const char *name; + char *name; const char *alias; const char *desc; =20 diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index fad0873..54e0341 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -889,7 +889,6 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64= _t *); { \ MachineClass *mc =3D MACHINE_CLASS(oc); \ optsfn(mc); \ - mc->name =3D namestr; \ mc->init =3D initfn; \ } \ static const TypeInfo pc_machine_type_##suffix =3D { \ --=20 2.9.0