From patchwork Fri Jan 4 17:30:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= X-Patchwork-Id: 1020790 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=listsout.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=redhat.com Received: from listsout.gnu.org (listsout.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43WX1J5qVBz9s55 for ; Sat, 5 Jan 2019 04:32:52 +1100 (AEDT) Received: from localhost ([127.0.0.1]:37371 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gfTL0-00047C-IE for incoming@patchwork.ozlabs.org; Fri, 04 Jan 2019 12:32:50 -0500 Received: from eggs.gnu.org ([208.118.235.92]:43999) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gfTJz-0003kl-6q for qemu-devel@nongnu.org; Fri, 04 Jan 2019 12:31:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gfTJw-0001GN-24 for qemu-devel@nongnu.org; Fri, 04 Jan 2019 12:31:47 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42090) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gfTJv-0001Fr-R1 for qemu-devel@nongnu.org; Fri, 04 Jan 2019 12:31:44 -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 35E35A6E1E; Fri, 4 Jan 2019 17:31:43 +0000 (UTC) Received: from localhost (ovpn-112-35.ams2.redhat.com [10.36.112.35]) by smtp.corp.redhat.com (Postfix) with ESMTP id 893BA19C7E; Fri, 4 Jan 2019 17:31:41 +0000 (UTC) From: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= To: qemu-devel@nongnu.org Date: Fri, 4 Jan 2019 21:30:24 +0400 Message-Id: <20190104173042.32714-11-marcandre.lureau@redhat.com> In-Reply-To: <20190104173042.32714-1-marcandre.lureau@redhat.com> References: <20190104173042.32714-1-marcandre.lureau@redhat.com> MIME-Version: 1.0 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.38]); Fri, 04 Jan 2019 17:31:43 +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] [PULL 10/28] compat: replace PC_COMPAT_2_10 & HW_COMPAT_2_10 macros 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@linaro.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Use static arrays instead. Suggested-by: Eduardo Habkost Signed-off-by: Marc-André Lureau Reviewed-by: Igor Mammedov Reviewed-by: Cornelia Huck Acked-by: Eduardo Habkost --- include/hw/boards.h | 3 +++ include/hw/compat.h | 11 ----------- include/hw/i386/pc.h | 17 ++--------------- hw/arm/virt.c | 6 +----- hw/core/machine.c | 13 +++++++++++++ hw/i386/pc.c | 17 +++++++++++++++++ hw/i386/pc_piix.c | 7 ++----- hw/i386/pc_q35.c | 7 ++----- hw/ppc/spapr.c | 6 +----- hw/s390x/s390-virtio-ccw.c | 6 +----- 10 files changed, 42 insertions(+), 51 deletions(-) diff --git a/include/hw/boards.h b/include/hw/boards.h index 67202b5a2f..732eb7bb73 100644 --- a/include/hw/boards.h +++ b/include/hw/boards.h @@ -300,4 +300,7 @@ extern const size_t hw_compat_2_12_len; extern GlobalProperty hw_compat_2_11[]; extern const size_t hw_compat_2_11_len; +extern GlobalProperty hw_compat_2_10[]; +extern const size_t hw_compat_2_10_len; + #endif diff --git a/include/hw/compat.h b/include/hw/compat.h index cf389b4e85..f414786604 100644 --- a/include/hw/compat.h +++ b/include/hw/compat.h @@ -1,17 +1,6 @@ #ifndef HW_COMPAT_H #define HW_COMPAT_H -#define HW_COMPAT_2_10 \ - {\ - .driver = "virtio-mouse-device",\ - .property = "wheel-axis",\ - .value = "false",\ - },{\ - .driver = "virtio-tablet-device",\ - .property = "wheel-axis",\ - .value = "false",\ - }, - #define HW_COMPAT_2_9 \ {\ .driver = "pci-bridge",\ diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index f0f7e76a3e..d77843a711 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -306,21 +306,8 @@ extern const size_t pc_compat_2_12_len; extern GlobalProperty pc_compat_2_11[]; extern const size_t pc_compat_2_11_len; -#define PC_COMPAT_2_10 \ - HW_COMPAT_2_10 \ - {\ - .driver = TYPE_X86_CPU,\ - .property = "x-hv-max-vps",\ - .value = "0x40",\ - },{\ - .driver = "i440FX-pcihost",\ - .property = "x-pci-hole64-fix",\ - .value = "off",\ - },{\ - .driver = "q35-pcihost",\ - .property = "x-pci-hole64-fix",\ - .value = "off",\ - }, +extern GlobalProperty pc_compat_2_10[]; +extern const size_t pc_compat_2_10_len; #define PC_COMPAT_2_9 \ HW_COMPAT_2_9 \ diff --git a/hw/arm/virt.c b/hw/arm/virt.c index 548b6efa93..75ab14305a 100644 --- a/hw/arm/virt.c +++ b/hw/arm/virt.c @@ -1909,12 +1909,8 @@ DEFINE_VIRT_MACHINE(2, 11) static void virt_machine_2_10_options(MachineClass *mc) { - static GlobalProperty compat[] = { - HW_COMPAT_2_10 - }; - virt_machine_2_11_options(mc); - compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); + compat_props_add(mc->compat_props, hw_compat_2_10, hw_compat_2_10_len); /* before 2.11 we never faulted accesses to bad addresses */ mc->ignore_memory_transaction_failures = true; } diff --git a/hw/core/machine.c b/hw/core/machine.c index 41f37ee4d4..7673454a66 100644 --- a/hw/core/machine.c +++ b/hw/core/machine.c @@ -88,6 +88,19 @@ GlobalProperty hw_compat_2_11[] = { }; const size_t hw_compat_2_11_len = G_N_ELEMENTS(hw_compat_2_11); +GlobalProperty hw_compat_2_10[] = { + { + .driver = "virtio-mouse-device", + .property = "wheel-axis", + .value = "false", + },{ + .driver = "virtio-tablet-device", + .property = "wheel-axis", + .value = "false", + }, +}; +const size_t hw_compat_2_10_len = G_N_ELEMENTS(hw_compat_2_10); + static char *machine_get_accel(Object *obj, Error **errp) { MachineState *ms = MACHINE(obj); diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 563ba90202..c0bb82c454 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -169,6 +169,23 @@ GlobalProperty pc_compat_2_11[] = { }; const size_t pc_compat_2_11_len = G_N_ELEMENTS(pc_compat_2_11); +GlobalProperty pc_compat_2_10[] = { + { + .driver = TYPE_X86_CPU, + .property = "x-hv-max-vps", + .value = "0x40", + },{ + .driver = "i440FX-pcihost", + .property = "x-pci-hole64-fix", + .value = "off", + },{ + .driver = "q35-pcihost", + .property = "x-pci-hole64-fix", + .value = "off", + }, +}; +const size_t pc_compat_2_10_len = G_N_ELEMENTS(pc_compat_2_10); + void gsi_handler(void *opaque, int n, int level) { GSIState *s = opaque; diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index aeb51a2772..aea678dc91 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -482,12 +482,9 @@ DEFINE_I440FX_MACHINE(v2_11, "pc-i440fx-2.11", NULL, static void pc_i440fx_2_10_machine_options(MachineClass *m) { - static GlobalProperty compat[] = { - PC_COMPAT_2_10 - }; - pc_i440fx_2_11_machine_options(m); - compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); + compat_props_add(m->compat_props, hw_compat_2_10, hw_compat_2_10_len); + compat_props_add(m->compat_props, pc_compat_2_10, pc_compat_2_10_len); m->auto_enable_numa_with_memhp = false; } diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index fd3187003a..a9c4fc27e4 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -368,12 +368,9 @@ DEFINE_Q35_MACHINE(v2_11, "pc-q35-2.11", NULL, static void pc_q35_2_10_machine_options(MachineClass *m) { - static GlobalProperty compat[] = { - PC_COMPAT_2_10 - }; - pc_q35_2_11_machine_options(m); - compat_props_add(m->compat_props, compat, G_N_ELEMENTS(compat)); + compat_props_add(m->compat_props, hw_compat_2_10, hw_compat_2_10_len); + compat_props_add(m->compat_props, pc_compat_2_10, pc_compat_2_10_len); m->numa_auto_assign_ram = numa_legacy_auto_assign_ram; m->auto_enable_numa_with_memhp = false; } diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 9afa22fd13..483a1373df 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -4113,12 +4113,8 @@ DEFINE_SPAPR_MACHINE(2_11, "2.11", false); static void spapr_machine_2_10_class_options(MachineClass *mc) { - static GlobalProperty compat[] = { - HW_COMPAT_2_10 - }; - spapr_machine_2_11_class_options(mc); - compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); + compat_props_add(mc->compat_props, hw_compat_2_10, hw_compat_2_10_len); } DEFINE_SPAPR_MACHINE(2_10, "2.10", false); diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 74623becaf..95ad7ba842 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -733,12 +733,8 @@ static void ccw_machine_2_10_instance_options(MachineState *machine) static void ccw_machine_2_10_class_options(MachineClass *mc) { - static GlobalProperty compat[] = { - HW_COMPAT_2_10 - }; - ccw_machine_2_11_class_options(mc); - compat_props_add(mc->compat_props, compat, G_N_ELEMENTS(compat)); + compat_props_add(mc->compat_props, hw_compat_2_10, hw_compat_2_10_len); } DEFINE_CCW_MACHINE(2_10, "2.10", false);