diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2022-04-14 12:52:56 -0400 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-05-12 12:29:43 +0200 |
commit | 97ec4d21e09b5e4a59f00c471a7f76533b08ce56 (patch) | |
tree | 0cdc9be29ebd39560f7b8266c2e8ed685ec477a1 /softmmu/vl.c | |
parent | 70be1d93f9c2dbf6793830d482e91bb33f921348 (diff) |
machine: use QAPI struct for boot configuration
As part of converting -boot to a property with a QAPI type, define
the struct and use it throughout QEMU to access boot configuration.
machine_boot_parse takes care of doing the QemuOpts->QAPI conversion by
hand, for now.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <20220414165300.555321-2-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'softmmu/vl.c')
-rw-r--r-- | softmmu/vl.c | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/softmmu/vl.c b/softmmu/vl.c index 488cc4d09e..dd90df3ed1 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -1884,9 +1884,6 @@ static bool object_create_early(const char *type) static void qemu_apply_machine_options(QDict *qdict) { - MachineClass *machine_class = MACHINE_GET_CLASS(current_machine); - const char *boot_order = NULL; - const char *boot_once = NULL; QemuOpts *opts; object_set_properties_from_keyval(OBJECT(current_machine), qdict, false, &error_fatal); @@ -1895,27 +1892,7 @@ static void qemu_apply_machine_options(QDict *qdict) current_machine->ram_slots = ram_slots; opts = qemu_opts_find(qemu_find_opts("boot-opts"), NULL); - if (opts) { - boot_order = qemu_opt_get(opts, "order"); - if (boot_order) { - validate_bootdevices(boot_order, &error_fatal); - } - - boot_once = qemu_opt_get(opts, "once"); - if (boot_once) { - validate_bootdevices(boot_once, &error_fatal); - } - - boot_menu = qemu_opt_get_bool(opts, "menu", boot_menu); - boot_strict = qemu_opt_get_bool(opts, "strict", false); - } - - if (!boot_order) { - boot_order = machine_class->default_boot_order; - } - - current_machine->boot_order = boot_order; - current_machine->boot_once = boot_once; + machine_boot_parse(current_machine, opts, &error_fatal); if (semihosting_enabled() && !semihosting_get_argc()) { /* fall back to the -kernel/-append */ |