From 8680e011e0d9d0665670ed217d7a551d8c1910f9 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Wed, 5 Nov 2014 16:04:13 +0100 Subject: [PATCH 15/15] i386/pc: add RHEL machtypes to sorting families for -M \? (RHEL only) Message-id: <1415203453-7318-4-git-send-email-lersek@redhat.com> Patchwork-id: 62144 O-Subject: [RHEV-7.1 qemu-kvm-rhev PATCH 3/3] i386/pc: add RHEL machtypes to sorting families for -M \? (RHEL only) Bugzilla: 1145042 RH-Acked-by: Michael S. Tsirkin RH-Acked-by: dgibson RH-Acked-by: Andrew Jones RH-Acked-by: Marcel Apfelbaum The previous patch modifies the PC_I440FX_MACHINE_OPTIONS and PC_Q35_MACHINE_OPTIONS macros, both of which are dead code in RHEL (surrounded by '#if 0'). Therefore the RHEL machine types must be assigned to sorting families manually. The PC_DEFAULT_MACHINE_OPTIONS macro cannot be used to specify the sorting family, for the same reason as in upstream: because the macro is shared between q35 and i440fx machine types. (A small difference is that while in upstream the macro is shared through PC_I440FX_MACHINE_OPTIONS and PC_Q35_MACHINE_OPTIONS, the RHEL machine types, both q35 and i440fx, refer to PC_DEFAULT_MACHINE_OPTIONS directly.) Another reason for associating RHEL machine types with sorting families one-by-one is that the rhel6.*.0 machine type name sorts *before* pc-i440fx-rhel7.*.0 because machine types in the same family are sorted in alphabetically decreasing order (to accommodate version numbers). While this works nicely for upstream machine type names (see the commit message on the previous patch), we changed the *prefix* between rhel6.*.0 and pc-i440fx-rhel7.*.0 machine type names, and if we put all of those just in the "pc_piix" sorting family, we get Supported machines are: | rhel6.5.0 RHEL 6.5.0 PC | rhel6.4.0 RHEL 6.4.0 PC | rhel6.3.0 RHEL 6.3.0 PC | rhel6.2.0 RHEL 6.2.0 PC pc_piix | rhel6.1.0 RHEL 6.1.0 PC | rhel6.0.0 RHEL 6.0.0 PC | pc RHEL 7.1.0 PC (i440FX + PIIX, 1996) (alias of pc-i440fx-rhel7.1.0) | pc-i440fx-rhel7.1.0 RHEL 7.1.0 PC (i440FX + PIIX, 1996) (default) | pc-i440fx-rhel7.0.0 RHEL 7.0.0 PC (i440FX + PIIX, 1996) | q35 RHEL-7.1.0 PC (Q35 + ICH9, 2009) (alias of pc-q35-rhel7.1.0) pc_q35 | pc-q35-rhel7.1.0 RHEL-7.1.0 PC (Q35 + ICH9, 2009) | pc-q35-rhel7.0.0 RHEL-7.0.0 PC (Q35 + ICH9, 2009) no family | none empty machine For this reason, rhel6.*.0 and pc-i440fx-rhel7.*.0 types are placed in separate sorting families. (The families are not used for anything else, just sorting.) Since families are sorted between each other in increasing order, we assign rhel6.*.0 to "pc_piix_Z", and pc-i440fx-rhel7.*.0 to "pc_piix_Y". Theoretically, this allows for future rhel8 machine types ("pc_piix_X") -- for which reason the scheme is applied to q35 as well --, plus we end up with the order explicitly requested by QE (in ): Supported machines are: | pc RHEL 7.1.0 PC (i440FX + PIIX, 1996) (alias of pc-i440fx-rhel7.1.0) pc_piix_Y | pc-i440fx-rhel7.1.0 RHEL 7.1.0 PC (i440FX + PIIX, 1996) (default) | pc-i440fx-rhel7.0.0 RHEL 7.0.0 PC (i440FX + PIIX, 1996) | rhel6.5.0 RHEL 6.5.0 PC | rhel6.4.0 RHEL 6.4.0 PC pc_piix_Z | rhel6.3.0 RHEL 6.3.0 PC | rhel6.2.0 RHEL 6.2.0 PC | rhel6.1.0 RHEL 6.1.0 PC | rhel6.0.0 RHEL 6.0.0 PC | q35 RHEL-7.1.0 PC (Q35 + ICH9, 2009) (alias of pc-q35-rhel7.1.0) pc_q35_Z | pc-q35-rhel7.1.0 RHEL-7.1.0 PC (Q35 + ICH9, 2009) | pc-q35-rhel7.0.0 RHEL-7.0.0 PC (Q35 + ICH9, 2009) no family | none empty machine Signed-off-by: Laszlo Ersek Signed-off-by: Miroslav Rezanina --- hw/i386/pc_piix.c | 8 ++++++++ hw/i386/pc_q35.c | 2 ++ 2 files changed, 10 insertions(+) diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c index 9178b41..9abc86b 100644 --- a/hw/i386/pc_piix.c +++ b/hw/i386/pc_piix.c @@ -953,6 +953,7 @@ static void pc_init_rhel710(MachineState *machine) static QEMUMachine pc_machine_rhel710 = { PC_DEFAULT_MACHINE_OPTIONS, + .family = "pc_piix_Y", .name = "pc-i440fx-rhel7.1.0", .alias = "pc", .desc = "RHEL 7.1.0 PC (i440FX + PIIX, 1996)", @@ -996,6 +997,7 @@ static void pc_init_rhel700(MachineState *machine) static QEMUMachine pc_machine_rhel700 = { PC_DEFAULT_MACHINE_OPTIONS, + .family = "pc_piix_Y", .name = "pc-i440fx-rhel7.0.0", .desc = "RHEL 7.0.0 PC (i440FX + PIIX, 1996)", .init = pc_init_rhel700, @@ -1183,6 +1185,7 @@ static void pc_init_rhel650(MachineState *machine) static QEMUMachine pc_machine_rhel650 = { PC_DEFAULT_MACHINE_OPTIONS, + .family = "pc_piix_Z", .name = "rhel6.5.0", .desc = "RHEL 6.5.0 PC", .init = pc_init_rhel650, @@ -1230,6 +1233,7 @@ static void pc_init_rhel640(MachineState *machine) static QEMUMachine pc_machine_rhel640 = { PC_DEFAULT_MACHINE_OPTIONS, + .family = "pc_piix_Z", .name = "rhel6.4.0", .desc = "RHEL 6.4.0 PC", .init = pc_init_rhel640, @@ -1304,6 +1308,7 @@ static void pc_init_rhel630(MachineState *machine) static QEMUMachine pc_machine_rhel630 = { PC_DEFAULT_MACHINE_OPTIONS, + .family = "pc_piix_Z", .name = "rhel6.3.0", .desc = "RHEL 6.3.0 PC", .init = pc_init_rhel630, @@ -1334,6 +1339,7 @@ static void pc_init_rhel620(MachineState *machine) static QEMUMachine pc_machine_rhel620 = { PC_DEFAULT_MACHINE_OPTIONS, + .family = "pc_piix_Z", .name = "rhel6.2.0", .desc = "RHEL 6.2.0 PC", .init = pc_init_rhel620, @@ -1405,6 +1411,7 @@ static void pc_init_rhel610(MachineState *machine) static QEMUMachine pc_machine_rhel610 = { PC_DEFAULT_MACHINE_OPTIONS, + .family = "pc_piix_Z", .name = "rhel6.1.0", .desc = "RHEL 6.1.0 PC", .init = pc_init_rhel610, @@ -1443,6 +1450,7 @@ static void pc_init_rhel600(MachineState *machine) static QEMUMachine pc_machine_rhel600 = { PC_DEFAULT_MACHINE_OPTIONS, + .family = "pc_piix_Z", .name = "rhel6.0.0", .desc = "RHEL 6.0.0 PC", .init = pc_init_rhel600, diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c index f9e841b..a78cbb6 100644 --- a/hw/i386/pc_q35.c +++ b/hw/i386/pc_q35.c @@ -469,6 +469,7 @@ static void pc_q35_init_rhel710(MachineState *machine) static QEMUMachine pc_q35_machine_rhel710 = { PC_DEFAULT_MACHINE_OPTIONS, + .family = "pc_q35_Z", .name = "pc-q35-rhel7.1.0", .alias = "q35", .desc = "RHEL-7.1.0 PC (Q35 + ICH9, 2009)", @@ -510,6 +511,7 @@ static void pc_q35_init_rhel700(MachineState *machine) static QEMUMachine pc_q35_machine_rhel700 = { PC_DEFAULT_MACHINE_OPTIONS, + .family = "pc_q35_Z", .name = "pc-q35-rhel7.0.0", .desc = "RHEL-7.0.0 PC (Q35 + ICH9, 2009)", .init = pc_q35_init_rhel700, -- 1.8.3.1