pc: Move compat_props setting inside *_machine_options() functions

This will simplify the DEFINE_PC_MACHINE macro, and will help us to
implement reuse of PC_COMPAT_* macros through class_init function reuse,
in the future.

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>
This commit is contained in:
Eduardo Habkost 2015-05-15 14:18:55 -03:00 committed by Michael S. Tsirkin
parent fddd179ab9
commit 25519b062c
3 changed files with 65 additions and 36 deletions

View file

@ -432,80 +432,88 @@ static void pc_q35_2_4_machine_options(QEMUMachine *m)
}
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);
static void pc_q35_2_3_machine_options(QEMUMachine *m)
{
pc_q35_2_4_machine_options(m);
m->alias = NULL;
SET_MACHINE_COMPAT(m, PC_COMPAT_2_3);
}
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);
static void pc_q35_2_2_machine_options(QEMUMachine *m)
{
pc_q35_2_3_machine_options(m);
SET_MACHINE_COMPAT(m, PC_COMPAT_2_2);
}
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);
static void pc_q35_2_1_machine_options(QEMUMachine *m)
{
pc_q35_2_2_machine_options(m);
m->default_display = NULL;
SET_MACHINE_COMPAT(m, PC_COMPAT_2_1);
}
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);
static void pc_q35_2_0_machine_options(QEMUMachine *m)
{
pc_q35_2_1_machine_options(m);
SET_MACHINE_COMPAT(m, PC_COMPAT_2_0);
}
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);
static void pc_q35_1_7_machine_options(QEMUMachine *m)
{
pc_q35_2_0_machine_options(m);
m->default_machine_opts = NULL;
SET_MACHINE_COMPAT(m, PC_COMPAT_1_7);
}
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);
static void pc_q35_1_6_machine_options(QEMUMachine *m)
{
pc_q35_machine_options(m);
SET_MACHINE_COMPAT(m, PC_COMPAT_1_6);
}
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);
static void pc_q35_1_5_machine_options(QEMUMachine *m)
{
pc_q35_1_6_machine_options(m);
SET_MACHINE_COMPAT(m, PC_COMPAT_1_5);
}
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);
static void pc_q35_1_4_machine_options(QEMUMachine *m)
{
pc_q35_1_5_machine_options(m);
m->hot_add_cpu = NULL;
SET_MACHINE_COMPAT(m, PC_COMPAT_1_4);
}
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);