Qemu boot order patch series
v2 cover Qemu boot order patch series
Hi,
This patch series implements requirement 1 of the mailing list discussion [1], i.e., to allow a machine to specify if it wants a default boot order or not.
Regards,
Avik
[1] http://lists.nongnu.org/archive/html/qemu-devel/2012-10/msg02799.html
Changes v1 -> v2:
- Set default boot order for every machine
- Remove default boot order for pseries
Avik Sil (2):
Make default boot order machine specific
pseries: set no default boot order
hw/alpha_dp264.c | 1 + hw/an5206.c | 1 + hw/axis_dev88.c | 1 + hw/boards.h | 2 ++ hw/collie.c | 1 + hw/dummy_m68k.c | 1 + hw/exynos4_boards.c | 2 ++ hw/gumstix.c | 2 ++ hw/highbank.c | 1 + hw/integratorcp.c | 1 + hw/kzm.c | 1 + hw/leon3.c | 1 + hw/lm32_boards.c | 2 ++ hw/mainstone.c | 1 + hw/mcf5208.c | 1 + hw/milkymist.c | 1 + hw/mips_fulong2e.c | 1 + hw/mips_jazz.c | 2 ++ hw/mips_malta.c | 1 + hw/mips_mipssim.c | 1 + hw/mips_r4k.c | 1 + hw/musicpal.c | 1 + hw/nseries.c | 2 ++ hw/null-machine.c | 1 + hw/omap_sx1.c | 2 ++ hw/openrisc_sim.c | 1 + hw/palm.c | 1 + hw/pc_piix.c | 13 ++++++++++++- hw/petalogix_ml605_mmu.c | 1 + hw/petalogix_s3adsp1800_mmu.c | 1 + hw/ppc/e500plat.c | 1 + hw/ppc/mpc8544ds.c | 1 + hw/ppc405_boards.c | 2 ++ hw/ppc440_bamboo.c | 1 + hw/ppc_newworld.c | 1 + hw/ppc_oldworld.c | 1 + hw/ppc_prep.c | 1 + hw/puv3.c | 1 + hw/r2d.c | 1 + hw/realview.c | 4 ++++ hw/s390-virtio.c | 1 + hw/shix.c | 1 + hw/spapr.c | 4 +++- hw/spitz.c | 4 ++++ hw/stellaris.c | 2 ++ hw/sun4m.c | 12 ++++++++++++ hw/sun4u.c | 3 +++ hw/tosa.c | 1 + hw/versatilepb.c | 2 ++ hw/vexpress.c | 2 ++ hw/virtex_ml507.c | 1 + hw/xen_machine_pv.c | 2 +- hw/xilinx_zynq.c | 1 + hw/xtensa_lx60.c | 2 ++ hw/xtensa_sim.c | 1 + hw/z2.c | 1 + qemu-config.c | 6 +++++- vl.c | 13 +++++++++---- 58 files changed, 114 insertions(+), 8 deletions(-)
Signature · 1 line
1.7.11.4
PATCH v2 1/2 Make default boot order machine specific
This patch makes default boot order machine specific instead of set globally. The default boot order can be set per machine in QEMUMachine default_machine_opts, or by the command line using -machine <machine_name>,boot=<boot_devices>, or by standard -boot option. This allows a machine to receive a NULL boot order when -boot isn't used and take an appropriate action accordingly. This helps machine boots from the devices as set in guest's non-volatile memory location in case no boot order is provided by the user.
--- hw/alpha_dp264.c | 1 + hw/an5206.c | 1 + hw/axis_dev88.c | 1 + hw/boards.h | 2 ++ hw/collie.c | 1 + hw/dummy_m68k.c | 1 + hw/exynos4_boards.c | 2 ++ hw/gumstix.c | 2 ++ hw/highbank.c | 1 + hw/integratorcp.c | 1 + hw/kzm.c | 1 + hw/leon3.c | 1 + hw/lm32_boards.c | 2 ++ hw/mainstone.c | 1 + hw/mcf5208.c | 1 + hw/milkymist.c | 1 + hw/mips_fulong2e.c | 1 + hw/mips_jazz.c | 2 ++ hw/mips_malta.c | 1 + hw/mips_mipssim.c | 1 + hw/mips_r4k.c | 1 + hw/musicpal.c | 1 + hw/nseries.c | 2 ++ hw/null-machine.c | 1 + hw/omap_sx1.c | 2 ++ hw/openrisc_sim.c | 1 + hw/palm.c | 1 + hw/pc_piix.c | 13 ++++++++++++- hw/petalogix_ml605_mmu.c | 1 + hw/petalogix_s3adsp1800_mmu.c | 1 + hw/ppc/e500plat.c | 1 + hw/ppc/mpc8544ds.c | 1 + hw/ppc405_boards.c | 2 ++ hw/ppc440_bamboo.c | 1 + hw/ppc_newworld.c | 1 + hw/ppc_oldworld.c | 1 + hw/ppc_prep.c | 1 + hw/puv3.c | 1 + hw/r2d.c | 1 + hw/realview.c | 4 ++++ hw/s390-virtio.c | 1 + hw/shix.c | 1 + hw/spapr.c | 1 + hw/spitz.c | 4 ++++ hw/stellaris.c | 2 ++ hw/sun4m.c | 12 ++++++++++++ hw/sun4u.c | 3 +++ hw/tosa.c | 1 + hw/versatilepb.c | 2 ++ hw/vexpress.c | 2 ++ hw/virtex_ml507.c | 1 + hw/xen_machine_pv.c | 2 +- hw/xilinx_zynq.c | 1 + hw/xtensa_lx60.c | 2 ++ hw/xtensa_sim.c | 1 + hw/z2.c | 1 + qemu-config.c | 6 +++++- vl.c | 13 +++++++++---- 58 files changed, 112 insertions(+), 7 deletions(-)
hw/alpha_dp264.c +1 -0
@@ -171,6 +171,7 @@ static QEMUMachine clipper_machine = { .init = clipper_init, .max_cpus = 4, .is_default = 1, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void clipper_machine_init (void )
hw/an5206.c +1 -0
@@ -86,6 +86,7 @@ static QEMUMachine an5206_machine = { .name = "an5206", .desc = "Arnewsh 5206", .init = an5206_init, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void an5206_machine_init (void )
hw/axis_dev88.c +1 -0
@@ -355,6 +355,7 @@ static QEMUMachine axisdev88_machine = { .desc = "AXIS devboard 88", .init = axisdev88_init, .is_default = 1, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void axisdev88_machine_init (void )
hw/boards.h +2 -0
@@ -5,6 +5,8 @@#include "qdev.h" +#define DEFAULT_BOOT_ORDER "boot=cad"/* default to HD->floppy->CD-ROM */ + typedef struct QEMUMachineInitArgs { ram_addr_t ram_size; const char *boot_device;
hw/collie.c +1 -0
@@ -62,6 +62,7 @@ static QEMUMachine collie_machine = { .name = "collie", .desc = "Collie PDA (SA-1110)", .init = collie_init, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void collie_machine_init (void )
hw/dummy_m68k.c +1 -0
@@ -73,6 +73,7 @@ static QEMUMachine dummy_m68k_machine = { .name = "dummy", .desc = "Dummy board", .init = dummy_m68k_init, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void dummy_m68k_machine_init (void )
hw/exynos4_boards.c +2 -0
@@ -160,12 +160,14 @@ static QEMUMachine exynos4_machines[EXYNOS4_NUM_OF_BOARDS] = { .desc = "Samsung NURI board (Exynos4210)", .init = nuri_init, .max_cpus = EXYNOS4210_NCPUS, + .default_machine_opts = DEFAULT_BOOT_ORDER, }, [EXYNOS4_BOARD_SMDKC210] = { .name = "smdkc210", .desc = "Samsung SMDKC210 board (Exynos4210)", .init = smdkc210_init, .max_cpus = EXYNOS4210_NCPUS, + .default_machine_opts = DEFAULT_BOOT_ORDER, }, };
hw/gumstix.c +2 -0
@@ -122,12 +122,14 @@ static QEMUMachine connex_machine = { .name = "connex", .desc = "Gumstix Connex (PXA255)", .init = connex_init, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static QEMUMachine verdex_machine = { .name ="verdex" , .desc ="Gumstix Verdex (PXA270)" , .init = verdex_init, + .default_machine_opts =DEFAULT_BOOT_ORDER , };static void gumstix_machine_init (void )
hw/highbank.c +1 -0
@@ -328,6 +328,7 @@ static QEMUMachine highbank_machine = { .init = highbank_init, .use_scsi = 1, .max_cpus = 4, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void highbank_machine_init (void )
hw/integratorcp.c +1 -0
@@ -512,6 +512,7 @@ static QEMUMachine integratorcp_machine = { .desc = "ARM Integrator/CP (ARM926EJ-S)", .init = integratorcp_init, .is_default = 1, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void integratorcp_machine_init (void )
hw/kzm.c +1 -0
@@ -146,6 +146,7 @@ static QEMUMachine kzm_machine = { .name = "kzm", .desc = "ARM KZM Emulation Baseboard (ARM1136)", .init = kzm_init, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void kzm_machine_init (void )
hw/leon3.c +1 -0
@@ -213,6 +213,7 @@ static QEMUMachine leon3_generic_machine = { .desc = "Leon-3 generic", .init = leon3_generic_hw_init, .use_scsi = 0, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void leon3_machine_init (void )
hw/lm32_boards.c +2 -0
@@ -289,6 +289,7 @@ static QEMUMachine lm32_evr_machine = { .desc = "LatticeMico32 EVR32 eval system", .init = lm32_evr_init, .is_default = 1 + .default_machine_opts = DEFAULT_BOOT_ORDER, };static QEMUMachine lm32_uclinux_machine = {
@@ -296,6 +297,7 @@ static QEMUMachine lm32_uclinux_machine = { .desc = "lm32 platform for uClinux and u-boot by Theobroma Systems", .init = lm32_uclinux_init, .is_default = 0 + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void lm32_machine_init (void )
hw/mainstone.c +1 -0
@@ -186,6 +186,7 @@ static QEMUMachine mainstone2_machine = { .name = "mainstone", .desc = "Mainstone II (PXA27x)", .init = mainstone_init, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void mainstone_machine_init (void )
hw/mcf5208.c +1 -0
@@ -292,6 +292,7 @@ static QEMUMachine mcf5208evb_machine = { .desc = "MCF5206EVB", .init = mcf5208evb_init, .is_default = 1, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void mcf5208evb_machine_init (void )
hw/milkymist.c +1 -0
@@ -208,6 +208,7 @@ static QEMUMachine milkymist_machine = { .desc = "Milkymist One", .init = milkymist_init, .is_default = 0 + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void milkymist_machine_init (void )
hw/mips_fulong2e.c +1 -0
@@ -400,6 +400,7 @@ static QEMUMachine mips_fulong2e_machine = { .name = "fulong2e", .desc = "Fulong 2e mini pc", .init = mips_fulong2e_init, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void mips_fulong2e_machine_init (void )
hw/mips_jazz.c +2 -0
@@ -325,6 +325,7 @@ static QEMUMachine mips_magnum_machine = { .desc = "MIPS Magnum", .init = mips_magnum_init, .use_scsi = 1, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static QEMUMachine mips_pica61_machine = {
@@ -332,6 +333,7 @@ static QEMUMachine mips_pica61_machine = { .desc = "Acer Pica 61", .init = mips_pica61_init, .use_scsi = 1, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void mips_jazz_machine_init (void )
hw/mips_malta.c +1 -0
@@ -1016,6 +1016,7 @@ static QEMUMachine mips_malta_machine = { .init = mips_malta_init, .max_cpus = 16, .is_default = 1, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void mips_malta_register_types (void )
hw/mips_mipssim.c +1 -0
@@ -228,6 +228,7 @@ static QEMUMachine mips_mipssim_machine = { .name = "mipssim", .desc = "MIPS MIPSsim platform", .init = mips_mipssim_init, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void mips_mipssim_machine_init (void )
hw/mips_r4k.c +1 -0
@@ -302,6 +302,7 @@ static QEMUMachine mips_machine = { .name = "mips", .desc = "mips r4k platform", .init = mips_r4k_init, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void mips_machine_init (void )
hw/musicpal.c +1 -0
@@ -1659,6 +1659,7 @@ static QEMUMachine musicpal_machine = { .name = "musicpal", .desc = "Marvell 88w8618 / MusicPal (ARM926EJ-S)", .init = musicpal_init, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void musicpal_machine_init (void )
hw/nseries.c +2 -0
@@ -1427,12 +1427,14 @@ static QEMUMachine n800_machine = { .name = "n800", .desc = "Nokia N800 tablet aka. RX-34 (OMAP2420)", .init = n800_init, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static QEMUMachine n810_machine = { .name ="n810" , .desc ="Nokia N810 tablet aka. RX-44 (OMAP2420)" , .init = n810_init, + .default_machine_opts =DEFAULT_BOOT_ORDER , };static void nseries_machine_init (void )
hw/null-machine.c +1 -0
@@ -24,6 +24,7 @@ static QEMUMachine machine_none = { .desc = "empty machine", .init = machine_none_init, .max_cpus = 0, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void register_machines (void )
hw/omap_sx1.c +2 -0
@@ -237,12 +237,14 @@ static QEMUMachine sx1_machine_v2 = { .name = "sx1", .desc = "Siemens SX1 (OMAP310) V2", .init = sx1_init_v2, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static QEMUMachine sx1_machine_v1 = { .name ="sx1-v1" , .desc ="Siemens SX1 (OMAP310) V1" , .init = sx1_init_v1, + .default_machine_opts =DEFAULT_BOOT_ORDER , };static void sx1_machine_init (void )
hw/openrisc_sim.c +1 -0
@@ -139,6 +139,7 @@ static QEMUMachine openrisc_sim_machine = { .init = openrisc_sim_init, .max_cpus = 1, .is_default = 1, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void openrisc_sim_machine_init (void )
hw/palm.c +1 -0
@@ -280,6 +280,7 @@ static QEMUMachine palmte_machine = { .name = "cheetah", .desc = "Palm Tungsten|E aka. Cheetah PDA (OMAP310)", .init = palmte_init, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void palmte_machine_init (void )
hw/pc_piix.c +12 -1
@@ -352,6 +352,7 @@ static QEMUMachine pc_machine_v1_3 = { .init = pc_init_pci, .max_cpus = 255, .is_default = 1, + .default_machine_opts = DEFAULT_BOOT_ORDER, };#define PC_COMPAT_1_2 \
@@ -390,6 +391,7 @@ static QEMUMachine pc_machine_v1_2 = { PC_COMPAT_1_2, {/* end of list */ } }, + .default_machine_opts = DEFAULT_BOOT_ORDER, };#define PC_COMPAT_1_1 \
@@ -433,6 +435,7 @@ static QEMUMachine pc_machine_v1_1 = { PC_COMPAT_1_1, {/* end of list */ } }, + .default_machine_opts = DEFAULT_BOOT_ORDER, };#define PC_COMPAT_1_0 \
@@ -469,6 +472,7 @@ static QEMUMachine pc_machine_v1_0 = { {/* end of list */ } }, .hw_version = "1.0", + .default_machine_opts = DEFAULT_BOOT_ORDER, };#define PC_COMPAT_0_15 \
@@ -484,6 +488,7 @@ static QEMUMachine pc_machine_v0_15 = { {/* end of list */ } }, .hw_version = "0.15", + .default_machine_opts = DEFAULT_BOOT_ORDER, };#define PC_COMPAT_0_14 \
@@ -525,6 +530,7 @@ static QEMUMachine pc_machine_v0_14 = { {/* end of list */ } }, .hw_version = "0.14", + .default_machine_opts = DEFAULT_BOOT_ORDER, };#define PC_COMPAT_0_13 \
@@ -562,6 +568,7 @@ static QEMUMachine pc_machine_v0_13 = { {/* end of list */ } }, .hw_version = "0.13", + .default_machine_opts = DEFAULT_BOOT_ORDER, };#define PC_COMPAT_0_12 \
@@ -595,6 +602,7 @@ static QEMUMachine pc_machine_v0_12 = { {/* end of list */ } }, .hw_version = "0.12", + .default_machine_opts = DEFAULT_BOOT_ORDER, };#define PC_COMPAT_0_11 \
@@ -628,6 +636,7 @@ static QEMUMachine pc_machine_v0_11 = { {/* end of list */ } }, .hw_version = "0.11", + .default_machine_opts = DEFAULT_BOOT_ORDER, };static QEMUMachine pc_machine_v0_10 = {
@@ -661,6 +670,7 @@ static QEMUMachine pc_machine_v0_10 = { {/* end of list */ } }, .hw_version = "0.10", + .default_machine_opts = DEFAULT_BOOT_ORDER, };static QEMUMachine isapc_machine = {
@@ -676,6 +686,7 @@ static QEMUMachine isapc_machine = { }, {/* end of list */ } }, + .default_machine_opts = DEFAULT_BOOT_ORDER, };#ifdef CONFIG_XEN
@@ -684,7 +695,7 @@ static QEMUMachine xenfv_machine = { .desc = "Xen Fully-virtualized PC", .init = pc_xen_hvm_init, .max_cpus = HVM_MAX_VCPUS, - .default_machine_opts = "accel=xen", + .default_machine_opts = "accel=xen," DEFAULT_BOOT_ORDER, };#endif
hw/petalogix_ml605_mmu.c +1 -0
@@ -174,6 +174,7 @@ static QEMUMachine petalogix_ml605_machine = { .desc = "PetaLogix linux refdesign for xilinx ml605 little endian", .init = petalogix_ml605_init, .is_default = 0 + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void petalogix_ml605_machine_init (void )
hw/petalogix_s3adsp1800_mmu.c +1 -0
@@ -116,6 +116,7 @@ static QEMUMachine petalogix_s3adsp1800_machine = { .desc = "PetaLogix linux refdesign for xilinx Spartan 3ADSP1800", .init = petalogix_s3adsp1800_init, .is_default = 1 + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void petalogix_s3adsp1800_machine_init (void )
hw/ppc/e500plat.c +1 -0
@@ -51,6 +51,7 @@ static QEMUMachine e500plat_machine = { .desc = "generic paravirt e500 platform", .init = e500plat_init, .max_cpus = 15, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void e500plat_machine_init (void )
hw/ppc/mpc8544ds.c +1 -0
@@ -52,6 +52,7 @@ static QEMUMachine ppce500_machine = { .desc = "mpc8544ds", .init = mpc8544ds_init, .max_cpus = 15, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void ppce500_machine_init (void )
hw/ppc405_boards.c +2 -0
@@ -362,6 +362,7 @@ static QEMUMachine ref405ep_machine = { .name = "ref405ep", .desc = "ref405ep", .init = ref405ep_init, + .default_machine_opts = DEFAULT_BOOT_ORDER, };/*****************************************************************************/
@@ -649,6 +650,7 @@ static QEMUMachine taihu_machine = { .name = "taihu", .desc = "taihu", .init = taihu_405ep_init, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void ppc405_machine_init (void )
hw/ppc440_bamboo.c +1 -0
@@ -295,6 +295,7 @@ static QEMUMachine bamboo_machine = { .name = "bamboo", .desc = "bamboo", .init = bamboo_init, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void bamboo_machine_init (void )
hw/ppc_newworld.c +1 -0
@@ -426,6 +426,7 @@ static QEMUMachine core99_machine = {#ifdef TARGET_PPC64 .is_default = 1, #endif + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void core99_machine_init (void )
hw/ppc_oldworld.c +1 -0
@@ -341,6 +341,7 @@ static QEMUMachine heathrow_machine = {#ifndef TARGET_PPC64 .is_default = 1, #endif + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void heathrow_machine_init (void )
hw/ppc_prep.c +1 -0
@@ -694,6 +694,7 @@ static QEMUMachine prep_machine = { .desc = "PowerPC PREP platform", .init = ppc_prep_init, .max_cpus = MAX_CPUS, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void prep_machine_init (void )
hw/puv3.c +1 -0
@@ -123,6 +123,7 @@ static QEMUMachine puv3_machine = { .init = puv3_init, .is_default = 1, .use_scsi = 0, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void puv3_machine_init (void )
hw/r2d.c +1 -0
@@ -347,6 +347,7 @@ static QEMUMachine r2d_machine = { .name = "r2d", .desc = "r2d-plus board", .init = r2d_init, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void r2d_machine_init (void )
hw/realview.c +4 -0
@@ -395,6 +395,7 @@ static QEMUMachine realview_eb_machine = { .desc = "ARM RealView Emulation Baseboard (ARM926EJ-S)", .init = realview_eb_init, .use_scsi = 1, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static QEMUMachine realview_eb_mpcore_machine = {
@@ -403,12 +404,14 @@ static QEMUMachine realview_eb_mpcore_machine = { .init = realview_eb_mpcore_init, .use_scsi = 1, .max_cpus = 4, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static QEMUMachine realview_pb_a8_machine = { .name ="realview-pb-a8" , .desc ="ARM RealView Platform Baseboard for Cortex-A8" , .init = realview_pb_a8_init, + .default_machine_opts =DEFAULT_BOOT_ORDER , };static QEMUMachine realview_pbx_a9_machine = {
@@ -417,6 +420,7 @@ static QEMUMachine realview_pbx_a9_machine = { .init = realview_pbx_a9_init, .use_scsi = 1, .max_cpus = 4, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void realview_machine_init (void )
hw/s390-virtio.c +1 -0
@@ -343,6 +343,7 @@ static QEMUMachine s390_machine = { .use_virtcon = 1, .max_cpus = 255, .is_default = 1, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void s390_machine_init (void )
hw/shix.c +1 -0
@@ -92,6 +92,7 @@ static QEMUMachine shix_machine = { .desc = "shix card", .init = shix_init, .is_default = 1, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void shix_machine_init (void )
hw/spapr.c +1 -0
@@ -915,6 +915,7 @@ static QEMUMachine spapr_machine = { .max_cpus = MAX_CPUS, .no_parallel = 1, .use_scsi = 1, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void spapr_machine_init (void )
hw/spitz.c +4 -0
@@ -984,24 +984,28 @@ static QEMUMachine akitapda_machine = { .name = "akita", .desc = "Akita PDA (PXA270)", .init = akita_init, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static QEMUMachine spitzpda_machine = { .name ="spitz" , .desc ="Spitz PDA (PXA270)" , .init = spitz_init, + .default_machine_opts =DEFAULT_BOOT_ORDER , };static QEMUMachine borzoipda_machine = { .name ="borzoi" , .desc ="Borzoi PDA (PXA270)" , .init = borzoi_init, + .default_machine_opts =DEFAULT_BOOT_ORDER , };static QEMUMachine terrierpda_machine = { .name ="terrier" , .desc ="Terrier PDA (PXA270)" , .init = terrier_init, + .default_machine_opts =DEFAULT_BOOT_ORDER , };static void spitz_machine_init (void )
hw/stellaris.c +2 -0
@@ -1331,12 +1331,14 @@ static QEMUMachine lm3s811evb_machine = { .name = "lm3s811evb", .desc = "Stellaris LM3S811EVB", .init = lm3s811evb_init, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static QEMUMachine lm3s6965evb_machine = { .name ="lm3s6965evb" , .desc ="Stellaris LM3S6965EVB" , .init = lm3s6965evb_init, + .default_machine_opts =DEFAULT_BOOT_ORDER , };static void stellaris_machine_init (void )
hw/sun4m.c +12 -0
@@ -1428,6 +1428,7 @@ static QEMUMachine ss5_machine = { .init = ss5_init, .use_scsi = 1, .is_default = 1, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static QEMUMachine ss10_machine = {
@@ -1436,6 +1437,7 @@ static QEMUMachine ss10_machine = { .init = ss10_init, .use_scsi = 1, .max_cpus = 4, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static QEMUMachine ss600mp_machine = {
@@ -1444,6 +1446,7 @@ static QEMUMachine ss600mp_machine = { .init = ss600mp_init, .use_scsi = 1, .max_cpus = 4, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static QEMUMachine ss20_machine = {
@@ -1452,6 +1455,7 @@ static QEMUMachine ss20_machine = { .init = ss20_init, .use_scsi = 1, .max_cpus = 4, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static QEMUMachine voyager_machine = {
@@ -1459,6 +1463,7 @@ static QEMUMachine voyager_machine = { .desc = "Sun4m platform, SPARCstation Voyager", .init = vger_init, .use_scsi = 1, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static QEMUMachine ss_lx_machine = {
@@ -1466,6 +1471,7 @@ static QEMUMachine ss_lx_machine = { .desc = "Sun4m platform, SPARCstation LX", .init = ss_lx_init, .use_scsi = 1, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static QEMUMachine ss4_machine = {
@@ -1473,6 +1479,7 @@ static QEMUMachine ss4_machine = { .desc = "Sun4m platform, SPARCstation 4", .init = ss4_init, .use_scsi = 1, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static QEMUMachine scls_machine = {
@@ -1480,6 +1487,7 @@ static QEMUMachine scls_machine = { .desc = "Sun4m platform, SPARCClassic", .init = scls_init, .use_scsi = 1, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static QEMUMachine sbook_machine = {
@@ -1487,6 +1495,7 @@ static QEMUMachine sbook_machine = { .desc = "Sun4m platform, SPARCbook", .init = sbook_init, .use_scsi = 1, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static const struct sun4d_hwdef sun4d_hwdefs[] = {
@@ -1711,6 +1720,7 @@ static QEMUMachine ss1000_machine = { .init = ss1000_init, .use_scsi = 1, .max_cpus = 8, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static QEMUMachine ss2000_machine = {
@@ -1719,6 +1729,7 @@ static QEMUMachine ss2000_machine = { .init = ss2000_init, .use_scsi = 1, .max_cpus = 20, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static const struct sun4c_hwdef sun4c_hwdefs[] = {
@@ -1897,6 +1908,7 @@ static QEMUMachine ss2_machine = { .desc = "Sun4c platform, SPARCstation 2", .init = ss2_init, .use_scsi = 1, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void sun4m_register_types (void )
hw/sun4u.c +3 -0
@@ -978,6 +978,7 @@ static QEMUMachine sun4u_machine = { .init = sun4u_init, .max_cpus = 1, // XXX for now .is_default = 1, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static QEMUMachine sun4v_machine = {
@@ -985,6 +986,7 @@ static QEMUMachine sun4v_machine = { .desc = "Sun4v platform", .init = sun4v_init, .max_cpus = 1, // XXX for now + .default_machine_opts = DEFAULT_BOOT_ORDER, };static QEMUMachine niagara_machine = {
@@ -992,6 +994,7 @@ static QEMUMachine niagara_machine = { .desc = "Sun4v platform, Niagara", .init = niagara_init, .max_cpus = 1, // XXX for now + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void sun4u_register_types (void )
hw/tosa.c +1 -0
@@ -251,6 +251,7 @@ static QEMUMachine tosapda_machine = { .name = "tosa", .desc = "Tosa PDA (PXA255)", .init = tosa_init, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void tosapda_machine_init (void )
hw/versatilepb.c +2 -0
@@ -381,6 +381,7 @@ static QEMUMachine versatilepb_machine = { .desc = "ARM Versatile/PB (ARM926EJ-S)", .init = vpb_init, .use_scsi = 1, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static QEMUMachine versatileab_machine = {
@@ -388,6 +389,7 @@ static QEMUMachine versatileab_machine = { .desc = "ARM Versatile/AB (ARM926EJ-S)", .init = vab_init, .use_scsi = 1, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void versatile_machine_init (void )
hw/vexpress.c +2 -0
@@ -499,6 +499,7 @@ static QEMUMachine vexpress_a9_machine = { .init = vexpress_a9_init, .use_scsi = 1, .max_cpus = 4, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static QEMUMachine vexpress_a15_machine = {
@@ -507,6 +508,7 @@ static QEMUMachine vexpress_a15_machine = { .init = vexpress_a15_init, .use_scsi = 1, .max_cpus = 4, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void vexpress_machine_init (void )
hw/virtex_ml507.c +1 -0
@@ -264,6 +264,7 @@ static QEMUMachine virtex_machine = { .name = "virtex-ml507", .desc = "Xilinx Virtex ML507 reference design", .init = virtex_init, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void virtex_machine_init (void )
hw/xen_machine_pv.c +1 -1
@@ -114,7 +114,7 @@ static QEMUMachine xenpv_machine = { .desc = "Xen Para-virtualized PC", .init = xen_init_pv, .max_cpus = 1, - .default_machine_opts = "accel=xen", + .default_machine_opts = "accel=xen," DEFAULT_BOOT_ORDER, };static void xenpv_machine_init (void )
hw/xilinx_zynq.c +1 -0
@@ -184,6 +184,7 @@ static QEMUMachine zynq_machine = { .use_scsi = 1, .max_cpus = 1, .no_sdcard = 1 + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void zynq_machine_init (void )
hw/xtensa_lx60.c +2 -0
@@ -310,6 +310,7 @@ static QEMUMachine xtensa_lx60_machine = { .desc = "lx60 EVB (" XTENSA_DEFAULT_CPU_MODEL ")", .init = xtensa_lx60_init, .max_cpus = 4, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static QEMUMachine xtensa_lx200_machine = {
@@ -317,6 +318,7 @@ static QEMUMachine xtensa_lx200_machine = { .desc = "lx200 EVB (" XTENSA_DEFAULT_CPU_MODEL ")", .init = xtensa_lx200_init, .max_cpus = 4, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void xtensa_lx_machines_init (void )
hw/xtensa_sim.c +1 -0
@@ -117,6 +117,7 @@ static QEMUMachine xtensa_sim_machine = { .is_default = true, .init = xtensa_sim_init, .max_cpus = 4, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void xtensa_sim_machine_init (void )
hw/z2.c +1 -0
@@ -373,6 +373,7 @@ static QEMUMachine z2_machine = { .name = "z2", .desc = "Zipit Z2 (PXA27x)", .init = z2_init, + .default_machine_opts = DEFAULT_BOOT_ORDER, };static void z2_machine_init (void )
qemu-config.c +5 -1
@@ -619,7 +619,11 @@ static QemuOptsList qemu_machine_opts = { .name = "mem-merge", .type = QEMU_OPT_BOOL, .help = "enable/disable memory merge support", - }, + }, { + .name = "boot", + .type = QEMU_OPT_STRING, + .help = "boot order", + }, {/* End of list */ } }, };
vl.c +9 -4
@@ -2369,7 +2369,7 @@ int main(int argc, char **argv, char **envp)const char *icount_option =NULL ;const char *initrd_filename;const char *kernel_filename, *kernel_cmdline; -char boot_devices[33 ] ="cad" ;/* default to HD->floppy->CD-ROM */ +const char *boot_devices =NULL ;DisplayState *ds;DisplayChangeListener *dcl;int cyls, heads, secs, translation;
@@ -2645,7 +2645,7 @@ int main(int argc, char **argv, char **envp)"splash" ,"splash-time" , "reboot-timeout", NULL }; -char buf[sizeof (boot_devices)]; +char buf[33 ];char *standard_boot_devices;int legacy =0 ;
@@ -2662,14 +2662,18 @@ int main(int argc, char **argv, char **envp)if (legacy ||get_param_value (buf,sizeof (buf),"order" , optarg)) {validate_bootdevices (buf); -pstrcpy (boot_devices,sizeof (boot_devices), buf); + machine_opts =qemu_opts_create (qemu_find_opts ("machine" ), +NULL ,0 ,NULL ); +qemu_opt_set (machine_opts,"boot" , buf); }if (!legacy) {if (get_param_value (buf,sizeof (buf),"once" , optarg)) {validate_bootdevices (buf); standard_boot_devices =g_strdup (boot_devices); -pstrcpy (boot_devices,sizeof (boot_devices), buf); + machine_opts =qemu_opts_create (qemu_find_opts ("machine" ), +NULL ,0 ,NULL ); +qemu_opt_set (machine_opts,"boot" , buf);qemu_register_reset (restore_boot_devices, standard_boot_devices); }
@@ -3479,6 +3483,7 @@ int main(int argc, char **argv, char **envp) kernel_filename =qemu_opt_get (machine_opts,"kernel" ); initrd_filename =qemu_opt_get (machine_opts,"initrd" ); kernel_cmdline =qemu_opt_get (machine_opts,"append" ); + boot_devices =qemu_opt_get (machine_opts,"boot" ); }else { kernel_filename = initrd_filename = kernel_cmdline =NULL ; }
Signature · 1 line
1.7.11.4
Re: [Qemu-devel] [PATCH v2 1/2] Make default boot order machine specific
Quoted 16 lines · Avik Sil
hw/alpha_dp264.c +3
-0@@ -171,6 +171,7 @@ static QEMUMachine clipper_machine = { .init = clipper_init, .max_cpus = 4, .is_default = 1, + .default_machine_opts = DEFAULT_BOOT_ORDER, };@@ -86,6 +86,7 @@ static QEMUMachine an5206_machine = { .name = "an5206", .desc = "Arnewsh 5206", .init = an5206_init, + .default_machine_opts = DEFAULT_BOOT_ORDER, }; +++ b/hw/axis_dev88.c
hw/alpha_dp264.c static QEMUMachine axisdev88_machine = { · line 359
Quoted 5 lines
hw/alpha_dp264.c +1
-0@@ -355,6 +355,7 @@ static QEMUMachine axisdev88_machine = { .desc = "AXIS devboard 88", .init = axisdev88_init, .is_default = 1, + .default_machine_opts = DEFAULT_BOOT_ORDER, };
The thing about a default is that you shouldn't have to explicitly say it in every QEMUMachine struct... Please make the code handle a NULL in the struct in a way that means you don't need to touch every board.
-- PMM
Re: [Qemu-devel] [PATCH v2 1/2] Make default boot order machine specific
Quoted 15 lines · Peter Maydell
Quoted 13 lines · Avik Sil
hw/alpha_dp264.c +2
-0@@ -171,6 +171,7 @@ static QEMUMachine clipper_machine = { .init = clipper_init, .max_cpus = 4, .is_default = 1, + .default_machine_opts = DEFAULT_BOOT_ORDER, };@@ -86,6 +86,7 @@ static QEMUMachine an5206_machine = { .name = "an5206", .desc = "Arnewsh 5206", .init = an5206_init, + .default_machine_opts = DEFAULT_BOOT_ORDER, };
Quoted 12 lines
hw/axis_dev88.c static QEMUMachine axisdev88_machine = { · line 359
Quoted 7 lines
hw/axis_dev88.c +2
-0+++ b/hw/axis_dev88.c@@ -355,6 +355,7 @@ static QEMUMachine axisdev88_machine = { .desc = "AXIS devboard 88", .init = axisdev88_init, .is_default = 1, + .default_machine_opts = DEFAULT_BOOT_ORDER, };The thing about a default is that you shouldn't have to explicitly say it in every QEMUMachine struct... Please make the code handle a NULL in the struct in a way that means you don't need to touch every board.
I hate to spin a lot on a touch everything patch, but I also agree that this is the wrong approach.
I think there are two reasonable approaches to this. One would be a macro to provide default initialization. Something along the lines of:
#define DEFAULT_MACHINE_OPTIONS \
.boot_order = "cad"And then:
static QEMUMachine axisdev88_machine = {
DEFAULT_MACHINE_OPTIONS,
...
};static QEMUMachine pseries_machine = {
DEFAULT_MACHINE_OPTIONS,
/* no default boot order so we can detect absence of boot option */
.boot_order = NULL,
};
Baking this into .default_machines_opts is too much overloading.
The other approach to this would be:
static QEMUMachine pseries_machine = {
.no_boot_order = 1,
};Which I think is what Peter is suggesting. I'm not a huge fan of this because it's backwards logic but we already do this for a bunch of other things so I can't object too strongly to it.
Regards,
Anthony Liguori
Quoted 2 lines
-- PMM
Re: [Qemu-devel] [PATCH v2 1/2] Make default boot order machine specific
Quoted 9 lines · Anthony Liguori
The other approach to this would be:
static QEMUMachine pseries_machine = { .no_boot_order = 1, };Which I think is what Peter is suggesting. I'm not a huge fan of this because it's backwards logic but we already do this for a bunch of other things so I can't object too strongly to it.
The other issue is that "cad" is a load of rubbish for half of these boards, which don't have anything resembling the usual PC boot devices and probably don't pay attention to -boot anyway. A patch which only applied a boot order to boards which actually used it would probably also be rather shorter.
-- PMM
Re: [Qemu-devel] [PATCH v2 1/2] Make default boot order machine specific
Quoted 11 lines · Peter Maydell
Quoted 9 lines · Anthony Liguori
The other approach to this would be:
static QEMUMachine pseries_machine = { .no_boot_order = 1, };Which I think is what Peter is suggesting. I'm not a huge fan of this because it's backwards logic but we already do this for a bunch of other things so I can't object too strongly to it.
Quoted 5 lines
The other issue is that "cad" is a load of rubbish for half of these boards, which don't have anything resembling the usual PC boot devices and probably don't pay attention to -boot anyway. A patch which only applied a boot order to boards which actually used it would probably also be rather shorter.
That's what v1 did, and it's ok, if it's mentioned explicitly and thought through properly. Just doing this without proper reasoning is bad, because you potentially change semantics of -boot if you miss anything. On OpenBIOS with PPC we actually make use of the -boot arguments for example.
Hence having a common set of default options the way Anthony put it seems the most sane solution forward. It guarantees you don't break anything in patch 1. Then it goes in and actually changes the semantics for the one machine you want to change in patch 2.
Alex
Re: [Qemu-devel] [Qemu-ppc] [PATCH v2 1/2] Make default boot order machine specific
Quoted 20 lines · Alexander Graf
Quoted 11 lines · Peter Maydell
Quoted 9 lines · Anthony Liguori
The other approach to this would be:
static QEMUMachine
pseries_machine= {
.no_boot_order = 1,
};Which I think is what Peter is suggesting. I'm not a huge fan of this because it's backwards logic but we already do this for a bunch of other things so I can't object too strongly to it.
Quoted 5 lines
The other issue is that "cad" is a load of rubbish for half of these boards, which don't have anything resembling the usual PC boot devices and probably don't pay attention to -boot anyway. A patch which only applied a boot order to boards which actually used it would probably also be rather shorter.
Quoted 3 lines
That's what v1 did, and it's ok, if it's mentioned explicitly and thought through properly. Just doing this without proper reasoning is bad, because you potentially change semantics of -boot if you miss anything. On OpenBIOS with PPC we actually make use of the -boot arguments for example.
Hence having a common set of default options the way Anthony put it seems the most sane solution forward. It guarantees you don't break anything in patch 1. Then it goes in and actually changes the semantics for the one machine you want to change in patch 2.
Anthony, please comment on which path you'd prefer. I'd rather like to have a decision before creating more work.
Alex
Re: [Qemu-devel] [Qemu-ppc] [PATCH v2 1/2] Make default boot order machine specific
Quoted 23 lines · Alexander Graf
Quoted 20 lines · Alexander Graf
Quoted 16 lines · Peter Maydell
Quoted 9 lines · Anthony Liguori
The other approach to this would be:
static QEMUMachine
pseries_machine= {
.no_boot_order = 1,
};Which I think is what Peter is suggesting. I'm not a huge fan of this because it's backwards logic but we already do this for a bunch of other things so I can't object too strongly to it.
The other issue is that "cad" is a load of rubbish for half of these boards, which don't have anything resembling the usual PC boot devices and probably don't pay attention to -boot anyway. A patch which only applied a boot order to boards which actually used it would probably also be rather shorter.
Quoted 7 lines
Quoted 3 lines
That's what v1 did, and it's ok, if it's mentioned explicitly and thought through properly. Just doing this without proper reasoning is bad, because you potentially change semantics of -boot if you miss anything. On OpenBIOS with PPC we actually make use of the -boot arguments for example.
Hence having a common set of default options the way Anthony put it seems the most sane solution forward. It guarantees you don't break anything in patch 1. Then it goes in and actually changes the semantics for the one machine you want to change in patch 2.
Anthony, please comment on which path you'd prefer. I'd rather like to have a decision before creating more work.
Anthony, Alexander, any comments on the above?
Regards,
Avik
Re: [Qemu-devel] [Qemu-ppc] [PATCH v2 1/2] Make default boot order machine specific
Quoted 24 lines · Avik Sil
Quoted 23 lines · Alexander Graf
Quoted 20 lines · Alexander Graf
Quoted 16 lines · Peter Maydell
Quoted 9 lines · Anthony Liguori
The other approach to this would be:
static QEMUMachine
pseries_machine= {
.no_boot_order = 1,
};Which I think is what Peter is suggesting. I'm not a huge fan of this because it's backwards logic but we already do this for a bunch of other things so I can't object too strongly to it.
The other issue is that "cad" is a load of rubbish for half of these boards, which don't have anything resembling the usual PC boot devices and probably don't pay attention to -boot anyway. A patch which only applied a boot order to boards which actually used it would probably also be rather shorter.
Quoted 8 lines
Quoted 7 lines
Quoted 3 lines
That's what v1 did, and it's ok, if it's mentioned explicitly and thought through properly. Just doing this without proper reasoning is bad, because you potentially change semantics of -boot if you miss anything. On OpenBIOS with PPC we actually make use of the -boot arguments for example.
Hence having a common set of default options the way Anthony put it seems the most sane solution forward. It guarantees you don't break anything in patch 1. Then it goes in and actually changes the semantics for the one machine you want to change in patch 2.
Anthony, please comment on which path you'd prefer. I'd rather like to have a decision before creating more work.
Anthony, Alexander, any comments on the above?
I'm really waiting for Anthony just like you do :). This is nothing I want to make a call on.
Alex
Re: [Qemu-devel] [Qemu-ppc] [PATCH v2 1/2] Make default boot order machine specific
Quoted 29 lines · Alexander Graf
Quoted 26 lines · Avik Sil
Quoted 25 lines · Alexander Graf
Quoted 22 lines · Alexander Graf
Quoted 11 lines · Peter Maydell
Quoted 9 lines · Anthony Liguori
The other approach to this would be:
static QEMUMachine
pseries_machine= {
.no_boot_order = 1,
};Which I think is what Peter is suggesting. I'm not a huge fan of this because it's backwards logic but we already do this for a bunch of other things so I can't object too strongly to it.
Quoted 5 lines
The other issue is that "cad" is a load of rubbish for half of these boards, which don't have anything resembling the usual PC boot devices and probably don't pay attention to -boot anyway. A patch which only applied a boot order to boards which actually used it would probably also be rather shorter.
That's what v1 did, and it's ok, if it's mentioned explicitly and thought through properly. Just doing this without proper reasoning is bad, because you potentially change semantics of -boot if you miss anything. On OpenBIOS with PPC we actually make use of the -boot arguments for example.
Quoted 8 lines
Quoted 6 lines
Quoted 5 lines
Quoted 1 line
Hence having a common set of default options the way Anthony put it seems the most sane solution forward. It guarantees you don't break anything in patch 1. Then it goes in and actually changes the semantics for the one machine you want to change in patch 2.
Anthony, please comment on which path you'd prefer. I'd rather like to have a decision before creating more work.
Anthony, Alexander, any comments on the above?
I'm really waiting for Anthony just like you do :). This is nothing I want to make a call on.
Anthony, can you please comment on this?
Regards,
Avik
Quoted 5 lines
Alex
Re: [Qemu-devel] [Qemu-ppc] [PATCH v2 1/2] Make default boot order machine specific
In reply to Alexander GrafQuoted 23 lines · Alexander Graf
Quoted 20 lines · Alexander Graf
Quoted 16 lines · Peter Maydell
Quoted 9 lines · Anthony Liguori
The other approach to this would be:
static QEMUMachine
pseries_machine= {
.no_boot_order = 1,
};Which I think is what Peter is suggesting. I'm not a huge fan of this because it's backwards logic but we already do this for a bunch of other things so I can't object too strongly to it.
The other issue is that "cad" is a load of rubbish for half of these boards, which don't have anything resembling the usual PC boot devices and probably don't pay attention to -boot anyway. A patch which only applied a boot order to boards which actually used it would probably also be rather shorter.
Quoted 6 lines
Quoted 3 lines
That's what v1 did, and it's ok, if it's mentioned explicitly and thought through properly. Just doing this without proper reasoning is bad, because you potentially change semantics of -boot if you miss anything. On OpenBIOS with PPC we actually make use of the -boot arguments for example.
Hence having a common set of default options the way Anthony put it seems the most sane solution forward. It guarantees you don't break anything in patch 1. Then it goes in and actually changes the semantics for the one machine you want to change in patch 2.
Anthony, please comment on which path you'd prefer. I'd rather like to have a decision before creating more work.
Anthony, Can you please look into this since 1.4 window is open now?
Regards,
Avik
Quoted 5 lines
Alex
Re: [Qemu-devel] [Qemu-ppc] [PATCH v2 1/2] Make default boot order machine specific
In reply to Peter MaydellQuoted 11 lines · Peter Maydell
Quoted 9 lines · Anthony Liguori
The other approach to this would be:
static QEMUMachine pseries_machine = { .no_boot_order = 1, };Which I think is what Peter is suggesting. I'm not a huge fan of this because it's backwards logic but we already do this for a bunch of other things so I can't object too strongly to it.
Quoted 5 lines
The other issue is that "cad" is a load of rubbish for half of these boards, which don't have anything resembling the usual PC boot devices and probably don't pay attention to -boot anyway. A patch which only applied a boot order to boards which actually used it would probably also be rather shorter.
True, but I don't think it's reasonable to expect people other than the maintainers of those boards to make that judgement. The correct approach is to keep the same behaviour for now, then let individual boards change away from it.
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
Re: [Qemu-devel] [Qemu-ppc] [PATCH v2 1/2] Make default boot order machine specific
In reply to Peter MaydellQuoted 15 lines · Peter Maydell
Quoted 13 lines · Avik Sil
hw/alpha_dp264.c +2
-0@@ -171,6 +171,7 @@ static QEMUMachine clipper_machine = { .init = clipper_init, .max_cpus = 4, .is_default = 1, + .default_machine_opts = DEFAULT_BOOT_ORDER, };@@ -86,6 +86,7 @@ static QEMUMachine an5206_machine = { .name = "an5206", .desc = "Arnewsh 5206", .init = an5206_init, + .default_machine_opts = DEFAULT_BOOT_ORDER, };
Quoted 12 lines
hw/axis_dev88.c static QEMUMachine axisdev88_machine = { · line 359
Quoted 7 lines
hw/axis_dev88.c +2
-0+++ b/hw/axis_dev88.c@@ -355,6 +355,7 @@ static QEMUMachine axisdev88_machine = { .desc = "AXIS devboard 88", .init = axisdev88_init, .is_default = 1, + .default_machine_opts = DEFAULT_BOOT_ORDER, };The thing about a default is that you shouldn't have to explicitly say it in every QEMUMachine struct... Please make the code handle a NULL in the struct in a way that means you don't need to touch every board.
So, simply treating NULL as equivalent to "cad" would defeat the purpose of this patch, which is to make a distinction visible to the machine between -boot not specified at all and -boot specified explicitly (as "cad" or otherwise).
So that gives us a few options (Alex described 2 of these already):
* Add a DEFAULT_MACHINE_OPTS macro which does this specification.
Frankly I don't really see what that buys us above the DEFAULT_BOOT_ORDER that is already in the patch.
* Add a 'use_default_boot_order' field to QEMUMachine. Avik actually
did that in an earlier version and I convinced him the current approach would be better. Maybe that was a mistake.
* Don't have the machines access the machine option directly, but via
a helper macro which takes a default parameter. There's a patch from Li Zhang in Alex Graf's tree that does a similar thing for whether USB is enabled.
Signature · 4 lines
David Gibson | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_ | _way_ _around_! http://www.ozlabs.org/~dgibson
PATCH v2 2/2 pseries: set no default boot order
In reply to Avik SilThis patch removes the default boot order for pseries machine. This allows the machine to handle a NULL boot order in case no -boot option is provided. Thus it helps SLOF firmware to verify if boot order is specified in command line or not. If no boot order is provided SLOF tries to boot from the device set in the nvram.
--- hw/spapr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
hw/spapr.c +3 -2
@@ -283,7 +283,9 @@ static void *spapr_create_fdt_skel(const char *cpu_model,_FDT ((fdt_property (fdt,"qemu,boot-kernel" , &kprop,sizeof (kprop)))); } -_FDT ((fdt_property_string (fdt,"qemu,boot-device" , boot_device))); +if (boot_device) { +_FDT ((fdt_property_string (fdt,"qemu,boot-device" , boot_device))); + }_FDT ((fdt_property_cell (fdt,"qemu,graphic-width" , graphic_width)));_FDT ((fdt_property_cell (fdt,"qemu,graphic-height" , graphic_height)));_FDT ((fdt_property_cell (fdt,"qemu,graphic-depth" , graphic_depth)));
@@ -915,7 +917,6 @@ static QEMUMachine spapr_machine = { .max_cpus = MAX_CPUS, .no_parallel = 1, .use_scsi = 1, - .default_machine_opts = DEFAULT_BOOT_ORDER, };static void spapr_machine_init (void )
Signature · 1 line
1.7.11.4
Quoted 3 lines · Avik Sil
Hi,
This patch series implements requirement 1 of the mailing list discussion [1], i.e., to allow a machine to specify if it wants a default boot order or not.
Looks a lot better now :).
I'll leave this on the ML for a few more days to give people the chance to comment on it. If Anthony wants to pull in the generic patch, I'd be more than happy to see him to so too :).
Alex
Quoted 77 lines
Regards,
Avik[1] http://lists.nongnu.org/archive/html/qemu-devel/2012-10/msg02799.html
Changes v1 -> v2:
- Set default boot order for every machine
- Remove default boot order for pseriesAvik Sil (2):
Make default boot order machine specific
pseries: set no default boot orderhw/alpha_dp264.c | 1 + hw/an5206.c | 1 + hw/axis_dev88.c | 1 + hw/boards.h | 2 ++ hw/collie.c | 1 + hw/dummy_m68k.c | 1 + hw/exynos4_boards.c | 2 ++ hw/gumstix.c | 2 ++ hw/highbank.c | 1 + hw/integratorcp.c | 1 + hw/kzm.c | 1 + hw/leon3.c | 1 + hw/lm32_boards.c | 2 ++ hw/mainstone.c | 1 + hw/mcf5208.c | 1 + hw/milkymist.c | 1 + hw/mips_fulong2e.c | 1 + hw/mips_jazz.c | 2 ++ hw/mips_malta.c | 1 + hw/mips_mipssim.c | 1 + hw/mips_r4k.c | 1 + hw/musicpal.c | 1 + hw/nseries.c | 2 ++ hw/null-machine.c | 1 + hw/omap_sx1.c | 2 ++ hw/openrisc_sim.c | 1 + hw/palm.c | 1 + hw/pc_piix.c | 13 ++++++++++++- hw/petalogix_ml605_mmu.c | 1 + hw/petalogix_s3adsp1800_mmu.c | 1 + hw/ppc/e500plat.c | 1 + hw/ppc/mpc8544ds.c | 1 + hw/ppc405_boards.c | 2 ++ hw/ppc440_bamboo.c | 1 + hw/ppc_newworld.c | 1 + hw/ppc_oldworld.c | 1 + hw/ppc_prep.c | 1 + hw/puv3.c | 1 + hw/r2d.c | 1 + hw/realview.c | 4 ++++ hw/s390-virtio.c | 1 + hw/shix.c | 1 + hw/spapr.c | 4 +++- hw/spitz.c | 4 ++++ hw/stellaris.c | 2 ++ hw/sun4m.c | 12 ++++++++++++ hw/sun4u.c | 3 +++ hw/tosa.c | 1 + hw/versatilepb.c | 2 ++ hw/vexpress.c | 2 ++ hw/virtex_ml507.c | 1 + hw/xen_machine_pv.c | 2 +- hw/xilinx_zynq.c | 1 + hw/xtensa_lx60.c | 2 ++ hw/xtensa_sim.c | 1 + hw/z2.c | 1 + qemu-config.c | 6 +++++- vl.c | 13 +++++++++---- 58 files changed, 114 insertions(+), 8 deletions(-)Signature · 1 line
1.7.11.4