[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 080/113] vl: clean up -boot variables
From: |
Paolo Bonzini |
Subject: |
[PULL 080/113] vl: clean up -boot variables |
Date: |
Wed, 2 Dec 2020 03:08:16 -0500 |
Move more of them into MachineState, in preparation for moving initialization
of the machine out of vl.c.
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
include/hw/boards.h | 1 +
softmmu/vl.c | 12 ++++++------
2 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/include/hw/boards.h b/include/hw/boards.h
index 4537cfb5c6..b9233af54a 100644
--- a/include/hw/boards.h
+++ b/include/hw/boards.h
@@ -283,6 +283,7 @@ struct MachineState {
ram_addr_t maxram_size;
uint64_t ram_slots;
const char *boot_order;
+ const char *boot_once;
char *kernel_filename;
char *kernel_cmdline;
char *initrd_filename;
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 43a0a45b68..77ee044c42 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -130,8 +130,6 @@ typedef QSIMPLEQ_HEAD(, BlockdevOptionsQueueEntry)
BlockdevOptionsQueue;
static const char *cpu_option;
static const char *mem_path;
-static const char *boot_order;
-static const char *boot_once;
static const char *incoming;
static const char *loadvm;
static ram_addr_t maxram_size;
@@ -2472,6 +2470,8 @@ static void qemu_apply_machine_options(void)
{
MachineClass *machine_class = MACHINE_GET_CLASS(current_machine);
QemuOpts *machine_opts = qemu_get_machine_opts();
+ const char *boot_order = NULL;
+ const char *boot_once = NULL;
QemuOpts *opts;
qemu_opt_foreach(machine_opts, machine_set_property, current_machine,
@@ -2501,6 +2501,7 @@ static void qemu_apply_machine_options(void)
}
current_machine->boot_order = boot_order;
+ current_machine->boot_once = boot_once;
if (semihosting_enabled() && !semihosting_get_argc()) {
const char *kernel_filename = qemu_opt_get(machine_opts, "kernel");
@@ -2508,7 +2509,6 @@ static void qemu_apply_machine_options(void)
/* fall back to the -kernel/-append */
semihosting_arg_fallback(kernel_filename, kernel_cmdline);
}
-
}
static void qemu_create_early_backends(void)
@@ -3220,9 +3220,9 @@ static void qemu_machine_creation_done(void)
qdev_prop_check_globals();
- if (boot_once) {
- qemu_boot_set(boot_once, &error_fatal);
- qemu_register_reset(restore_boot_order, g_strdup(boot_order));
+ if (current_machine->boot_once) {
+ qemu_boot_set(current_machine->boot_once, &error_fatal);
+ qemu_register_reset(restore_boot_order,
g_strdup(current_machine->boot_order));
}
if (foreach_device_config(DEV_GDB, gdbserver_start) < 0) {
--
2.26.2
- [PULL 055/113] vl: move various initialization routines out of qemu_init, (continued)
- [PULL 055/113] vl: move various initialization routines out of qemu_init, Paolo Bonzini, 2020/12/02
- [PULL 062/113] vl: create "-net nic -net user" default earlier, Paolo Bonzini, 2020/12/02
- [PULL 057/113] vl: move prelaunch part of qemu_init to new functions, Paolo Bonzini, 2020/12/02
- [PULL 059/113] vl: preconfig and loadvm are mutually exclusive, Paolo Bonzini, 2020/12/02
- [PULL 050/113] hw/char/serial: Clean up unnecessary code, Paolo Bonzini, 2020/12/02
- [PULL 064/113] vl: extract default devices to separate functions, Paolo Bonzini, 2020/12/02
- [PULL 071/113] vl: initialize displays before preconfig loop, Paolo Bonzini, 2020/12/02
- [PULL 070/113] vl: separate qemu_resolve_machine_memdev, Paolo Bonzini, 2020/12/02
- [PULL 066/113] vl: separate qemu_create_early_backends, Paolo Bonzini, 2020/12/02
- [PULL 076/113] vl: extract softmmu/datadir.c, Paolo Bonzini, 2020/12/02
- [PULL 080/113] vl: clean up -boot variables,
Paolo Bonzini <=
- [PULL 074/113] vl: start VM via qmp_cont, Paolo Bonzini, 2020/12/02
- [PULL 084/113] kernel-doc: add support for ____cacheline_aligned_in_smp attribute, Paolo Bonzini, 2020/12/02
- [PULL 086/113] scripts: kernel-doc: proper handle @foo->bar(), Paolo Bonzini, 2020/12/02
- [PULL 088/113] scripts: kernel-doc: accept blank lines on parameter description, Paolo Bonzini, 2020/12/02
- [PULL 090/113] scripts/kernel-doc: parse __ETHTOOL_DECLARE_LINK_MODE_MASK, Paolo Bonzini, 2020/12/02
- [PULL 087/113] scripts: kernel-doc: accept negation like !@var, Paolo Bonzini, 2020/12/02
- [PULL 069/113] vl: separate qemu_apply_machine_options, Paolo Bonzini, 2020/12/02
- [PULL 051/113] treewide: do not use short-form boolean options, Paolo Bonzini, 2020/12/02
- [PULL 056/113] vl: extract qemu_init_subsystems, Paolo Bonzini, 2020/12/02
- [PULL 060/113] vl: extract various command line desugaring snippets to a new function, Paolo Bonzini, 2020/12/02