[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 18/22] vl: move semihosting command line fallback to qemu_finish_
From: |
Paolo Bonzini |
Subject: |
[PATCH 18/22] vl: move semihosting command line fallback to qemu_finish_machine_init |
Date: |
Wed, 21 Oct 2020 16:57:12 -0400 |
Move more sane parts of the huge qemu_init function out of it.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
softmmu/vl.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 75e57133ad..e58572dbd8 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -3067,6 +3067,11 @@ void qemu_finish_machine_init(void)
/* from here on runstate is RUN_STATE_PRELAUNCH */
+ if (semihosting_enabled() && !semihosting_get_argc() &&
current_machine->kernel_filename) {
+ /* fall back to the -kernel/-append */
+ semihosting_arg_fallback(current_machine->kernel_filename,
current_machine->kernel_cmdline);
+ }
+
if (machine_class->default_ram_id && current_machine->ram_size &&
numa_uses_legacy_mem() && !current_machine->ram_memdev_id) {
create_default_memdev(current_machine, mem_path);
@@ -4372,13 +4377,6 @@ void qemu_init(int argc, char **argv, char **envp)
boot_order = machine_class->default_boot_order;
}
- if (semihosting_enabled() && !semihosting_get_argc()) {
- const char *kernel_filename = qemu_opt_get(machine_opts, "kernel");
- const char *kernel_cmdline = qemu_opt_get(machine_opts, "append");
- /* fall back to the -kernel/-append */
- semihosting_arg_fallback(kernel_filename, kernel_cmdline);
- }
-
if (net_init_clients(&err) < 0) {
error_report_err(err);
exit(1);
--
2.26.2
- Re: [PATCH 02/22] machine: remove deprecated -machine enforce-config-section option, (continued)
- [PATCH 07/22] trace: remove argument from trace_init_file, Paolo Bonzini, 2020/10/21
- [PATCH 06/22] vl: remove bogus check, Paolo Bonzini, 2020/10/21
- [PATCH 15/22] vl: extract various command line desugaring snippets to a new function, Paolo Bonzini, 2020/10/21
- [PATCH 08/22] vl: split various early command line options to a separate function, Paolo Bonzini, 2020/10/21
- [PATCH 05/22] vl: extract validation of -smp to machine.c, Paolo Bonzini, 2020/10/21
- [PATCH 01/22] semihosting: fix order of initialization functions, Paolo Bonzini, 2020/10/21
- [PATCH 11/22] vl: move prelaunch part of qemu_init to a new function, Paolo Bonzini, 2020/10/21
- [PATCH 19/22] vl: extract default devices to separate functions, Paolo Bonzini, 2020/10/21
- [PATCH 18/22] vl: move semihosting command line fallback to qemu_finish_machine_init,
Paolo Bonzini <=
- [PATCH 20/22] vl: move CHECKPOINT_INIT after preconfig, Paolo Bonzini, 2020/10/21
- [PATCH 22/22] vl: separate qemu_create_late_backends, Paolo Bonzini, 2020/10/21
- [PATCH 10/22] vl: extract qemu_init_subsystems, Paolo Bonzini, 2020/10/21
- [PATCH 14/22] vl: preconfig and loadvm are mutually exclusive, Paolo Bonzini, 2020/10/21
- [PATCH 17/22] vl: load plugins as late as possible, Paolo Bonzini, 2020/10/21
- [PATCH 13/22] vl: extract various command line validation snippets to a new function, Paolo Bonzini, 2020/10/21
- [PATCH 16/22] vl: create "-net nic -net user" default earlier, Paolo Bonzini, 2020/10/21
- [PATCH 09/22] vl: move various initialization routines out of qemu_init, Paolo Bonzini, 2020/10/21