Revision 8281abd5

b/vl.c
2841 2841
    const char *icount_option = NULL;
2842 2842
    const char *initrd_filename;
2843 2843
    const char *kernel_filename, *kernel_cmdline;
2844
    char boot_devices[33] = "";
2844
    const char *boot_order = NULL;
2845 2845
    DisplayState *ds;
2846 2846
    int cyls, heads, secs, translation;
2847 2847
    QemuOpts *hda_opts = NULL, *opts, *machine_opts;
......
3131 3131
                drive_add(IF_DEFAULT, 2, optarg, CDROM_OPTS);
3132 3132
                break;
3133 3133
            case QEMU_OPTION_boot:
3134
                {
3135
                    char *standard_boot_devices;
3136
                    const char *order, *once;
3137

  
3138
                    opts = qemu_opts_parse(qemu_find_opts("boot-opts"),
3139
                                           optarg, 1);
3140
                    if (!opts) {
3141
                        exit(1);
3142
                    }
3143

  
3144
                    order = qemu_opt_get(opts, "order");
3145
                    if (order) {
3146
                        validate_bootdevices(order);
3147
                        pstrcpy(boot_devices, sizeof(boot_devices), order);
3148
                    }
3149

  
3150
                    once = qemu_opt_get(opts, "once");
3151
                    if (once) {
3152
                        validate_bootdevices(once);
3153
                        standard_boot_devices = g_strdup(boot_devices);
3154
                        pstrcpy(boot_devices, sizeof(boot_devices), once);
3155
                        qemu_register_reset(restore_boot_devices,
3156
                                            standard_boot_devices);
3157
                    }
3158
                    boot_menu = qemu_opt_get_bool(opts, "menu", boot_menu);
3134
                opts = qemu_opts_parse(qemu_find_opts("boot-opts"), optarg, 1);
3135
                if (!opts) {
3136
                    exit(1);
3159 3137
                }
3160 3138
                break;
3161 3139
            case QEMU_OPTION_fda:
......
4096 4074
        kernel_filename = initrd_filename = kernel_cmdline = NULL;
4097 4075
    }
4098 4076

  
4077
    if (!boot_order) {
4078
        boot_order = machine->boot_order;
4079
    }
4080
    opts = qemu_opts_find(qemu_find_opts("boot-opts"), NULL);
4081
    if (opts) {
4082
        char *normal_boot_order;
4083
        const char *order, *once;
4084

  
4085
        order = qemu_opt_get(opts, "order");
4086
        if (order) {
4087
            validate_bootdevices(order);
4088
            boot_order = order;
4089
        }
4090

  
4091
        once = qemu_opt_get(opts, "once");
4092
        if (once) {
4093
            validate_bootdevices(once);
4094
            normal_boot_order = g_strdup(boot_order);
4095
            boot_order = once;
4096
            qemu_register_reset(restore_boot_devices, normal_boot_order);
4097
        }
4098

  
4099
        boot_menu = qemu_opt_get_bool(opts, "menu", boot_menu);
4100
    }
4101

  
4099 4102
    if (!kernel_cmdline) {
4100 4103
        kernel_cmdline = "";
4101 4104
    }
......
4260 4263
    qdev_machine_init();
4261 4264

  
4262 4265
    QEMUMachineInitArgs args = { .ram_size = ram_size,
4263
                                 .boot_device = (boot_devices[0] == '\0') ?
4264
                                                machine->boot_order :
4265
                                                boot_devices,
4266
                                 .boot_device = boot_order,
4266 4267
                                 .kernel_filename = kernel_filename,
4267 4268
                                 .kernel_cmdline = kernel_cmdline,
4268 4269
                                 .initrd_filename = initrd_filename,

Also available in: Unified diff