hw: Clean up bogus default boot order

We set default boot order "cad" in every single machine definition
except "pseries" and "moxiesim", even though very few boards actually
care for boot order, and "cad" makes sense for even fewer.

Machines that care:

* pc and its variants

  Accept up to three letters 'a', 'b' (undocumented alias for 'a'),
  'c', 'd' and 'n'.  Reject all others (fatal with -boot).

* nseries (n800, n810)

  Check whether order starts with 'n'.  Silently ignored otherwise.

* prep, g3beige, mac99

  Extract the first character the machine understands (subset of
  'a'..'f').  Silently ignored otherwise.

* spapr

  Accept an arbitrary string (vl.c restricts it to contain only
  'a'..'p', no duplicates).

* sun4[mdc]

  Use the first character.  Silently ignored otherwise.

Strip characters these machines ignore from their default boot order.

For all other machines, remove the unused default boot order
alltogether.

Note that my rename of QEMUMachine member boot_order to
default_boot_order and QEMUMachineInitArgs member boot_device to
boot_order has a welcome side effect: it makes every use of boot
orders visible in this patch, for easy review.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
This commit is contained in:
Markus Armbruster 2013-08-16 13:13:50 +02:00 committed by Michael S. Tsirkin
parent 3bf4dfdd11
commit c165473269
59 changed files with 51 additions and 119 deletions

View file

@ -204,7 +204,7 @@ static void pc_init1(QEMUMachineInitArgs *args,
}
}
pc_cmos_init(below_4g_mem_size, above_4g_mem_size, args->boot_device,
pc_cmos_init(below_4g_mem_size, above_4g_mem_size, args->boot_order,
floppy, idebus[0], idebus[1], rtc_state);
if (pci_enabled && usb_enabled(false)) {
@ -342,7 +342,7 @@ static QEMUMachine pc_i440fx_machine_v1_6 = {
.hot_add_cpu = pc_hot_add_cpu,
.max_cpus = 255,
.is_default = 1,
DEFAULT_MACHINE_OPTIONS,
.default_boot_order = "cad",
};
static QEMUMachine pc_i440fx_machine_v1_5 = {
@ -355,7 +355,7 @@ static QEMUMachine pc_i440fx_machine_v1_5 = {
PC_COMPAT_1_5,
{ /* end of list */ }
},
DEFAULT_MACHINE_OPTIONS,
.default_boot_order = "cad",
};
static QEMUMachine pc_i440fx_machine_v1_4 = {
@ -363,11 +363,11 @@ static QEMUMachine pc_i440fx_machine_v1_4 = {
.desc = "Standard PC (i440FX + PIIX, 1996)",
.init = pc_init_pci_1_4,
.max_cpus = 255,
.default_boot_order = "cad",
.compat_props = (GlobalProperty[]) {
PC_COMPAT_1_4,
{ /* end of list */ }
},
DEFAULT_MACHINE_OPTIONS,
};
#define PC_COMPAT_1_3 \
@ -395,11 +395,11 @@ static QEMUMachine pc_machine_v1_3 = {
.desc = "Standard PC",
.init = pc_init_pci_1_3,
.max_cpus = 255,
.default_boot_order = "cad",
.compat_props = (GlobalProperty[]) {
PC_COMPAT_1_3,
{ /* end of list */ }
},
DEFAULT_MACHINE_OPTIONS,
};
#define PC_COMPAT_1_2 \
@ -435,11 +435,11 @@ static QEMUMachine pc_machine_v1_2 = {
.desc = "Standard PC",
.init = pc_init_pci_1_2,
.max_cpus = 255,
.default_boot_order = "cad",
.compat_props = (GlobalProperty[]) {
PC_COMPAT_1_2,
{ /* end of list */ }
},
DEFAULT_MACHINE_OPTIONS,
};
#define PC_COMPAT_1_1 \
@ -479,11 +479,11 @@ static QEMUMachine pc_machine_v1_1 = {
.desc = "Standard PC",
.init = pc_init_pci_1_2,
.max_cpus = 255,
.default_boot_order = "cad",
.compat_props = (GlobalProperty[]) {
PC_COMPAT_1_1,
{ /* end of list */ }
},
DEFAULT_MACHINE_OPTIONS,
};
#define PC_COMPAT_1_0 \
@ -511,12 +511,12 @@ static QEMUMachine pc_machine_v1_0 = {
.desc = "Standard PC",
.init = pc_init_pci_1_2,
.max_cpus = 255,
.default_boot_order = "cad",
.compat_props = (GlobalProperty[]) {
PC_COMPAT_1_0,
{ /* end of list */ }
},
.hw_version = "1.0",
DEFAULT_MACHINE_OPTIONS,
};
#define PC_COMPAT_0_15 \
@ -527,12 +527,12 @@ static QEMUMachine pc_machine_v0_15 = {
.desc = "Standard PC",
.init = pc_init_pci_1_2,
.max_cpus = 255,
.default_boot_order = "cad",
.compat_props = (GlobalProperty[]) {
PC_COMPAT_0_15,
{ /* end of list */ }
},
.hw_version = "0.15",
DEFAULT_MACHINE_OPTIONS,
};
#define PC_COMPAT_0_14 \
@ -560,6 +560,7 @@ static QEMUMachine pc_machine_v0_14 = {
.desc = "Standard PC",
.init = pc_init_pci_1_2,
.max_cpus = 255,
.default_boot_order = "cad",
.compat_props = (GlobalProperty[]) {
PC_COMPAT_0_14,
{
@ -574,7 +575,6 @@ static QEMUMachine pc_machine_v0_14 = {
{ /* end of list */ }
},
.hw_version = "0.14",
DEFAULT_MACHINE_OPTIONS,
};
#define PC_COMPAT_0_13 \
@ -594,6 +594,7 @@ static QEMUMachine pc_machine_v0_13 = {
.desc = "Standard PC",
.init = pc_init_pci_no_kvmclock,
.max_cpus = 255,
.default_boot_order = "cad",
.compat_props = (GlobalProperty[]) {
PC_COMPAT_0_13,
{
@ -612,7 +613,6 @@ static QEMUMachine pc_machine_v0_13 = {
{ /* end of list */ }
},
.hw_version = "0.13",
DEFAULT_MACHINE_OPTIONS,
};
#define PC_COMPAT_0_12 \
@ -644,6 +644,7 @@ static QEMUMachine pc_machine_v0_12 = {
.desc = "Standard PC",
.init = pc_init_pci_no_kvmclock,
.max_cpus = 255,
.default_boot_order = "cad",
.compat_props = (GlobalProperty[]) {
PC_COMPAT_0_12,
{
@ -658,7 +659,6 @@ static QEMUMachine pc_machine_v0_12 = {
{ /* end of list */ }
},
.hw_version = "0.12",
DEFAULT_MACHINE_OPTIONS,
};
#define PC_COMPAT_0_11 \
@ -678,6 +678,7 @@ static QEMUMachine pc_machine_v0_11 = {
.desc = "Standard PC, qemu 0.11",
.init = pc_init_pci_no_kvmclock,
.max_cpus = 255,
.default_boot_order = "cad",
.compat_props = (GlobalProperty[]) {
PC_COMPAT_0_11,
{
@ -692,7 +693,6 @@ static QEMUMachine pc_machine_v0_11 = {
{ /* end of list */ }
},
.hw_version = "0.11",
DEFAULT_MACHINE_OPTIONS,
};
static QEMUMachine pc_machine_v0_10 = {
@ -700,6 +700,7 @@ static QEMUMachine pc_machine_v0_10 = {
.desc = "Standard PC, qemu 0.10",
.init = pc_init_pci_no_kvmclock,
.max_cpus = 255,
.default_boot_order = "cad",
.compat_props = (GlobalProperty[]) {
PC_COMPAT_0_11,
{
@ -726,7 +727,6 @@ static QEMUMachine pc_machine_v0_10 = {
{ /* end of list */ }
},
.hw_version = "0.10",
DEFAULT_MACHINE_OPTIONS,
};
static QEMUMachine isapc_machine = {
@ -734,10 +734,10 @@ static QEMUMachine isapc_machine = {
.desc = "ISA-only PC",
.init = pc_init_isa,
.max_cpus = 1,
.default_boot_order = "cad",
.compat_props = (GlobalProperty[]) {
{ /* end of list */ }
},
DEFAULT_MACHINE_OPTIONS,
};
#ifdef CONFIG_XEN
@ -747,7 +747,7 @@ static QEMUMachine xenfv_machine = {
.init = pc_xen_hvm_init,
.max_cpus = HVM_MAX_VCPUS,
.default_machine_opts = "accel=xen",
DEFAULT_MACHINE_OPTIONS,
.default_boot_order = "cad",
};
#endif

View file

@ -200,7 +200,7 @@ static void pc_q35_init(QEMUMachineInitArgs *args)
0xb100),
8, NULL, 0);
pc_cmos_init(below_4g_mem_size, above_4g_mem_size, args->boot_device,
pc_cmos_init(below_4g_mem_size, above_4g_mem_size, args->boot_order,
floppy, idebus[0], idebus[1], rtc_state);
/* the rest devices to which pci devfn is automatically assigned */
@ -260,7 +260,7 @@ static QEMUMachine pc_q35_machine_v1_6 = {
.init = pc_q35_init_1_6,
.hot_add_cpu = pc_hot_add_cpu,
.max_cpus = 255,
DEFAULT_MACHINE_OPTIONS,
.default_boot_order = "cad",
};
static QEMUMachine pc_q35_machine_v1_5 = {
@ -269,11 +269,11 @@ static QEMUMachine pc_q35_machine_v1_5 = {
.init = pc_q35_init_1_5,
.hot_add_cpu = pc_hot_add_cpu,
.max_cpus = 255,
.default_boot_order = "cad",
.compat_props = (GlobalProperty[]) {
PC_COMPAT_1_5,
{ /* end of list */ }
},
DEFAULT_MACHINE_OPTIONS,
};
static QEMUMachine pc_q35_machine_v1_4 = {
@ -281,11 +281,11 @@ static QEMUMachine pc_q35_machine_v1_4 = {
.desc = "Standard PC (Q35 + ICH9, 2009)",
.init = pc_q35_init_1_4,
.max_cpus = 255,
.default_boot_order = "cad",
.compat_props = (GlobalProperty[]) {
PC_COMPAT_1_4,
{ /* end of list */ }
},
DEFAULT_MACHINE_OPTIONS,
};
static void pc_q35_machine_init(void)

View file

@ -99,7 +99,6 @@ static QEMUMachine xenpv_machine = {
.init = xen_init_pv,
.max_cpus = 1,
.default_machine_opts = "accel=xen",
DEFAULT_MACHINE_OPTIONS,
};
static void xenpv_machine_init(void)