aboutsummaryrefslogtreecommitdiff
path: root/hw/ppc
diff options
context:
space:
mode:
authorMichael S. Tsirkin <mst@redhat.com>2020-02-07 01:46:37 -0500
committerDavid Gibson <david@gibson.dropbear.id.au>2020-02-21 09:15:03 +1100
commita78492681995ad4b46a2b6e30bb36935dff5ffb1 (patch)
tree151c28dac8cc2299416e92ee20d4c478421baa2a /hw/ppc
parent90118a657ce88a003f20f24ca65db96bba8be7a9 (diff)
downloadqemu-a78492681995ad4b46a2b6e30bb36935dff5ffb1.zip
qemu-a78492681995ad4b46a2b6e30bb36935dff5ffb1.tar.gz
qemu-a78492681995ad4b46a2b6e30bb36935dff5ffb1.tar.bz2
ppc: function to setup latest class options
We are going to add more init for the latest machine, so move the setup to a function so we don't have to change the DEFINE_SPAPR_MACHINE macro each time. Signed-off-by: Michael S. Tsirkin <mst@redhat.com> Message-Id: <20200207064628.1196095-1-mst@redhat.com> Reviewed-by: Laurent Vivier <lvivier@redhat.com> Reviewed-by: Greg Kurz <groug@kaod.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'hw/ppc')
-rw-r--r--hw/ppc/spapr.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index c9b2e0a..691c391 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -4485,6 +4485,12 @@ static const TypeInfo spapr_machine_info = {
},
};
+static void spapr_machine_latest_class_options(MachineClass *mc)
+{
+ mc->alias = "pseries";
+ mc->is_default = 1;
+}
+
#define DEFINE_SPAPR_MACHINE(suffix, verstr, latest) \
static void spapr_machine_##suffix##_class_init(ObjectClass *oc, \
void *data) \
@@ -4492,8 +4498,7 @@ static const TypeInfo spapr_machine_info = {
MachineClass *mc = MACHINE_CLASS(oc); \
spapr_machine_##suffix##_class_options(mc); \
if (latest) { \
- mc->alias = "pseries"; \
- mc->is_default = 1; \
+ spapr_machine_latest_class_options(mc); \
} \
} \
static const TypeInfo spapr_machine_##suffix##_info = { \