[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 35/36] vl: clean up -boot variables
From: |
Igor Mammedov |
Subject: |
Re: [PATCH 35/36] vl: clean up -boot variables |
Date: |
Fri, 27 Nov 2020 14:12:30 +0100 |
On Mon, 23 Nov 2020 09:14:34 -0500
Paolo Bonzini <pbonzini@redhat.com> wrote:
> Move more of them into MachineState, in preparation for moving initialization
> of the machine out of vl.c.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
> ---
> include/hw/boards.h | 1 +
> softmmu/vl.c | 11 ++++++-----
> 2 files changed, 7 insertions(+), 5 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 d76f87028d..aeb988bcad 100644
> --- a/softmmu/vl.c
> +++ b/softmmu/vl.c
> @@ -132,8 +132,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;
> @@ -1733,6 +1731,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,
> @@ -1762,6 +1762,7 @@ static void qemu_apply_machine_options(void)
> }
>
> current_machine->boot_order = boot_order;
> + current_machine->boot_once = boot_once;
> }
>
> static void qemu_create_early_backends(void)
> @@ -2444,9 +2445,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) {
- [PATCH 24/36] vl: start VM via qmp_cont, (continued)
- [PATCH 24/36] vl: start VM via qmp_cont, Paolo Bonzini, 2020/11/23
- [PATCH 36/36] vl: move all generic initialization out of vl.c, Paolo Bonzini, 2020/11/23
- [PATCH 27/36] vl: remove separate preconfig main_loop, Paolo Bonzini, 2020/11/23
- [PATCH 32/36] vl: extract softmmu/runstate.c, Paolo Bonzini, 2020/11/23
- [PATCH 33/36] vl: extract softmmu/globals.c, Paolo Bonzini, 2020/11/23
- [PATCH 35/36] vl: clean up -boot variables, Paolo Bonzini, 2020/11/23
- Re: [PATCH 35/36] vl: clean up -boot variables,
Igor Mammedov <=
- [PATCH 34/36] vl: remove serial_max_hds, Paolo Bonzini, 2020/11/23
- [PATCH 37/36] machine: introduce MachineInitPhase, Paolo Bonzini, 2020/11/27
- Re: [PATCH v3 00/36] cleanup qemu_init and make sense of command line processing, Igor Mammedov, 2020/11/30