qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [Bug 1825207] [NEW] fw_cfg_machine_reset destroys user boot


From: Mark Eichin
Subject: [Qemu-devel] [Bug 1825207] [NEW] fw_cfg_machine_reset destroys user bootorder setting
Date: Wed, 17 Apr 2019 15:44:12 -0000

Public bug reported:

Demonstrated against 2.11 (ubuntu bionic 1:2.11+dfsg-1ubuntu7.12) and
3.1 (as built under bionic from the 1:3.1+dfsg-2ubuntu3 source package)
although the code hasn't changed between them and github master also
appears to have this same code branch.

What I was trying to do: select a boot disk using `-fw_cfg
name=bootorder,string=/address@hidden/address@hidden based on the qemu and 
seabios
documentation.  (Why do I want to do that? using qemu for installer
testing for a specific kind of real machine and need to match the bios
boot order.)

What happened instead: same search-based boot order that I get without
that option.  Also, /sys/firmware/qemu_fw_cfg/by_name/bootorder/raw is
empty and .../size is "0".

Brutal work around that did a useful thing:

--- qemu-3.1+dfsg.orig/hw/nvram/fw_cfg.c
+++ qemu-3.1+dfsg/hw/nvram/fw_cfg.c
@@ -869,8 +869,10 @@ static void fw_cfg_machine_reset(void *o
     FWCfgState *s = opaque;
     char *bootindex = get_boot_devices_list(&len);
 
+#if 0
     ptr = fw_cfg_modify_file(s, "bootorder", (uint8_t *)bootindex, len);
     g_free(ptr);
+#endif
 }

This change allowed the boot to work (so my bootorder setting was making
it to seabios) and also showed up explicitly in
/sys/firmware/qemu_fw_cfg.

I don't know if fw_cfg_modify_file is intended to append rather than
replace, but it doesn't; based on the seabios "Runtime_config" docs
which suggest "look at the Searching bootorder for output and paste that
into the bootorder file" I'd instead just have it only fill in bootorder
if there's *no* existing setting, since a user can read out the defaults
and copy them in as described if they want the fallback, but that's just
from my interpretation of the docs.

** Affects: qemu
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1825207

Title:
  fw_cfg_machine_reset destroys user bootorder setting

Status in QEMU:
  New

Bug description:
  Demonstrated against 2.11 (ubuntu bionic 1:2.11+dfsg-1ubuntu7.12) and
  3.1 (as built under bionic from the 1:3.1+dfsg-2ubuntu3 source
  package) although the code hasn't changed between them and github
  master also appears to have this same code branch.

  What I was trying to do: select a boot disk using `-fw_cfg
  name=bootorder,string=/address@hidden/address@hidden based on the qemu and 
seabios
  documentation.  (Why do I want to do that? using qemu for installer
  testing for a specific kind of real machine and need to match the bios
  boot order.)

  What happened instead: same search-based boot order that I get without
  that option.  Also, /sys/firmware/qemu_fw_cfg/by_name/bootorder/raw is
  empty and .../size is "0".

  Brutal work around that did a useful thing:

  --- qemu-3.1+dfsg.orig/hw/nvram/fw_cfg.c
  +++ qemu-3.1+dfsg/hw/nvram/fw_cfg.c
  @@ -869,8 +869,10 @@ static void fw_cfg_machine_reset(void *o
       FWCfgState *s = opaque;
       char *bootindex = get_boot_devices_list(&len);
   
  +#if 0
       ptr = fw_cfg_modify_file(s, "bootorder", (uint8_t *)bootindex, len);
       g_free(ptr);
  +#endif
   }

  This change allowed the boot to work (so my bootorder setting was
  making it to seabios) and also showed up explicitly in
  /sys/firmware/qemu_fw_cfg.

  I don't know if fw_cfg_modify_file is intended to append rather than
  replace, but it doesn't; based on the seabios "Runtime_config" docs
  which suggest "look at the Searching bootorder for output and paste
  that into the bootorder file" I'd instead just have it only fill in
  bootorder if there's *no* existing setting, since a user can read out
  the defaults and copy them in as described if they want the fallback,
  but that's just from my interpretation of the docs.

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1825207/+subscriptions



reply via email to

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