From patchwork Mon Jun 1 12:23:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 478934 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 0DE43140E61 for ; Mon, 1 Jun 2015 22:26:59 +1000 (AEST) Received: from localhost ([::1]:51907 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzOnw-0003jT-UD for incoming@patchwork.ozlabs.org; Mon, 01 Jun 2015 08:26:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34128) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzOkd-0006oo-HT for qemu-devel@nongnu.org; Mon, 01 Jun 2015 08:23:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YzOka-0007XE-8k for qemu-devel@nongnu.org; Mon, 01 Jun 2015 08:23:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53535) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YzOkZ-0007XA-Vz for qemu-devel@nongnu.org; Mon, 01 Jun 2015 08:23:28 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id A60592D8B6B; Mon, 1 Jun 2015 12:23:27 +0000 (UTC) Received: from redhat.com (ovpn-116-67.ams2.redhat.com [10.36.116.67]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id t51CNOSe019655; Mon, 1 Jun 2015 08:23:25 -0400 Date: Mon, 1 Jun 2015 14:23:24 +0200 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Message-ID: <1433161230-29421-20-git-send-email-mst@redhat.com> References: <1433161230-29421-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1433161230-29421-1-git-send-email-mst@redhat.com> X-Mutt-Fcc: =sent X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Peter Maydell , Richard Henderson , Eduardo Habkost , Paolo Bonzini Subject: [Qemu-devel] [PULL v2 19/60] pc: Convert *_MACHINE_OPTIONS macros into functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Eduardo Habkost By now the new functions will get QEMUMachine as argument, but they will be later converted to initialize a MachineClass struct directly. Signed-off-by: Eduardo Habkost Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- include/hw/i386/pc.h | 42 +++++----- hw/i386/pc_piix.c | 229 +++++++++++++++++++++++++++++++-------------------- hw/i386/pc_q35.c | 102 ++++++++++++++--------- 3 files changed, 222 insertions(+), 151 deletions(-) diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h index a5b1fb0..7a70d1f 100644 --- a/include/hw/i386/pc.h +++ b/include/hw/i386/pc.h @@ -517,27 +517,31 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *); .value = stringify(0),\ }, -#define PC_COMMON_MACHINE_OPTIONS \ - .default_boot_order = "cad" - -#define PC_DEFAULT_MACHINE_OPTIONS \ - PC_COMMON_MACHINE_OPTIONS, \ - .hot_add_cpu = pc_hot_add_cpu, \ - .max_cpus = 255 - -#define DEFINE_PC_MACHINE(suffix, namestr, initfn, OPTS, COMPAT) \ - static QEMUMachine pc_machine_##suffix = { \ - OPTS, \ - .name = namestr, \ - .init = initfn, \ - .compat_props = (GlobalProperty[]) { \ - COMPAT \ - { /* end of list */ } \ - }, \ - }; \ +static inline void pc_common_machine_options(QEMUMachine *m) +{ + m->default_boot_order = "cad"; +} + +static inline void pc_default_machine_options(QEMUMachine *m) +{ + pc_common_machine_options(m); + m->hot_add_cpu = pc_hot_add_cpu; + m->max_cpus = 255; +} + +#define DEFINE_PC_MACHINE(suffix, namestr, initfn, optsfn, COMPAT) \ static void pc_machine_init_##suffix(void) \ { \ - qemu_register_pc_machine(&pc_machine_##suffix); \ + static QEMUMachine m = { }; \ + static GlobalProperty props[] = { \ + COMPAT \ + { /* end of list */ } \ + }; \ + optsfn(&m); \ + m.name = namestr; \ + m.init = initfn; \ + m.compat_props = props; \ + qemu_register_pc_machine(&m); \ } \ machine_init(pc_machine_init_##suffix) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 3c5061f..5acd0e0 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -517,82 +517,104 @@ static void pc_xen_hvm_init(MachineState *machine) } #endif -#define PC_I440FX_MACHINE_OPTIONS \ - PC_DEFAULT_MACHINE_OPTIONS, \ - .family = "pc_piix", \ - .desc = "Standard PC (i440FX + PIIX, 1996)", \ - .hot_add_cpu = pc_hot_add_cpu - -#define PC_I440FX_2_4_MACHINE_OPTIONS \ - PC_I440FX_MACHINE_OPTIONS, \ - .default_machine_opts = "firmware=bios-256k.bin", \ - .default_display = "std", \ - .alias = "pc", \ - .is_default = 1 + +static void pc_i440fx_machine_options(QEMUMachine *m) +{ + pc_default_machine_options(m); + m->family = "pc_piix"; + m->desc = "Standard PC (i440FX + PIIX, 1996)"; + m->hot_add_cpu = pc_hot_add_cpu; +} + +static void pc_i440fx_2_4_machine_options(QEMUMachine *m) +{ + pc_i440fx_machine_options(m); + m->default_machine_opts = "firmware=bios-256k.bin"; + m->default_display = "std"; + m->alias = "pc"; + m->is_default = 1; +} DEFINE_PC_MACHINE(v2_4, "pc-i440fx-2.4", pc_init_pci, - PC_I440FX_2_4_MACHINE_OPTIONS, /* no compat */) + pc_i440fx_2_4_machine_options, /* no compat */) -#define PC_I440FX_2_3_MACHINE_OPTIONS \ - PC_I440FX_2_4_MACHINE_OPTIONS, \ - .alias = NULL, \ - .is_default = 0 +static void pc_i440fx_2_3_machine_options(QEMUMachine *m) +{ + pc_i440fx_machine_options(m); + m->alias = NULL; + m->is_default = 0; +} DEFINE_PC_MACHINE(v2_3, "pc-i440fx-2.3", pc_init_pci_2_3, - PC_I440FX_2_3_MACHINE_OPTIONS, PC_COMPAT_2_3); + pc_i440fx_2_3_machine_options, PC_COMPAT_2_3); -#define PC_I440FX_2_2_MACHINE_OPTIONS \ - PC_I440FX_2_3_MACHINE_OPTIONS +static void pc_i440fx_2_2_machine_options(QEMUMachine *m) +{ + pc_i440fx_2_3_machine_options(m); +} DEFINE_PC_MACHINE(v2_2, "pc-i440fx-2.2", pc_init_pci_2_2, - PC_I440FX_2_2_MACHINE_OPTIONS, PC_COMPAT_2_2); + pc_i440fx_2_2_machine_options, PC_COMPAT_2_2); -#define PC_I440FX_2_1_MACHINE_OPTIONS \ - PC_I440FX_2_2_MACHINE_OPTIONS, \ - .default_display = NULL +static void pc_i440fx_2_1_machine_options(QEMUMachine *m) +{ + pc_i440fx_2_2_machine_options(m); + m->default_display = NULL; +} DEFINE_PC_MACHINE(v2_1, "pc-i440fx-2.1", pc_init_pci_2_1, - PC_I440FX_2_1_MACHINE_OPTIONS, PC_COMPAT_2_1); + pc_i440fx_2_1_machine_options, PC_COMPAT_2_1); -#define PC_I440FX_2_0_MACHINE_OPTIONS \ - PC_I440FX_2_1_MACHINE_OPTIONS + +static void pc_i440fx_2_0_machine_options(QEMUMachine *m) +{ + pc_i440fx_2_1_machine_options(m); +} DEFINE_PC_MACHINE(v2_0, "pc-i440fx-2.0", pc_init_pci_2_0, - PC_I440FX_2_0_MACHINE_OPTIONS, PC_COMPAT_2_0); + pc_i440fx_2_0_machine_options, PC_COMPAT_2_0); -#define PC_I440FX_1_7_MACHINE_OPTIONS \ - PC_I440FX_2_0_MACHINE_OPTIONS, \ - .default_machine_opts = NULL +static void pc_i440fx_1_7_machine_options(QEMUMachine *m) +{ + pc_i440fx_2_0_machine_options(m); + m->default_machine_opts = NULL; +} DEFINE_PC_MACHINE(v1_7, "pc-i440fx-1.7", pc_init_pci_1_7, - PC_I440FX_1_7_MACHINE_OPTIONS, PC_COMPAT_1_7); + pc_i440fx_1_7_machine_options, PC_COMPAT_1_7); -#define PC_I440FX_1_6_MACHINE_OPTIONS \ - PC_I440FX_1_7_MACHINE_OPTIONS +static void pc_i440fx_1_6_machine_options(QEMUMachine *m) +{ + pc_i440fx_1_7_machine_options(m); +} DEFINE_PC_MACHINE(v1_6, "pc-i440fx-1.6", pc_init_pci_1_6, - PC_I440FX_1_6_MACHINE_OPTIONS, PC_COMPAT_1_6); + pc_i440fx_1_6_machine_options, PC_COMPAT_1_6); -#define PC_I440FX_1_5_MACHINE_OPTIONS \ - PC_I440FX_1_6_MACHINE_OPTIONS +static void pc_i440fx_1_5_machine_options(QEMUMachine *m) +{ + pc_i440fx_1_6_machine_options(m); +} DEFINE_PC_MACHINE(v1_5, "pc-i440fx-1.5", pc_init_pci_1_5, - PC_I440FX_1_5_MACHINE_OPTIONS, PC_COMPAT_1_5); + pc_i440fx_1_5_machine_options, PC_COMPAT_1_5); -#define PC_I440FX_1_4_MACHINE_OPTIONS \ - PC_I440FX_1_5_MACHINE_OPTIONS, \ - .hot_add_cpu = NULL +static void pc_i440fx_1_4_machine_options(QEMUMachine *m) +{ + pc_i440fx_1_5_machine_options(m); + m->hot_add_cpu = NULL; +} DEFINE_PC_MACHINE(v1_4, "pc-i440fx-1.4", pc_init_pci_1_4, - PC_I440FX_1_4_MACHINE_OPTIONS, PC_COMPAT_1_4); + pc_i440fx_1_4_machine_options, PC_COMPAT_1_4); #define PC_COMPAT_1_3 \ @@ -615,11 +637,14 @@ DEFINE_PC_MACHINE(v1_4, "pc-i440fx-1.4", pc_init_pci_1_4, .value = "off",\ }, -#define PC_I440FX_1_3_MACHINE_OPTIONS \ - PC_I440FX_1_4_MACHINE_OPTIONS + +static void pc_i440fx_1_3_machine_options(QEMUMachine *m) +{ + pc_i440fx_1_4_machine_options(m); +} DEFINE_PC_MACHINE(v1_3, "pc-1.3", pc_init_pci_1_3, - PC_I440FX_1_3_MACHINE_OPTIONS, PC_COMPAT_1_3); + pc_i440fx_1_3_machine_options, PC_COMPAT_1_3); #define PC_COMPAT_1_2 \ @@ -650,11 +675,13 @@ DEFINE_PC_MACHINE(v1_3, "pc-1.3", pc_init_pci_1_3, .value = "off",\ }, -#define PC_I440FX_1_2_MACHINE_OPTIONS \ - PC_I440FX_1_3_MACHINE_OPTIONS +static void pc_i440fx_1_2_machine_options(QEMUMachine *m) +{ + pc_i440fx_1_3_machine_options(m); +} DEFINE_PC_MACHINE(v1_2, "pc-1.2", pc_init_pci_1_2, - PC_I440FX_1_2_MACHINE_OPTIONS, PC_COMPAT_1_2); + pc_i440fx_1_2_machine_options, PC_COMPAT_1_2); #define PC_COMPAT_1_1 \ @@ -689,11 +716,13 @@ DEFINE_PC_MACHINE(v1_2, "pc-1.2", pc_init_pci_1_2, .value = "off",\ }, -#define PC_I440FX_1_1_MACHINE_OPTIONS \ - PC_I440FX_1_2_MACHINE_OPTIONS +static void pc_i440fx_1_1_machine_options(QEMUMachine *m) +{ + pc_i440fx_1_2_machine_options(m); +} DEFINE_PC_MACHINE(v1_1, "pc-1.1", pc_init_pci_1_2, - PC_I440FX_1_1_MACHINE_OPTIONS, PC_COMPAT_1_1); + pc_i440fx_1_1_machine_options, PC_COMPAT_1_1); #define PC_COMPAT_1_0 \ @@ -716,23 +745,27 @@ DEFINE_PC_MACHINE(v1_1, "pc-1.1", pc_init_pci_1_2, .value = "no",\ }, -#define PC_I440FX_1_0_MACHINE_OPTIONS \ - PC_I440FX_1_1_MACHINE_OPTIONS, \ - .hw_version = "1.0" +static void pc_i440fx_1_0_machine_options(QEMUMachine *m) +{ + pc_i440fx_1_1_machine_options(m); + m->hw_version = "1.0"; +} DEFINE_PC_MACHINE(v1_0, "pc-1.0", pc_init_pci_1_2, - PC_I440FX_1_0_MACHINE_OPTIONS, PC_COMPAT_1_0); + pc_i440fx_1_0_machine_options, PC_COMPAT_1_0); #define PC_COMPAT_0_15 \ PC_COMPAT_1_0 -#define PC_I440FX_0_15_MACHINE_OPTIONS \ - PC_I440FX_1_0_MACHINE_OPTIONS, \ - .hw_version = "0.15" +static void pc_i440fx_0_15_machine_options(QEMUMachine *m) +{ + pc_i440fx_1_0_machine_options(m); + m->hw_version = "0.15"; +} DEFINE_PC_MACHINE(v0_15, "pc-0.15", pc_init_pci_1_2, - PC_I440FX_0_15_MACHINE_OPTIONS, PC_COMPAT_0_15); + pc_i440fx_0_15_machine_options, PC_COMPAT_0_15); #define PC_COMPAT_0_14 \ @@ -763,12 +796,14 @@ DEFINE_PC_MACHINE(v0_15, "pc-0.15", pc_init_pci_1_2, .value = stringify(2),\ }, -#define PC_I440FX_0_14_MACHINE_OPTIONS \ - PC_I440FX_0_15_MACHINE_OPTIONS, \ - .hw_version = "0.14" +static void pc_i440fx_0_14_machine_options(QEMUMachine *m) +{ + pc_i440fx_0_15_machine_options(m); + m->hw_version = "0.14"; +} DEFINE_PC_MACHINE(v0_14, "pc-0.14", pc_init_pci_1_2, - PC_I440FX_0_14_MACHINE_OPTIONS, PC_COMPAT_0_14); + pc_i440fx_0_14_machine_options, PC_COMPAT_0_14); #define PC_COMPAT_0_13 \ @@ -795,12 +830,14 @@ DEFINE_PC_MACHINE(v0_14, "pc-0.14", pc_init_pci_1_2, .value = stringify(0),\ }, -#define PC_I440FX_0_13_MACHINE_OPTIONS \ - PC_I440FX_0_14_MACHINE_OPTIONS, \ - .hw_version = "0.13" +static void pc_i440fx_0_13_machine_options(QEMUMachine *m) +{ + pc_i440fx_0_14_machine_options(m); + m->hw_version = "0.13"; +} DEFINE_PC_MACHINE(v0_13, "pc-0.13", pc_init_pci_no_kvmclock, - PC_I440FX_0_13_MACHINE_OPTIONS, PC_COMPAT_0_13); + pc_i440fx_0_13_machine_options, PC_COMPAT_0_13); #define PC_COMPAT_0_12 \ @@ -827,12 +864,14 @@ DEFINE_PC_MACHINE(v0_13, "pc-0.13", pc_init_pci_no_kvmclock, .value = "1",\ }, -#define PC_I440FX_0_12_MACHINE_OPTIONS \ - PC_I440FX_0_13_MACHINE_OPTIONS, \ - .hw_version = "0.12" +static void pc_i440fx_0_12_machine_options(QEMUMachine *m) +{ + pc_i440fx_0_13_machine_options(m); + m->hw_version = "0.12"; +} DEFINE_PC_MACHINE(v0_12, "pc-0.12", pc_init_pci_no_kvmclock, - PC_I440FX_0_12_MACHINE_OPTIONS, PC_COMPAT_0_12); + pc_i440fx_0_12_machine_options, PC_COMPAT_0_12); #define PC_COMPAT_0_11 \ @@ -855,12 +894,14 @@ DEFINE_PC_MACHINE(v0_12, "pc-0.12", pc_init_pci_no_kvmclock, .value = "0.11",\ }, -#define PC_I440FX_0_11_MACHINE_OPTIONS \ - PC_I440FX_0_12_MACHINE_OPTIONS, \ - .hw_version = "0.11" +static void pc_i440fx_0_11_machine_options(QEMUMachine *m) +{ + pc_i440fx_0_12_machine_options(m); + m->hw_version = "0.11"; +} DEFINE_PC_MACHINE(v0_11, "pc-0.11", pc_init_pci_no_kvmclock, - PC_I440FX_0_11_MACHINE_OPTIONS, PC_COMPAT_0_11); + pc_i440fx_0_11_machine_options, PC_COMPAT_0_11); #define PC_COMPAT_0_10 \ @@ -887,31 +928,37 @@ DEFINE_PC_MACHINE(v0_11, "pc-0.11", pc_init_pci_no_kvmclock, .value = "0.10",\ }, -#define PC_I440FX_0_10_MACHINE_OPTIONS \ - PC_I440FX_0_11_MACHINE_OPTIONS, \ - .hw_version = "0.10" +static void pc_i440fx_0_10_machine_options(QEMUMachine *m) +{ + pc_i440fx_0_11_machine_options(m); + m->hw_version = "0.10"; +} DEFINE_PC_MACHINE(v0_10, "pc-0.10", pc_init_pci_no_kvmclock, - PC_I440FX_0_10_MACHINE_OPTIONS, PC_COMPAT_0_10); + pc_i440fx_0_10_machine_options, PC_COMPAT_0_10); -#define ISAPC_MACHINE_OPTIONS \ - PC_COMMON_MACHINE_OPTIONS, \ - .desc = "ISA-only PC", \ - .max_cpus = 1 +static void isapc_machine_options(QEMUMachine *m) +{ + pc_common_machine_options(m); + m->desc = "ISA-only PC"; + m->max_cpus = 1; +} DEFINE_PC_MACHINE(isapc, "isapc", pc_init_isa, - ISAPC_MACHINE_OPTIONS, /* no compat */); + isapc_machine_options, /* no compat */); #ifdef CONFIG_XEN -#define XENFV_MACHINE_OPTIONS \ - PC_COMMON_MACHINE_OPTIONS, \ - .desc = "Xen Fully-virtualized PC", \ - .max_cpus = HVM_MAX_VCPUS, \ - .default_machine_opts = "accel=xen", \ - .hot_add_cpu = pc_hot_add_cpu +static void xenfv_machine_options(QEMUMachine *m) +{ + pc_common_machine_options(m); + m->desc = "Xen Fully-virtualized PC"; + m->max_cpus = HVM_MAX_VCPUS; + m->default_machine_opts = "accel=xen"; + m->hot_add_cpu = pc_hot_add_cpu; +} DEFINE_PC_MACHINE(xenfv, "xenfv", pc_xen_hvm_init, - XENFV_MACHINE_OPTIONS, /* no compat */); + xenfv_machine_options, /* no compat */); #endif diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index 54447d0..0226021 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -414,78 +414,98 @@ static void pc_q35_init_1_4(MachineState *machine) pc_q35_init(machine); } -#define PC_Q35_MACHINE_OPTIONS \ - PC_DEFAULT_MACHINE_OPTIONS, \ - .family = "pc_q35", \ - .desc = "Standard PC (Q35 + ICH9, 2009)", \ - .hot_add_cpu = pc_hot_add_cpu, \ - .units_per_default_bus = 1 - -#define PC_Q35_2_4_MACHINE_OPTIONS \ - PC_Q35_MACHINE_OPTIONS, \ - .default_machine_opts = "firmware=bios-256k.bin", \ - .default_display = "std", \ - .alias = "q35" +static void pc_q35_machine_options(QEMUMachine *m) +{ + pc_default_machine_options(m); + m->family = "pc_q35"; + m->desc = "Standard PC (Q35 + ICH9, 2009)"; + m->hot_add_cpu = pc_hot_add_cpu; + m->units_per_default_bus = 1; +} + +static void pc_q35_2_4_machine_options(QEMUMachine *m) +{ + pc_q35_machine_options(m); + m->default_machine_opts = "firmware=bios-256k.bin"; + m->default_display = "std"; + m->alias = "q35"; +} DEFINE_PC_MACHINE(v2_4, "pc-q35-2.4", pc_q35_init, - PC_Q35_2_4_MACHINE_OPTIONS, /* no compat */); + pc_q35_2_4_machine_options, /* no compat */); -#define PC_Q35_2_3_MACHINE_OPTIONS \ - PC_Q35_2_4_MACHINE_OPTIONS, \ - .alias = NULL +static void pc_q35_2_3_machine_options(QEMUMachine *m) +{ + pc_q35_2_4_machine_options(m); + m->alias = NULL; +} DEFINE_PC_MACHINE(v2_3, "pc-q35-2.3", pc_q35_init_2_3, - PC_Q35_2_3_MACHINE_OPTIONS, PC_COMPAT_2_3); + pc_q35_2_3_machine_options, PC_COMPAT_2_3); -#define PC_Q35_2_2_MACHINE_OPTIONS \ - PC_Q35_2_3_MACHINE_OPTIONS +static void pc_q35_2_2_machine_options(QEMUMachine *m) +{ + pc_q35_2_3_machine_options(m); +} DEFINE_PC_MACHINE(v2_2, "pc-q35-2.2", pc_q35_init_2_2, - PC_Q35_2_2_MACHINE_OPTIONS, PC_COMPAT_2_2); + pc_q35_2_2_machine_options, PC_COMPAT_2_2); -#define PC_Q35_2_1_MACHINE_OPTIONS \ - PC_Q35_2_2_MACHINE_OPTIONS, \ - .default_display = NULL +static void pc_q35_2_1_machine_options(QEMUMachine *m) +{ + pc_q35_2_2_machine_options(m); + m->default_display = NULL; +} DEFINE_PC_MACHINE(v2_1, "pc-q35-2.1", pc_q35_init_2_1, - PC_Q35_2_1_MACHINE_OPTIONS, PC_COMPAT_2_1); + pc_q35_2_1_machine_options, PC_COMPAT_2_1); -#define PC_Q35_2_0_MACHINE_OPTIONS \ - PC_Q35_2_1_MACHINE_OPTIONS +static void pc_q35_2_0_machine_options(QEMUMachine *m) +{ + pc_q35_2_1_machine_options(m); +} DEFINE_PC_MACHINE(v2_0, "pc-q35-2.0", pc_q35_init_2_0, - PC_Q35_2_0_MACHINE_OPTIONS, PC_COMPAT_2_0); + pc_q35_2_0_machine_options, PC_COMPAT_2_0); -#define PC_Q35_1_7_MACHINE_OPTIONS \ - PC_Q35_2_0_MACHINE_OPTIONS, \ - .default_machine_opts = NULL +static void pc_q35_1_7_machine_options(QEMUMachine *m) +{ + pc_q35_2_0_machine_options(m); + m->default_machine_opts = NULL; +} DEFINE_PC_MACHINE(v1_7, "pc-q35-1.7", pc_q35_init_1_7, - PC_Q35_1_7_MACHINE_OPTIONS, PC_COMPAT_1_7); + pc_q35_1_7_machine_options, PC_COMPAT_1_7); -#define PC_Q35_1_6_MACHINE_OPTIONS \ - PC_Q35_MACHINE_OPTIONS +static void pc_q35_1_6_machine_options(QEMUMachine *m) +{ + pc_q35_machine_options(m); +} DEFINE_PC_MACHINE(v1_6, "pc-q35-1.6", pc_q35_init_1_6, - PC_Q35_1_6_MACHINE_OPTIONS, PC_COMPAT_1_6); + pc_q35_1_6_machine_options, PC_COMPAT_1_6); -#define PC_Q35_1_5_MACHINE_OPTIONS \ - PC_Q35_1_6_MACHINE_OPTIONS +static void pc_q35_1_5_machine_options(QEMUMachine *m) +{ + pc_q35_1_6_machine_options(m); +} DEFINE_PC_MACHINE(v1_5, "pc-q35-1.5", pc_q35_init_1_5, - PC_Q35_1_5_MACHINE_OPTIONS, PC_COMPAT_1_5); + pc_q35_1_5_machine_options, PC_COMPAT_1_5); -#define PC_Q35_1_4_MACHINE_OPTIONS \ - PC_Q35_1_5_MACHINE_OPTIONS, \ - .hot_add_cpu = NULL +static void pc_q35_1_4_machine_options(QEMUMachine *m) +{ + pc_q35_1_5_machine_options(m); + m->hot_add_cpu = NULL; +} DEFINE_PC_MACHINE(v1_4, "pc-q35-1.4", pc_q35_init_1_4, - PC_Q35_1_4_MACHINE_OPTIONS, PC_COMPAT_1_4); + pc_q35_1_4_machine_options, PC_COMPAT_1_4);