aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2015-12-07 14:25:50 +1100
committerDavid Gibson <david@gibson.dropbear.id.au>2016-01-11 15:29:05 +1100
commitfccbc785003f4575a3f22a4d230f9aaa1327788e (patch)
treee6b3a7ed68465a2141ddeda8860b95a4842b3b33
parentfc9f38c3c0f42b7e98957b646976ee5b63f23806 (diff)
pseries: Improve setting of default machine version
This tweaks the way the default machine version is controlled, so that there will be a bit less churn when each new version is introduced. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
-rw-r--r--hw/ppc/spapr.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
index 5af3d132ed..8b8eb188b7 100644
--- a/hw/ppc/spapr.c
+++ b/hw/ppc/spapr.c
@@ -2308,12 +2308,16 @@ static const TypeInfo spapr_machine_info = {
},
};
-#define DEFINE_SPAPR_MACHINE(suffix, verstr) \
+#define DEFINE_SPAPR_MACHINE(suffix, verstr, latest) \
static void spapr_machine_##suffix##_class_init(ObjectClass *oc, \
void *data) \
{ \
MachineClass *mc = MACHINE_CLASS(oc); \
spapr_machine_##suffix##_class_options(mc); \
+ if (latest) { \
+ mc->alias = "pseries"; \
+ mc->is_default = 1; \
+ } \
} \
static void spapr_machine_##suffix##_instance_init(Object *obj) \
{ \
@@ -2342,11 +2346,9 @@ static void spapr_machine_2_5_instance_options(MachineState *machine)
static void spapr_machine_2_5_class_options(MachineClass *mc)
{
/* Defaults for the latest behaviour inherited from the base class */
- mc->alias = "pseries";
- mc->is_default = 1;
}
-DEFINE_SPAPR_MACHINE(2_5, "2.5");
+DEFINE_SPAPR_MACHINE(2_5, "2.5", true);
/*
* pseries-2.4
@@ -2364,13 +2366,11 @@ static void spapr_machine_2_4_class_options(MachineClass *mc)
sPAPRMachineClass *smc = SPAPR_MACHINE_CLASS(mc);
spapr_machine_2_5_class_options(mc);
- mc->alias = NULL;
- mc->is_default = 0;
smc->dr_lmb_enabled = false;
SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_4);
}
-DEFINE_SPAPR_MACHINE(2_4, "2.4");
+DEFINE_SPAPR_MACHINE(2_4, "2.4", false);
/*
* pseries-2.3
@@ -2396,7 +2396,7 @@ static void spapr_machine_2_3_class_options(MachineClass *mc)
spapr_machine_2_4_class_options(mc);
SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_3);
}
-DEFINE_SPAPR_MACHINE(2_3, "2.3");
+DEFINE_SPAPR_MACHINE(2_3, "2.3", false);
/*
* pseries-2.2
@@ -2421,7 +2421,7 @@ 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);
}
-DEFINE_SPAPR_MACHINE(2_2, "2.2");
+DEFINE_SPAPR_MACHINE(2_2, "2.2", false);
/*
* pseries-2.1
@@ -2440,7 +2440,7 @@ static void spapr_machine_2_1_class_options(MachineClass *mc)
spapr_machine_2_2_class_options(mc);
SET_MACHINE_COMPAT(mc, SPAPR_COMPAT_2_1);
}
-DEFINE_SPAPR_MACHINE(2_1, "2.1");
+DEFINE_SPAPR_MACHINE(2_1, "2.1", false);
static void spapr_machine_register_types(void)
{