From nobody Thu Apr 25 07:02:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544043988535918.0118630403076; Wed, 5 Dec 2018 13:06:28 -0800 (PST) Received: from localhost ([::1]:36847 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUeNH-0007fZ-AU for importer@patchew.org; Wed, 05 Dec 2018 16:06:27 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58990) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUeFy-0007va-5Z for qemu-devel@nongnu.org; Wed, 05 Dec 2018 15:58:55 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gUeFx-0002AM-6d for qemu-devel@nongnu.org; Wed, 05 Dec 2018 15:58:54 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47154) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gUeFr-0001xz-Hk; Wed, 05 Dec 2018 15:58:47 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B338A30820F3; Wed, 5 Dec 2018 20:58:46 +0000 (UTC) Received: from localhost (ovpn-116-33.gru2.redhat.com [10.97.116.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id D38885C7C0; Wed, 5 Dec 2018 20:58:38 +0000 (UTC) From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Wed, 5 Dec 2018 18:58:23 -0200 Message-Id: <20181205205827.19387-2-ehabkost@redhat.com> In-Reply-To: <20181205205827.19387-1-ehabkost@redhat.com> References: <20181205205827.19387-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.47]); Wed, 05 Dec 2018 20:58:46 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH for-4.0 1/5] virt: Eliminate separate instance_init functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , "Michael S. Tsirkin" , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , Richard Henderson , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" All instance_init functions for all virt machine-types run exactly the same code, so we don't need separate functions. We only need to set instance_init for TYPE_VIRT_MACHINE. Signed-off-by: Eduardo Habkost Reviewed-by: Peter Maydell --- hw/arm/virt.c | 87 +++++++++++++-------------------------------------- 1 file changed, 21 insertions(+), 66 deletions(-) diff --git a/hw/arm/virt.c b/hw/arm/virt.c index beaf6bc439..17f1b49d11 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -74,7 +74,6 @@ static const TypeInfo machvirt_##major##_##minor##_info =3D { \ .name =3D MACHINE_TYPE_NAME("virt-" # major "." # minor), \ .parent =3D TYPE_VIRT_MACHINE, \ - .instance_init =3D virt_##major##_##minor##_instance_init, \ .class_init =3D virt_##major##_##minor##_class_init, \ }; \ static void machvirt_machine_##major##_##minor##_init(void) \ @@ -1778,26 +1777,7 @@ static void virt_machine_class_init(ObjectClass *oc,= void *data) hc->plug =3D virt_machine_device_plug_cb; } =20 -static const TypeInfo virt_machine_info =3D { - .name =3D TYPE_VIRT_MACHINE, - .parent =3D TYPE_MACHINE, - .abstract =3D true, - .instance_size =3D sizeof(VirtMachineState), - .class_size =3D sizeof(VirtMachineClass), - .class_init =3D virt_machine_class_init, - .interfaces =3D (InterfaceInfo[]) { - { TYPE_HOTPLUG_HANDLER }, - { } - }, -}; - -static void machvirt_machine_init(void) -{ - type_register_static(&virt_machine_info); -} -type_init(machvirt_machine_init); - -static void virt_4_0_instance_init(Object *obj) +static void virt_instance_init(Object *obj) { VirtMachineState *vms =3D VIRT_MACHINE(obj); VirtMachineClass *vmc =3D VIRT_MACHINE_GET_CLASS(vms); @@ -1867,6 +1847,26 @@ static void virt_4_0_instance_init(Object *obj) vms->irqmap =3D a15irqmap; } =20 +static const TypeInfo virt_machine_info =3D { + .name =3D TYPE_VIRT_MACHINE, + .parent =3D TYPE_MACHINE, + .abstract =3D true, + .instance_size =3D sizeof(VirtMachineState), + .class_size =3D sizeof(VirtMachineClass), + .class_init =3D virt_machine_class_init, + .instance_init =3D virt_instance_init, + .interfaces =3D (InterfaceInfo[]) { + { TYPE_HOTPLUG_HANDLER }, + { } + }, +}; + +static void machvirt_machine_init(void) +{ + type_register_static(&virt_machine_info); +} +type_init(machvirt_machine_init); + static void virt_machine_4_0_options(MachineClass *mc) { } @@ -1875,11 +1875,6 @@ DEFINE_VIRT_MACHINE_AS_LATEST(4, 0) #define VIRT_COMPAT_3_1 \ HW_COMPAT_3_1 =20 -static void virt_3_1_instance_init(Object *obj) -{ - virt_4_0_instance_init(obj); -} - static void virt_machine_3_1_options(MachineClass *mc) { virt_machine_4_0_options(mc); @@ -1890,11 +1885,6 @@ DEFINE_VIRT_MACHINE(3, 1) #define VIRT_COMPAT_3_0 \ HW_COMPAT_3_0 =20 -static void virt_3_0_instance_init(Object *obj) -{ - virt_3_1_instance_init(obj); -} - static void virt_machine_3_0_options(MachineClass *mc) { virt_machine_3_1_options(mc); @@ -1905,11 +1895,6 @@ DEFINE_VIRT_MACHINE(3, 0) #define VIRT_COMPAT_2_12 \ HW_COMPAT_2_12 =20 -static void virt_2_12_instance_init(Object *obj) -{ - virt_3_0_instance_init(obj); -} - static void virt_machine_2_12_options(MachineClass *mc) { VirtMachineClass *vmc =3D VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); @@ -1924,11 +1909,6 @@ DEFINE_VIRT_MACHINE(2, 12) #define VIRT_COMPAT_2_11 \ HW_COMPAT_2_11 =20 -static void virt_2_11_instance_init(Object *obj) -{ - virt_2_12_instance_init(obj); -} - static void virt_machine_2_11_options(MachineClass *mc) { VirtMachineClass *vmc =3D VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); @@ -1942,11 +1922,6 @@ DEFINE_VIRT_MACHINE(2, 11) #define VIRT_COMPAT_2_10 \ HW_COMPAT_2_10 =20 -static void virt_2_10_instance_init(Object *obj) -{ - virt_2_11_instance_init(obj); -} - static void virt_machine_2_10_options(MachineClass *mc) { virt_machine_2_11_options(mc); @@ -1959,11 +1934,6 @@ DEFINE_VIRT_MACHINE(2, 10) #define VIRT_COMPAT_2_9 \ HW_COMPAT_2_9 =20 -static void virt_2_9_instance_init(Object *obj) -{ - virt_2_10_instance_init(obj); -} - static void virt_machine_2_9_options(MachineClass *mc) { virt_machine_2_10_options(mc); @@ -1974,11 +1944,6 @@ DEFINE_VIRT_MACHINE(2, 9) #define VIRT_COMPAT_2_8 \ HW_COMPAT_2_8 =20 -static void virt_2_8_instance_init(Object *obj) -{ - virt_2_9_instance_init(obj); -} - static void virt_machine_2_8_options(MachineClass *mc) { VirtMachineClass *vmc =3D VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); @@ -1995,11 +1960,6 @@ DEFINE_VIRT_MACHINE(2, 8) #define VIRT_COMPAT_2_7 \ HW_COMPAT_2_7 =20 -static void virt_2_7_instance_init(Object *obj) -{ - virt_2_8_instance_init(obj); -} - static void virt_machine_2_7_options(MachineClass *mc) { VirtMachineClass *vmc =3D VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); @@ -2016,11 +1976,6 @@ DEFINE_VIRT_MACHINE(2, 7) #define VIRT_COMPAT_2_6 \ HW_COMPAT_2_6 =20 -static void virt_2_6_instance_init(Object *obj) -{ - virt_2_7_instance_init(obj); -} - static void virt_machine_2_6_options(MachineClass *mc) { VirtMachineClass *vmc =3D VIRT_MACHINE_CLASS(OBJECT_CLASS(mc)); --=20 2.18.0.rc1.1.g3f1ff2140 From nobody Thu Apr 25 07:02:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544043680863248.97569253252368; Wed, 5 Dec 2018 13:01:20 -0800 (PST) Received: from localhost ([::1]:36809 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUeIJ-00017A-H9 for importer@patchew.org; Wed, 05 Dec 2018 16:01:19 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59033) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUeG0-0007xn-F4 for qemu-devel@nongnu.org; Wed, 05 Dec 2018 15:58:57 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gUeFz-0002Cb-QP for qemu-devel@nongnu.org; Wed, 05 Dec 2018 15:58:56 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57456) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gUeFx-0002AE-MX; Wed, 05 Dec 2018 15:58:53 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E2989309702F; Wed, 5 Dec 2018 20:58:52 +0000 (UTC) Received: from localhost (ovpn-116-33.gru2.redhat.com [10.97.116.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1E3751001F54; Wed, 5 Dec 2018 20:58:47 +0000 (UTC) From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Wed, 5 Dec 2018 18:58:24 -0200 Message-Id: <20181205205827.19387-3-ehabkost@redhat.com> In-Reply-To: <20181205205827.19387-1-ehabkost@redhat.com> References: <20181205205827.19387-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.43]); Wed, 05 Dec 2018 20:58:53 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH for-4.0 2/5] spapr: Use default_machine_opts to set use_hotplug_event_source X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , "Michael S. Tsirkin" , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , Richard Henderson , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Instead of setting use_hotplug_event_source at instance_init time, set default_machine_opts on spapr_machine_2_7_class_options() to implement equivalent behavior. This will let us eliminate the need for separate instance_init functions for each spapr machine-type. Signed-off-by: Eduardo Habkost Acked-by: David Gibson --- hw/ppc/spapr.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 80d8498867..f6b60e6fbd 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -4240,10 +4240,7 @@ static void phb_placement_2_7(sPAPRMachineState *spa= pr, uint32_t index, =20 static void spapr_machine_2_7_instance_options(MachineState *machine) { - sPAPRMachineState *spapr =3D SPAPR_MACHINE(machine); - spapr_machine_2_8_instance_options(machine); - spapr->use_hotplug_event_source =3D false; } =20 static void spapr_machine_2_7_class_options(MachineClass *mc) @@ -4252,6 +4249,7 @@ static void spapr_machine_2_7_class_options(MachineCl= ass *mc) =20 spapr_machine_2_8_class_options(mc); mc->default_cpu_type =3D POWERPC_CPU_TYPE_NAME("power7_v2.3"); + mc->default_machine_opts =3D "modern-hotplug-events=3Doff"; SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_7); smc->phb_placement =3D phb_placement_2_7; } --=20 2.18.0.rc1.1.g3f1ff2140 From nobody Thu Apr 25 07:02:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544043716589256.60033937561934; Wed, 5 Dec 2018 13:01:56 -0800 (PST) Received: from localhost ([::1]:36818 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUeIt-0001cE-DJ for importer@patchew.org; Wed, 05 Dec 2018 16:01:55 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59278) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUeGC-00085X-7G for qemu-devel@nongnu.org; Wed, 05 Dec 2018 15:59:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gUeGB-0002jv-Ey for qemu-devel@nongnu.org; Wed, 05 Dec 2018 15:59:08 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41734) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gUeG6-0002YK-H9; Wed, 05 Dec 2018 15:59:02 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B14C53083394; Wed, 5 Dec 2018 20:59:01 +0000 (UTC) Received: from localhost (ovpn-116-33.gru2.redhat.com [10.97.116.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 64AD3194B3; Wed, 5 Dec 2018 20:58:54 +0000 (UTC) From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Wed, 5 Dec 2018 18:58:25 -0200 Message-Id: <20181205205827.19387-4-ehabkost@redhat.com> In-Reply-To: <20181205205827.19387-1-ehabkost@redhat.com> References: <20181205205827.19387-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Wed, 05 Dec 2018 20:59:01 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH for-4.0 3/5] spapr: Use default_machine_opts to set suppress_vmdesc X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , "Michael S. Tsirkin" , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , Richard Henderson , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Instead of setting suppress_vmdesc at instance_init time, set default_machine_opts on spapr_machine_2_2_class_options() to implement equivalent behavior. This will let us eliminate the need for separate instance_init functions for each spapr machine-type. Signed-off-by: Eduardo Habkost Acked-by: David Gibson --- hw/ppc/spapr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index f6b60e6fbd..0c3b27a8cc 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -4368,13 +4368,13 @@ DEFINE_SPAPR_MACHINE(2_3, "2.3", false); static void spapr_machine_2_2_instance_options(MachineState *machine) { spapr_machine_2_3_instance_options(machine); - machine->suppress_vmdesc =3D true; } =20 static void spapr_machine_2_2_class_options(MachineClass *mc) { spapr_machine_2_3_class_options(mc); SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_2); + mc->default_machine_opts =3D "modern-hotplug-events=3Doff,suppress-vmd= esc=3Don"; } DEFINE_SPAPR_MACHINE(2_2, "2.2", false); =20 --=20 2.18.0.rc1.1.g3f1ff2140 From nobody Thu Apr 25 07:02:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544043882757242.44913710663866; Wed, 5 Dec 2018 13:04:42 -0800 (PST) Received: from localhost ([::1]:36830 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUeLZ-0006PI-JI for importer@patchew.org; Wed, 05 Dec 2018 16:04:41 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59444) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUeGS-0008Ju-6e for qemu-devel@nongnu.org; Wed, 05 Dec 2018 15:59:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gUeGN-0003au-Mz for qemu-devel@nongnu.org; Wed, 05 Dec 2018 15:59:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:54176) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gUeGG-0002vG-6G; Wed, 05 Dec 2018 15:59:12 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C8DFF89AC1; Wed, 5 Dec 2018 20:59:09 +0000 (UTC) Received: from localhost (ovpn-116-33.gru2.redhat.com [10.97.116.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 701DF5C5E0; Wed, 5 Dec 2018 20:59:02 +0000 (UTC) From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Wed, 5 Dec 2018 18:58:26 -0200 Message-Id: <20181205205827.19387-5-ehabkost@redhat.com> In-Reply-To: <20181205205827.19387-1-ehabkost@redhat.com> References: <20181205205827.19387-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 05 Dec 2018 20:59:09 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH for-4.0 4/5] spapr: Delete instance_options functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , "Michael S. Tsirkin" , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , Richard Henderson , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Now that all instance_options functions for spapr are empty, delete them. Signed-off-by: Eduardo Habkost Acked-by: David Gibson --- hw/ppc/spapr.c | 85 -------------------------------------------------- 1 file changed, 85 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 0c3b27a8cc..523e5d83f8 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -3939,16 +3939,10 @@ static const TypeInfo spapr_machine_info =3D { mc->is_default =3D 1; \ } \ } \ - static void spapr_machine_##suffix##_instance_init(Object *obj) \ - { \ - MachineState *machine =3D MACHINE(obj); \ - spapr_machine_##suffix##_instance_options(machine); \ - } \ static const TypeInfo spapr_machine_##suffix##_info =3D { \ .name =3D MACHINE_TYPE_NAME("pseries-" verstr), \ .parent =3D TYPE_SPAPR_MACHINE, \ .class_init =3D spapr_machine_##suffix##_class_init, \ - .instance_init =3D spapr_machine_##suffix##_instance_init, \ }; \ static void spapr_machine_register_##suffix(void) \ { \ @@ -3959,10 +3953,6 @@ static const TypeInfo spapr_machine_info =3D { /* * pseries-4.0 */ -static void spapr_machine_4_0_instance_options(MachineState *machine) -{ -} - static void spapr_machine_4_0_class_options(MachineClass *mc) { /* Defaults for the latest behaviour inherited from the base class */ @@ -3976,11 +3966,6 @@ DEFINE_SPAPR_MACHINE(4_0, "4.0", true); #define SPAPR_COMPAT_3_1 \ HW_COMPAT_3_1 =20 -static void spapr_machine_3_1_instance_options(MachineState *machine) -{ - spapr_machine_4_0_instance_options(machine); -} - static void spapr_machine_3_1_class_options(MachineClass *mc) { spapr_machine_3_1_class_options(mc); @@ -3995,11 +3980,6 @@ DEFINE_SPAPR_MACHINE(3_1, "3.1", false); #define SPAPR_COMPAT_3_0 \ HW_COMPAT_3_0 =20 -static void spapr_machine_3_0_instance_options(MachineState *machine) -{ - spapr_machine_3_1_instance_options(machine); -} - static void spapr_machine_3_0_class_options(MachineClass *mc) { sPAPRMachineClass *smc =3D SPAPR_MACHINE_CLASS(mc); @@ -4029,11 +4009,6 @@ DEFINE_SPAPR_MACHINE(3_0, "3.0", false); .value =3D "on", \ }, =20 -static void spapr_machine_2_12_instance_options(MachineState *machine) -{ - spapr_machine_3_0_instance_options(machine); -} - static void spapr_machine_2_12_class_options(MachineClass *mc) { sPAPRMachineClass *smc =3D SPAPR_MACHINE_CLASS(mc); @@ -4051,11 +4026,6 @@ static void spapr_machine_2_12_class_options(Machine= Class *mc) =20 DEFINE_SPAPR_MACHINE(2_12, "2.12", false); =20 -static void spapr_machine_2_12_sxxm_instance_options(MachineState *machine) -{ - spapr_machine_2_12_instance_options(machine); -} - static void spapr_machine_2_12_sxxm_class_options(MachineClass *mc) { sPAPRMachineClass *smc =3D SPAPR_MACHINE_CLASS(mc); @@ -4074,11 +4044,6 @@ DEFINE_SPAPR_MACHINE(2_12_sxxm, "2.12-sxxm", false); #define SPAPR_COMPAT_2_11 \ HW_COMPAT_2_11 =20 -static void spapr_machine_2_11_instance_options(MachineState *machine) -{ - spapr_machine_2_12_instance_options(machine); -} - static void spapr_machine_2_11_class_options(MachineClass *mc) { sPAPRMachineClass *smc =3D SPAPR_MACHINE_CLASS(mc); @@ -4096,11 +4061,6 @@ DEFINE_SPAPR_MACHINE(2_11, "2.11", false); #define SPAPR_COMPAT_2_10 \ HW_COMPAT_2_10 =20 -static void spapr_machine_2_10_instance_options(MachineState *machine) -{ - spapr_machine_2_11_instance_options(machine); -} - static void spapr_machine_2_10_class_options(MachineClass *mc) { spapr_machine_2_11_class_options(mc); @@ -4120,11 +4080,6 @@ DEFINE_SPAPR_MACHINE(2_10, "2.10", false); .value =3D "on", \ }, \ =20 -static void spapr_machine_2_9_instance_options(MachineState *machine) -{ - spapr_machine_2_10_instance_options(machine); -} - static void spapr_machine_2_9_class_options(MachineClass *mc) { sPAPRMachineClass *smc =3D SPAPR_MACHINE_CLASS(mc); @@ -4149,11 +4104,6 @@ DEFINE_SPAPR_MACHINE(2_9, "2.9", false); .value =3D "off", \ }, =20 -static void spapr_machine_2_8_instance_options(MachineState *machine) -{ - spapr_machine_2_9_instance_options(machine); -} - static void spapr_machine_2_8_class_options(MachineClass *mc) { spapr_machine_2_9_class_options(mc); @@ -4238,11 +4188,6 @@ static void phb_placement_2_7(sPAPRMachineState *spa= pr, uint32_t index, */ } =20 -static void spapr_machine_2_7_instance_options(MachineState *machine) -{ - spapr_machine_2_8_instance_options(machine); -} - static void spapr_machine_2_7_class_options(MachineClass *mc) { sPAPRMachineClass *smc =3D SPAPR_MACHINE_CLASS(mc); @@ -4267,11 +4212,6 @@ DEFINE_SPAPR_MACHINE(2_7, "2.7", false); .value =3D stringify(off),\ }, =20 -static void spapr_machine_2_6_instance_options(MachineState *machine) -{ - spapr_machine_2_7_instance_options(machine); -} - static void spapr_machine_2_6_class_options(MachineClass *mc) { spapr_machine_2_7_class_options(mc); @@ -4292,11 +4232,6 @@ DEFINE_SPAPR_MACHINE(2_6, "2.6", false); .value =3D "off", \ }, =20 -static void spapr_machine_2_5_instance_options(MachineState *machine) -{ - spapr_machine_2_6_instance_options(machine); -} - static void spapr_machine_2_5_class_options(MachineClass *mc) { sPAPRMachineClass *smc =3D SPAPR_MACHINE_CLASS(mc); @@ -4314,11 +4249,6 @@ DEFINE_SPAPR_MACHINE(2_5, "2.5", false); #define SPAPR_COMPAT_2_4 \ HW_COMPAT_2_4 =20 -static void spapr_machine_2_4_instance_options(MachineState *machine) -{ - spapr_machine_2_5_instance_options(machine); -} - static void spapr_machine_2_4_class_options(MachineClass *mc) { sPAPRMachineClass *smc =3D SPAPR_MACHINE_CLASS(mc); @@ -4341,11 +4271,6 @@ DEFINE_SPAPR_MACHINE(2_4, "2.4", false); .value =3D "off",\ }, =20 -static void spapr_machine_2_3_instance_options(MachineState *machine) -{ - spapr_machine_2_4_instance_options(machine); -} - static void spapr_machine_2_3_class_options(MachineClass *mc) { spapr_machine_2_4_class_options(mc); @@ -4365,11 +4290,6 @@ DEFINE_SPAPR_MACHINE(2_3, "2.3", false); .value =3D "0x20000000",\ }, =20 -static void spapr_machine_2_2_instance_options(MachineState *machine) -{ - spapr_machine_2_3_instance_options(machine); -} - static void spapr_machine_2_2_class_options(MachineClass *mc) { spapr_machine_2_3_class_options(mc); @@ -4384,11 +4304,6 @@ DEFINE_SPAPR_MACHINE(2_2, "2.2", false); #define SPAPR_COMPAT_2_1 \ HW_COMPAT_2_1 =20 -static void spapr_machine_2_1_instance_options(MachineState *machine) -{ - spapr_machine_2_2_instance_options(machine); -} - static void spapr_machine_2_1_class_options(MachineClass *mc) { spapr_machine_2_2_class_options(mc); --=20 2.18.0.rc1.1.g3f1ff2140 From nobody Thu Apr 25 07:02:11 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1544043869240212.97203505464313; Wed, 5 Dec 2018 13:04:29 -0800 (PST) Received: from localhost ([::1]:36829 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUeLI-0006Eg-Bu for importer@patchew.org; Wed, 05 Dec 2018 16:04:24 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59447) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gUeGS-0008Jv-7a for qemu-devel@nongnu.org; Wed, 05 Dec 2018 15:59:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gUeGN-0003ap-MF for qemu-devel@nongnu.org; Wed, 05 Dec 2018 15:59:24 -0500 Received: from mx1.redhat.com ([209.132.183.28]:24211) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gUeGJ-0003Ft-Up; Wed, 05 Dec 2018 15:59:16 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id C25C372D8A; Wed, 5 Dec 2018 20:59:11 +0000 (UTC) Received: from localhost (ovpn-116-33.gru2.redhat.com [10.97.116.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 41F415C548; Wed, 5 Dec 2018 20:59:11 +0000 (UTC) From: Eduardo Habkost To: qemu-devel@nongnu.org Date: Wed, 5 Dec 2018 18:58:27 -0200 Message-Id: <20181205205827.19387-6-ehabkost@redhat.com> In-Reply-To: <20181205205827.19387-1-ehabkost@redhat.com> References: <20181205205827.19387-1-ehabkost@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Wed, 05 Dec 2018 20:59:11 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH for-4.0 5/5] pc: Use default_machine_opts to set suppress_vmdesc X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Eduardo Habkost , "Michael S. Tsirkin" , qemu-arm@nongnu.org, qemu-ppc@nongnu.org, =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , Richard Henderson , David Gibson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Instead of setting suppress_vmdesc at instance_init time, set default_machine_opts on pc_i440fx_2_2_machine_options() to implement equivalent behavior. This will let us eliminate the need for pc_compat_*() functions for PC machine-types. Signed-off-by: Eduardo Habkost --- hw/i386/pc_piix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index cfaa83ee2f..c1f6f3dfda 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -320,7 +320,6 @@ static void pc_compat_2_3(MachineState *machine) static void pc_compat_2_2(MachineState *machine) { pc_compat_2_3(machine); - machine->suppress_vmdesc =3D true; } =20 static void pc_compat_2_1(MachineState *machine) @@ -571,6 +570,7 @@ static void pc_i440fx_2_2_machine_options(MachineClass = *m) PCMachineClass *pcmc =3D PC_MACHINE_CLASS(m); pc_i440fx_2_3_machine_options(m); m->hw_version =3D "2.2.0"; + m->default_machine_opts =3D "firmware=3Dbios-256k.bin,suppress-vmdesc= =3Don"; SET_MACHINE_COMPAT(m, PC_COMPAT_2_2); pcmc->rsdp_in_ram =3D false; } --=20 2.18.0.rc1.1.g3f1ff2140