aboutsummaryrefslogtreecommitdiff
path: root/softmmu
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2022-04-14 12:52:56 -0400
committerPaolo Bonzini <pbonzini@redhat.com>2022-05-12 12:29:43 +0200
commit97ec4d21e09b5e4a59f00c471a7f76533b08ce56 (patch)
tree0cdc9be29ebd39560f7b8266c2e8ed685ec477a1 /softmmu
parent70be1d93f9c2dbf6793830d482e91bb33f921348 (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')
-rw-r--r--softmmu/bootdevice.c3
-rw-r--r--softmmu/globals.c2
-rw-r--r--softmmu/vl.c25
3 files changed, 3 insertions, 27 deletions
diff --git a/softmmu/bootdevice.c b/softmmu/bootdevice.c
index c0713bfa9f..2106f1026f 100644
--- a/softmmu/bootdevice.c
+++ b/softmmu/bootdevice.c
@@ -268,7 +268,8 @@ char *get_boot_devices_list(size_t *size)
*size = total;
- if (boot_strict && *size > 0) {
+ if (current_machine->boot_config.has_strict &&
+ current_machine->boot_config.strict && *size > 0) {
list[total-1] = '\n';
list = g_realloc(list, total + 5);
memcpy(&list[total], "HALT", 5);
diff --git a/softmmu/globals.c b/softmmu/globals.c
index 98b64e0492..916bc12e2b 100644
--- a/softmmu/globals.c
+++ b/softmmu/globals.c
@@ -54,8 +54,6 @@ int alt_grab;
int ctrl_grab;
unsigned int nb_prom_envs;
const char *prom_envs[MAX_PROM_ENVS];
-int boot_menu;
-bool boot_strict;
uint8_t *boot_splash_filedata;
int only_migratable; /* turn it off unless user states otherwise */
int icount_align_option;
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 */