[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 12/22] vl: move bios_name out of softmmu/vl.c
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH 12/22] vl: move bios_name out of softmmu/vl.c |
Date: |
Thu, 22 Oct 2020 09:22:34 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 |
On 10/21/20 10:57 PM, Paolo Bonzini wrote:
bios_name is a legacy variable used by machine code. Hide it
from softmmu/vl.c.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
hw/core/machine.c | 5 +++++
softmmu/vl.c | 2 --
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/hw/core/machine.c b/hw/core/machine.c
index 3c674bb05e..e4dac350d4 100644
--- a/hw/core/machine.c
+++ b/hw/core/machine.c
@@ -212,6 +212,8 @@ GlobalProperty hw_compat_2_1[] = {
};
const size_t hw_compat_2_1_len = G_N_ELEMENTS(hw_compat_2_1);
+const char *bios_name = NULL;
I expect checkpatch.pl to complain "do not zero-initialize global".
+
static char *machine_get_kernel(Object *obj, Error **errp)
{
MachineState *ms = MACHINE(obj);
@@ -396,6 +398,9 @@ static void machine_set_firmware(Object *obj, const char
*value, Error **errp)
g_free(ms->firmware);
ms->firmware = g_strdup(value);
+
+ /* HACK */
With a slightly better rationale explanation:
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
+ bios_name = ms->firmware;
}
static void machine_set_suppress_vmdesc(Object *obj, bool value, Error **errp)
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 52e7d317d7..e32e209a82 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -123,7 +123,6 @@ static int data_dir_idx;
static const char *mem_path;
static const char *boot_order;
static const char *boot_once;
-const char *bios_name = NULL;
enum vga_retrace_method vga_retrace_method = VGA_RETRACE_DUMB;
int display_opengl;
const char* keyboard_layout = NULL;
@@ -4314,7 +4313,6 @@ void qemu_init(int argc, char **argv, char **envp)
kernel_filename = qemu_opt_get(machine_opts, "kernel");
initrd_filename = qemu_opt_get(machine_opts, "initrd");
kernel_cmdline = qemu_opt_get(machine_opts, "append");
- bios_name = qemu_opt_get(machine_opts, "firmware");
opts = qemu_opts_find(qemu_find_opts("boot-opts"), NULL);
if (opts) {
- Re: [PATCH 20/22] vl: move CHECKPOINT_INIT after preconfig, (continued)
- [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
- [PATCH 12/22] vl: move bios_name out of softmmu/vl.c, Paolo Bonzini, 2020/10/21
- Re: [PATCH 12/22] vl: move bios_name out of softmmu/vl.c,
Philippe Mathieu-Daudé <=
- [PATCH 21/22] vl: separate qemu_create_early_backends, Paolo Bonzini, 2020/10/21