[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [Bug 1825207] Re: fw_cfg_machine_reset destroys user bootor
From: |
Mark Eichin |
Subject: |
[Qemu-devel] [Bug 1825207] Re: fw_cfg_machine_reset destroys user bootorder setting |
Date: |
Thu, 18 Apr 2019 17:53:45 -0000 |
Hah! Thanks, I don't know how I missed the existence of bootindex (given
that it looks like it went in in 2011 and is in the docs once I know the
name to search for.) I was probably conflating it with the index=
option.
I did see the warning, and my reaction was "that must apply to other
uses than actually passing things to seabios, since that'll just stop it
from looking at them, and isn't that the entire point of the option?"
Apparently not, but the warning didn't particular suggest otherwise.
Thank you very much for taking the time to respond in detail (bootindex
entirely solves my problem.)
--
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:
Invalid
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