qemu-devel
[Top][All Lists]
Advanced

[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) {





reply via email to

[Prev in Thread] Current Thread [Next in Thread]