qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: Peter Maydell <peter.maydell@linaro.org>,
	Richard Henderson <rth@twiddle.net>,
	Eduardo Habkost <ehabkost@redhat.com>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: [Qemu-devel] [PULL 18/57] pc: Define machines using a DEFINE_PC_MACHINE macro
Date: Sun, 31 May 2015 20:35:25 +0200	[thread overview]
Message-ID: <1433097192-8988-19-git-send-email-mst@redhat.com> (raw)
In-Reply-To: <1433097192-8988-1-git-send-email-mst@redhat.com>

From: Eduardo Habkost <ehabkost@redhat.com>

This will automatically generate the existing QEMUMachine structs based
on the *_MACHINE_OPTIONS macros, and automatically add registration code
for them.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 include/hw/i386/pc.h |  16 +++
 hw/i386/pc_piix.c    | 270 ++++++++++++---------------------------------------
 hw/i386/pc_q35.c     | 118 +++++-----------------
 3 files changed, 103 insertions(+), 301 deletions(-)

diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
index 672f1f7..a5b1fb0 100644
--- a/include/hw/i386/pc.h
+++ b/include/hw/i386/pc.h
@@ -525,4 +525,20 @@ bool e820_get_entry(int, uint32_t, uint64_t *, uint64_t *);
     .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 void pc_machine_init_##suffix(void) \
+    { \
+        qemu_register_pc_machine(&pc_machine_##suffix); \
+    } \
+    machine_init(pc_machine_init_##suffix)
+
 #endif
diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c
index 0bbe979..3c5061f 100644
--- a/hw/i386/pc_piix.c
+++ b/hw/i386/pc_piix.c
@@ -530,121 +530,70 @@ static void pc_xen_hvm_init(MachineState *machine)
     .alias = "pc",                                              \
     .is_default = 1
 
+DEFINE_PC_MACHINE(v2_4, "pc-i440fx-2.4", pc_init_pci,
+                  PC_I440FX_2_4_MACHINE_OPTIONS, /* no compat */)
 
-static QEMUMachine pc_i440fx_machine_v2_4 = {
-    PC_I440FX_2_4_MACHINE_OPTIONS,
-    .name = "pc-i440fx-2.4",
-    .init = pc_init_pci,
-};
 
 #define PC_I440FX_2_3_MACHINE_OPTIONS \
     PC_I440FX_2_4_MACHINE_OPTIONS, \
     .alias = NULL, \
     .is_default = 0
 
-static QEMUMachine pc_i440fx_machine_v2_3 = {
-    PC_I440FX_2_3_MACHINE_OPTIONS,
-    .name = "pc-i440fx-2.3",
-    .init = pc_init_pci_2_3,
-    .compat_props = (GlobalProperty[]) {
-        PC_COMPAT_2_3
-        { /* end of list */ }
-    },
-};
+DEFINE_PC_MACHINE(v2_3, "pc-i440fx-2.3", pc_init_pci_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 QEMUMachine pc_i440fx_machine_v2_2 = {
-    PC_I440FX_2_2_MACHINE_OPTIONS,
-    .name = "pc-i440fx-2.2",
-    .init = pc_init_pci_2_2,
-    .compat_props = (GlobalProperty[]) {
-        PC_COMPAT_2_2
-        { /* end of list */ }
-    },
-};
+DEFINE_PC_MACHINE(v2_2, "pc-i440fx-2.2", pc_init_pci_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 QEMUMachine pc_i440fx_machine_v2_1 = {
-    PC_I440FX_2_1_MACHINE_OPTIONS,
-    .name = "pc-i440fx-2.1",
-    .init = pc_init_pci_2_1,
-    .compat_props = (GlobalProperty[]) {
-        PC_COMPAT_2_1
-        { /* end of list */ }
-    },
-};
+DEFINE_PC_MACHINE(v2_1, "pc-i440fx-2.1", pc_init_pci_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 QEMUMachine pc_i440fx_machine_v2_0 = {
-    PC_I440FX_2_0_MACHINE_OPTIONS,
-    .name = "pc-i440fx-2.0",
-    .init = pc_init_pci_2_0,
-    .compat_props = (GlobalProperty[]) {
-        PC_COMPAT_2_0
-        { /* end of list */ }
-    },
-};
+DEFINE_PC_MACHINE(v2_0, "pc-i440fx-2.0", pc_init_pci_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 QEMUMachine pc_i440fx_machine_v1_7 = {
-    PC_I440FX_1_7_MACHINE_OPTIONS,
-    .name = "pc-i440fx-1.7",
-    .init = pc_init_pci_1_7,
-    .compat_props = (GlobalProperty[]) {
-        PC_COMPAT_1_7
-        { /* end of list */ }
-    },
-};
+DEFINE_PC_MACHINE(v1_7, "pc-i440fx-1.7", pc_init_pci_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 QEMUMachine pc_i440fx_machine_v1_6 = {
-    PC_I440FX_1_6_MACHINE_OPTIONS,
-    .name = "pc-i440fx-1.6",
-    .init = pc_init_pci_1_6,
-    .compat_props = (GlobalProperty[]) {
-        PC_COMPAT_1_6
-        { /* end of list */ }
-    },
-};
+DEFINE_PC_MACHINE(v1_6, "pc-i440fx-1.6", pc_init_pci_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 QEMUMachine pc_i440fx_machine_v1_5 = {
-    PC_I440FX_1_5_MACHINE_OPTIONS,
-    .name = "pc-i440fx-1.5",
-    .init = pc_init_pci_1_5,
-    .compat_props = (GlobalProperty[]) {
-        PC_COMPAT_1_5
-        { /* end of list */ }
-    },
-};
+DEFINE_PC_MACHINE(v1_5, "pc-i440fx-1.5", pc_init_pci_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 QEMUMachine pc_i440fx_machine_v1_4 = {
-    PC_I440FX_1_4_MACHINE_OPTIONS,
-    .name = "pc-i440fx-1.4",
-    .init = pc_init_pci_1_4,
-    .compat_props = (GlobalProperty[]) {
-        PC_COMPAT_1_4
-        { /* end of list */ }
-    },
-};
+DEFINE_PC_MACHINE(v1_4, "pc-i440fx-1.4", pc_init_pci_1_4,
+                  PC_I440FX_1_4_MACHINE_OPTIONS, PC_COMPAT_1_4);
+
 
 #define PC_COMPAT_1_3 \
         PC_COMPAT_1_4 \
@@ -669,15 +618,9 @@ static QEMUMachine pc_i440fx_machine_v1_4 = {
 #define PC_I440FX_1_3_MACHINE_OPTIONS \
     PC_I440FX_1_4_MACHINE_OPTIONS
 
-static QEMUMachine pc_machine_v1_3 = {
-    PC_I440FX_1_3_MACHINE_OPTIONS,
-    .name = "pc-1.3",
-    .init = pc_init_pci_1_3,
-    .compat_props = (GlobalProperty[]) {
-        PC_COMPAT_1_3
-        { /* end of list */ }
-    },
-};
+DEFINE_PC_MACHINE(v1_3, "pc-1.3", pc_init_pci_1_3,
+                  PC_I440FX_1_3_MACHINE_OPTIONS, PC_COMPAT_1_3);
+
 
 #define PC_COMPAT_1_2 \
         PC_COMPAT_1_3 \
@@ -710,15 +653,9 @@ static QEMUMachine pc_machine_v1_3 = {
 #define PC_I440FX_1_2_MACHINE_OPTIONS \
     PC_I440FX_1_3_MACHINE_OPTIONS
 
-static QEMUMachine pc_machine_v1_2 = {
-    PC_I440FX_1_2_MACHINE_OPTIONS,
-    .name = "pc-1.2",
-    .init = pc_init_pci_1_2,
-    .compat_props = (GlobalProperty[]) {
-        PC_COMPAT_1_2
-        { /* end of list */ }
-    },
-};
+DEFINE_PC_MACHINE(v1_2, "pc-1.2", pc_init_pci_1_2,
+                  PC_I440FX_1_2_MACHINE_OPTIONS, PC_COMPAT_1_2);
+
 
 #define PC_COMPAT_1_1 \
         PC_COMPAT_1_2 \
@@ -755,15 +692,9 @@ static QEMUMachine pc_machine_v1_2 = {
 #define PC_I440FX_1_1_MACHINE_OPTIONS \
     PC_I440FX_1_2_MACHINE_OPTIONS
 
-static QEMUMachine pc_machine_v1_1 = {
-    PC_I440FX_1_1_MACHINE_OPTIONS,
-    .name = "pc-1.1",
-    .init = pc_init_pci_1_2,
-    .compat_props = (GlobalProperty[]) {
-        PC_COMPAT_1_1
-        { /* end of list */ }
-    },
-};
+DEFINE_PC_MACHINE(v1_1, "pc-1.1", pc_init_pci_1_2,
+                  PC_I440FX_1_1_MACHINE_OPTIONS, PC_COMPAT_1_1);
+
 
 #define PC_COMPAT_1_0 \
         PC_COMPAT_1_1 \
@@ -789,15 +720,9 @@ static QEMUMachine pc_machine_v1_1 = {
     PC_I440FX_1_1_MACHINE_OPTIONS, \
     .hw_version = "1.0"
 
-static QEMUMachine pc_machine_v1_0 = {
-    PC_I440FX_1_0_MACHINE_OPTIONS,
-    .name = "pc-1.0",
-    .init = pc_init_pci_1_2,
-    .compat_props = (GlobalProperty[]) {
-        PC_COMPAT_1_0
-        { /* end of list */ }
-    },
-};
+DEFINE_PC_MACHINE(v1_0, "pc-1.0", pc_init_pci_1_2,
+                  PC_I440FX_1_0_MACHINE_OPTIONS, PC_COMPAT_1_0);
+
 
 #define PC_COMPAT_0_15 \
         PC_COMPAT_1_0
@@ -806,15 +731,9 @@ static QEMUMachine pc_machine_v1_0 = {
     PC_I440FX_1_0_MACHINE_OPTIONS, \
     .hw_version = "0.15"
 
-static QEMUMachine pc_machine_v0_15 = {
-    PC_I440FX_0_15_MACHINE_OPTIONS,
-    .name = "pc-0.15",
-    .init = pc_init_pci_1_2,
-    .compat_props = (GlobalProperty[]) {
-        PC_COMPAT_0_15
-        { /* end of list */ }
-    },
-};
+DEFINE_PC_MACHINE(v0_15, "pc-0.15", pc_init_pci_1_2,
+                  PC_I440FX_0_15_MACHINE_OPTIONS, PC_COMPAT_0_15);
+
 
 #define PC_COMPAT_0_14 \
         PC_COMPAT_0_15 \
@@ -848,15 +767,9 @@ static QEMUMachine pc_machine_v0_15 = {
     PC_I440FX_0_15_MACHINE_OPTIONS, \
     .hw_version = "0.14"
 
-static QEMUMachine pc_machine_v0_14 = {
-    PC_I440FX_0_14_MACHINE_OPTIONS,
-    .name = "pc-0.14",
-    .init = pc_init_pci_1_2,
-    .compat_props = (GlobalProperty[]) {
-        PC_COMPAT_0_14
-        { /* end of list */ }
-    },
-};
+DEFINE_PC_MACHINE(v0_14, "pc-0.14", pc_init_pci_1_2,
+                  PC_I440FX_0_14_MACHINE_OPTIONS, PC_COMPAT_0_14);
+
 
 #define PC_COMPAT_0_13 \
         PC_COMPAT_0_14 \
@@ -886,15 +799,9 @@ static QEMUMachine pc_machine_v0_14 = {
     PC_I440FX_0_14_MACHINE_OPTIONS, \
     .hw_version = "0.13"
 
-static QEMUMachine pc_machine_v0_13 = {
-    PC_I440FX_0_13_MACHINE_OPTIONS,
-    .name = "pc-0.13",
-    .init = pc_init_pci_no_kvmclock,
-    .compat_props = (GlobalProperty[]) {
-        PC_COMPAT_0_13
-        { /* end of list */ }
-    },
-};
+DEFINE_PC_MACHINE(v0_13, "pc-0.13", pc_init_pci_no_kvmclock,
+                  PC_I440FX_0_13_MACHINE_OPTIONS, PC_COMPAT_0_13);
+
 
 #define PC_COMPAT_0_12 \
         PC_COMPAT_0_13 \
@@ -924,15 +831,9 @@ static QEMUMachine pc_machine_v0_13 = {
     PC_I440FX_0_13_MACHINE_OPTIONS, \
     .hw_version = "0.12"
 
-static QEMUMachine pc_machine_v0_12 = {
-    PC_I440FX_0_12_MACHINE_OPTIONS,
-    .name = "pc-0.12",
-    .init = pc_init_pci_no_kvmclock,
-    .compat_props = (GlobalProperty[]) {
-        PC_COMPAT_0_12
-        { /* end of list */ }
-    },
-};
+DEFINE_PC_MACHINE(v0_12, "pc-0.12", pc_init_pci_no_kvmclock,
+                  PC_I440FX_0_12_MACHINE_OPTIONS, PC_COMPAT_0_12);
+
 
 #define PC_COMPAT_0_11 \
         PC_COMPAT_0_12 \
@@ -958,15 +859,9 @@ static QEMUMachine pc_machine_v0_12 = {
     PC_I440FX_0_12_MACHINE_OPTIONS, \
     .hw_version = "0.11"
 
-static QEMUMachine pc_machine_v0_11 = {
-    PC_I440FX_0_11_MACHINE_OPTIONS,
-    .name = "pc-0.11",
-    .init = pc_init_pci_no_kvmclock,
-    .compat_props = (GlobalProperty[]) {
-        PC_COMPAT_0_11
-        { /* end of list */ }
-    },
-};
+DEFINE_PC_MACHINE(v0_11, "pc-0.11", pc_init_pci_no_kvmclock,
+                  PC_I440FX_0_11_MACHINE_OPTIONS, PC_COMPAT_0_11);
+
 
 #define PC_COMPAT_0_10 \
     PC_COMPAT_0_11 \
@@ -996,29 +891,18 @@ static QEMUMachine pc_machine_v0_11 = {
     PC_I440FX_0_11_MACHINE_OPTIONS, \
     .hw_version = "0.10"
 
-static QEMUMachine pc_machine_v0_10 = {
-    PC_I440FX_0_10_MACHINE_OPTIONS,
-    .name = "pc-0.10",
-    .init = pc_init_pci_no_kvmclock,
-    .compat_props = (GlobalProperty[]) {
-        PC_COMPAT_0_10
-        { /* end of list */ }
-    },
-};
+DEFINE_PC_MACHINE(v0_10, "pc-0.10", pc_init_pci_no_kvmclock,
+                  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 QEMUMachine isapc_machine = {
-    ISAPC_MACHINE_OPTIONS,
-    .name = "isapc",
-    .init = pc_init_isa,
-    .compat_props = (GlobalProperty[]) {
-        { /* end of list */ }
-    },
-};
+DEFINE_PC_MACHINE(isapc, "isapc", pc_init_isa,
+                  ISAPC_MACHINE_OPTIONS, /* no compat */);
+
 
 #ifdef CONFIG_XEN
 #define XENFV_MACHINE_OPTIONS \
@@ -1028,38 +912,6 @@ static QEMUMachine isapc_machine = {
     .default_machine_opts = "accel=xen", \
     .hot_add_cpu = pc_hot_add_cpu
 
-static QEMUMachine xenfv_machine = {
-    XENFV_MACHINE_OPTIONS,
-    .name = "xenfv",
-    .init = pc_xen_hvm_init,
-};
+DEFINE_PC_MACHINE(xenfv, "xenfv", pc_xen_hvm_init,
+                  XENFV_MACHINE_OPTIONS, /* no compat */);
 #endif
-
-static void pc_machine_init(void)
-{
-    qemu_register_pc_machine(&pc_i440fx_machine_v2_4);
-    qemu_register_pc_machine(&pc_i440fx_machine_v2_3);
-    qemu_register_pc_machine(&pc_i440fx_machine_v2_2);
-    qemu_register_pc_machine(&pc_i440fx_machine_v2_1);
-    qemu_register_pc_machine(&pc_i440fx_machine_v2_0);
-    qemu_register_pc_machine(&pc_i440fx_machine_v1_7);
-    qemu_register_pc_machine(&pc_i440fx_machine_v1_6);
-    qemu_register_pc_machine(&pc_i440fx_machine_v1_5);
-    qemu_register_pc_machine(&pc_i440fx_machine_v1_4);
-    qemu_register_pc_machine(&pc_machine_v1_3);
-    qemu_register_pc_machine(&pc_machine_v1_2);
-    qemu_register_pc_machine(&pc_machine_v1_1);
-    qemu_register_pc_machine(&pc_machine_v1_0);
-    qemu_register_pc_machine(&pc_machine_v0_15);
-    qemu_register_pc_machine(&pc_machine_v0_14);
-    qemu_register_pc_machine(&pc_machine_v0_13);
-    qemu_register_pc_machine(&pc_machine_v0_12);
-    qemu_register_pc_machine(&pc_machine_v0_11);
-    qemu_register_pc_machine(&pc_machine_v0_10);
-    qemu_register_pc_machine(&isapc_machine);
-#ifdef CONFIG_XEN
-    qemu_register_pc_machine(&xenfv_machine);
-#endif
-}
-
-machine_init(pc_machine_init);
diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c
index 196178e..54447d0 100644
--- a/hw/i386/pc_q35.c
+++ b/hw/i386/pc_q35.c
@@ -427,131 +427,65 @@ static void pc_q35_init_1_4(MachineState *machine)
     .default_display = "std",                           \
     .alias = "q35"
 
-static QEMUMachine pc_q35_machine_v2_4 = {
-    PC_Q35_2_4_MACHINE_OPTIONS,
-    .name = "pc-q35-2.4",
-    .init = pc_q35_init,
-};
+DEFINE_PC_MACHINE(v2_4, "pc-q35-2.4", pc_q35_init,
+                  PC_Q35_2_4_MACHINE_OPTIONS, /* no compat */);
+
 
 #define PC_Q35_2_3_MACHINE_OPTIONS \
     PC_Q35_2_4_MACHINE_OPTIONS, \
     .alias = NULL
 
-static QEMUMachine pc_q35_machine_v2_3 = {
-    PC_Q35_2_3_MACHINE_OPTIONS,
-    .name = "pc-q35-2.3",
-    .init = pc_q35_init_2_3,
-    .compat_props = (GlobalProperty[]) {
-        PC_COMPAT_2_3
-        { /* end of list */ }
-    },
-};
+DEFINE_PC_MACHINE(v2_3, "pc-q35-2.3", pc_q35_init_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 QEMUMachine pc_q35_machine_v2_2 = {
-    PC_Q35_2_2_MACHINE_OPTIONS,
-    .name = "pc-q35-2.2",
-    .init = pc_q35_init_2_2,
-    .compat_props = (GlobalProperty[]) {
-        PC_COMPAT_2_2
-        { /* end of list */ }
-    },
-};
+DEFINE_PC_MACHINE(v2_2, "pc-q35-2.2", pc_q35_init_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 QEMUMachine pc_q35_machine_v2_1 = {
-    PC_Q35_2_1_MACHINE_OPTIONS,
-    .name = "pc-q35-2.1",
-    .init = pc_q35_init_2_1,
-    .compat_props = (GlobalProperty[]) {
-        PC_COMPAT_2_1
-        { /* end of list */ }
-    },
-};
+DEFINE_PC_MACHINE(v2_1, "pc-q35-2.1", pc_q35_init_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 QEMUMachine pc_q35_machine_v2_0 = {
-    PC_Q35_2_0_MACHINE_OPTIONS,
-    .name = "pc-q35-2.0",
-    .init = pc_q35_init_2_0,
-    .compat_props = (GlobalProperty[]) {
-        PC_COMPAT_2_0
-        { /* end of list */ }
-    },
-};
+DEFINE_PC_MACHINE(v2_0, "pc-q35-2.0", pc_q35_init_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 QEMUMachine pc_q35_machine_v1_7 = {
-    PC_Q35_1_7_MACHINE_OPTIONS,
-    .name = "pc-q35-1.7",
-    .init = pc_q35_init_1_7,
-    .compat_props = (GlobalProperty[]) {
-        PC_COMPAT_1_7
-        { /* end of list */ }
-    },
-};
+DEFINE_PC_MACHINE(v1_7, "pc-q35-1.7", pc_q35_init_1_7,
+                  PC_Q35_1_7_MACHINE_OPTIONS, PC_COMPAT_1_7);
+
 
 #define PC_Q35_1_6_MACHINE_OPTIONS \
     PC_Q35_MACHINE_OPTIONS
 
-static QEMUMachine pc_q35_machine_v1_6 = {
-    PC_Q35_1_6_MACHINE_OPTIONS,
-    .name = "pc-q35-1.6",
-    .init = pc_q35_init_1_6,
-    .compat_props = (GlobalProperty[]) {
-        PC_COMPAT_1_6
-        { /* end of list */ }
-    },
-};
+DEFINE_PC_MACHINE(v1_6, "pc-q35-1.6", pc_q35_init_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 QEMUMachine pc_q35_machine_v1_5 = {
-    PC_Q35_1_5_MACHINE_OPTIONS,
-    .name = "pc-q35-1.5",
-    .init = pc_q35_init_1_5,
-    .compat_props = (GlobalProperty[]) {
-        PC_COMPAT_1_5
-        { /* end of list */ }
-    },
-};
+DEFINE_PC_MACHINE(v1_5, "pc-q35-1.5", pc_q35_init_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 QEMUMachine pc_q35_machine_v1_4 = {
-    PC_Q35_1_4_MACHINE_OPTIONS,
-    .name = "pc-q35-1.4",
-    .init = pc_q35_init_1_4,
-    .compat_props = (GlobalProperty[]) {
-        PC_COMPAT_1_4
-        { /* end of list */ }
-    },
-};
-
-static void pc_q35_machine_init(void)
-{
-    qemu_register_pc_machine(&pc_q35_machine_v2_4);
-    qemu_register_pc_machine(&pc_q35_machine_v2_3);
-    qemu_register_pc_machine(&pc_q35_machine_v2_2);
-    qemu_register_pc_machine(&pc_q35_machine_v2_1);
-    qemu_register_pc_machine(&pc_q35_machine_v2_0);
-    qemu_register_pc_machine(&pc_q35_machine_v1_7);
-    qemu_register_pc_machine(&pc_q35_machine_v1_6);
-    qemu_register_pc_machine(&pc_q35_machine_v1_5);
-    qemu_register_pc_machine(&pc_q35_machine_v1_4);
-}
-
-machine_init(pc_q35_machine_init);
+DEFINE_PC_MACHINE(v1_4, "pc-q35-1.4", pc_q35_init_1_4,
+                  PC_Q35_1_4_MACHINE_OPTIONS, PC_COMPAT_1_4);
-- 
MST

  parent reply	other threads:[~2015-05-31 18:35 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-31 18:34 [Qemu-devel] [PULL 00/57] pc, pci, tpm, virtio enhancements and fixes Michael S. Tsirkin
2015-05-31 18:34 ` [Qemu-devel] [PULL 01/57] hw/virtio/virtio-balloon: move adding property to virtio_balloon_instance_init Michael S. Tsirkin
2015-05-31 18:34 ` [Qemu-devel] [PULL 02/57] hw/virtio/virtio-pci: use alias property for virtio-balloon-pci Michael S. Tsirkin
2015-05-31 18:34 ` [Qemu-devel] [PULL 03/57] hw/s390x/virtio-ccw: use alias property for virtio-balloon-ccw Michael S. Tsirkin
2015-05-31 18:34 ` [Qemu-devel] [PULL 04/57] pc: Replace tab with spaces Michael S. Tsirkin
2015-05-31 18:34 ` [Qemu-devel] [PULL 05/57] hw: Move commas inside HW_COMPAT_2_1 macro Michael S. Tsirkin
2015-05-31 18:34 ` [Qemu-devel] [PULL 06/57] pc: Move commas inside PC_COMPAT_* macros Michael S. Tsirkin
2015-05-31 18:34 ` [Qemu-devel] [PULL 07/57] spapr: Move commas inside SPAPR_COMPAT_* macros Michael S. Tsirkin
2015-05-31 18:34 ` [Qemu-devel] [PULL 08/57] hw: Define empty HW_COMPAT_2_[23] macros Michael S. Tsirkin
2015-05-31 18:34 ` [Qemu-devel] [PULL 09/57] pc: Define PC_COMPAT_2_[123] macros Michael S. Tsirkin
2015-05-31 18:34 ` [Qemu-devel] [PULL 10/57] spapr: Use HW_COMPAT_* inside SPAPR_COMPAT_* macros Michael S. Tsirkin
2015-05-31 18:34 ` [Qemu-devel] [PULL 11/57] spapr: define SPAPR_COMPAT_2_3 Michael S. Tsirkin
2015-05-31 18:35 ` [Qemu-devel] [PULL 12/57] piix: Move pc-0.14 qxl compat properties to PC_COMPAT_0_14 Michael S. Tsirkin
2015-05-31 18:35 ` [Qemu-devel] [PULL 13/57] piix: Move pc-0.11 drive version compat props to PC_COMPAT_0_11 Michael S. Tsirkin
2015-05-31 18:35 ` [Qemu-devel] [PULL 14/57] piix: Move pc-0.13 virtio-9p-pci compat to PC_COMPAT_0_13 Michael S. Tsirkin
2015-05-31 18:35 ` [Qemu-devel] [PULL 15/57] piix: Move pc-0.1[23] rombar compat props " Michael S. Tsirkin
2015-05-31 18:35 ` [Qemu-devel] [PULL 16/57] piix: Define PC_COMPAT_0_10 Michael S. Tsirkin
2015-05-31 18:35 ` [Qemu-devel] [PULL 17/57] pc: Define MACHINE_OPTIONS macros consistently for all machines Michael S. Tsirkin
2015-05-31 18:35 ` Michael S. Tsirkin [this message]
2015-05-31 18:35 ` [Qemu-devel] [PULL 19/57] pc: Convert *_MACHINE_OPTIONS macros into functions Michael S. Tsirkin
2015-05-31 18:35 ` [Qemu-devel] [PULL 20/57] pc: Move compat_props setting inside *_machine_options() functions Michael S. Tsirkin
2015-05-31 18:35 ` [Qemu-devel] [PULL 21/57] pc: Don't use QEMUMachine anymore Michael S. Tsirkin
2015-05-31 18:35 ` [Qemu-devel] [PULL 22/57] pc: Remove qemu_register_pc_machine() function Michael S. Tsirkin
2015-05-31 18:35 ` [Qemu-devel] [PULL 23/57] machine: Remove unused fields from QEMUMachine Michael S. Tsirkin
2015-05-31 18:35 ` [Qemu-devel] [PULL 24/57] piix: Add kvmclock_enabled, pci_enabled globals Michael S. Tsirkin
2015-05-31 18:35 ` [Qemu-devel] [PULL 25/57] piix: Eliminate pc_init_pci() Michael S. Tsirkin
2015-05-31 18:35 ` [Qemu-devel] [PULL 26/57] pc: Generate init functions with a macro Michael S. Tsirkin
2015-05-31 18:36 ` [Qemu-devel] [PULL 27/57] pc: acpi: fix pvpanic for buggy guests Michael S. Tsirkin
2015-05-31 18:36 ` [Qemu-devel] [PULL 28/57] virtio: move host_features Michael S. Tsirkin
2015-05-31 18:36 ` [Qemu-devel] [PULL 29/57] virtio-ccw: Don't advertise VIRTIO_F_BAD_FEATURE Michael S. Tsirkin
2015-05-31 18:36 ` [Qemu-devel] [PULL 30/57] virtio: move VIRTIO_F_NOTIFY_ON_EMPTY into core Michael S. Tsirkin
2015-05-31 18:36 ` [Qemu-devel] [PULL 31/57] virtio-net: adding all queues in .realize() Michael S. Tsirkin
2015-05-31 18:36 ` [Qemu-devel] [PULL 32/57] virtio: device_plugged() can fail Michael S. Tsirkin
2015-05-31 18:36 ` [Qemu-devel] [PULL 33/57] virtio: introduce virtio_get_num_queues() Michael S. Tsirkin
2015-05-31 18:36 ` [Qemu-devel] [PULL 34/57] virtio-ccw: introduce ccw specific queue limit Michael S. Tsirkin
2015-05-31 18:36 ` [Qemu-devel] [PULL 35/57] virtio-ccw: validate the number of queues against bus limitation Michael S. Tsirkin
2015-05-31 18:36 ` [Qemu-devel] [PULL 36/57] virtio-s390: introduce virito s390 queue limit Michael S. Tsirkin
2015-05-31 18:36 ` [Qemu-devel] [PULL 37/57] virtio-s390: introduce virtio_s390_device_plugged() Michael S. Tsirkin
2015-05-31 18:36 ` [Qemu-devel] [PULL 38/57] virtio: rename VIRTIO_PCI_QUEUE_MAX to VIRTIO_QUEUE_MAX Michael S. Tsirkin
2015-05-31 18:36 ` [Qemu-devel] [PULL 39/57] virtio: increase the queue limit to 1024 Michael S. Tsirkin
2015-05-31 18:36 ` [Qemu-devel] [PULL 40/57] i386/pc: pc_basic_device_init(): delegate FDC creation request Michael S. Tsirkin
2015-05-31 18:36 ` [Qemu-devel] [PULL 41/57] i386/pc: '-drive if=floppy' should imply a board-default FDC Michael S. Tsirkin
2015-05-31 18:37 ` [Qemu-devel] [PULL 42/57] i386/pc_q35: don't insist on board FDC if there's no default floppy Michael S. Tsirkin
2015-05-31 18:37 ` [Qemu-devel] [PULL 43/57] i386: drop FDC in pc-q35-2.4+ if neither it nor floppy drives are wanted Michael S. Tsirkin
2015-05-31 18:37 ` [Qemu-devel] [PULL 44/57] acpi: Simplify printing to dynamic string Michael S. Tsirkin
2015-05-31 18:37 ` [Qemu-devel] [PULL 45/57] Add stream ID to MSI write Michael S. Tsirkin
2015-05-31 18:37 ` [Qemu-devel] [PULL 46/57] Extend TPM TIS interface to support TPM 2 Michael S. Tsirkin
2015-05-31 18:37 ` [Qemu-devel] [PULL 47/57] tpm: Probe for connected TPM 1.2 or " Michael S. Tsirkin
2015-05-31 18:37 ` [Qemu-devel] [PULL 48/57] TPM2 ACPI table support Michael S. Tsirkin
2015-06-04 13:57   ` Igor Mammedov
2015-06-05 20:42     ` Stefan Berger
2015-05-31 18:37 ` [Qemu-devel] [PULL 49/57] acpi: add aml_add() term Michael S. Tsirkin
2015-05-31 18:37 ` [Qemu-devel] [PULL 50/57] acpi: add aml_lless() term Michael S. Tsirkin
2015-05-31 18:37 ` [Qemu-devel] [PULL 51/57] acpi: add aml_index() term Michael S. Tsirkin
2015-05-31 18:37 ` [Qemu-devel] [PULL 52/57] acpi: add aml_shiftleft() term Michael S. Tsirkin
2015-05-31 18:37 ` [Qemu-devel] [PULL 53/57] acpi: add aml_shiftright() term Michael S. Tsirkin
2015-05-31 18:37 ` [Qemu-devel] [PULL 54/57] acpi: add aml_increment() term Michael S. Tsirkin
2015-05-31 18:37 ` [Qemu-devel] [PULL 55/57] acpi: add aml_while() term Michael S. Tsirkin
2015-05-31 18:37 ` [Qemu-devel] [PULL 56/57] hw/acpi/aml-build: Fix memory leak Michael S. Tsirkin
2015-05-31 18:38 ` [Qemu-devel] [PULL 57/57] virtio-mmio: ioeventfd support Michael S. Tsirkin
2015-06-01 12:04 ` [Qemu-devel] [PULL 00/57] pc, pci, tpm, virtio enhancements and fixes Peter Maydell
2015-06-01 12:14   ` Michael S. Tsirkin
2015-06-02 14:49   ` Igor Mammedov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1433097192-8988-19-git-send-email-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=ehabkost@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).