qemu/hw/nvram
Laszlo Ersek 3b3df3e52d fw_cfg: fix the life cycle and the name of "qemu_extra_params_fw"
Commit 19bcc4bc32 ("fw_cfg: Make qemu_extra_params_fw locally",
2019-01-04) changed the storage duration of the "qemu_extra_params_fw"
array from static to automatic. This broke the interface contract on the
fw_cfg_add_file() function, which is documented as follows, in
"include/hw/nvram/fw_cfg.h":

> [...] The data referenced by the starting pointer is only linked, NOT
> copied, into the data structure of the fw_cfg device. [...]

As a result, when guest firmware fetches the "etc/boot-menu-wait" fw_cfg
file, it now sees garbage. Fix the regression by changing the storage
duration to allocated. (The call is reached at most once, on the realize
path of the board-specific fw_cfg sysbus device.)

While at it, clean up the name and the assignment of the object as well.

Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: Markus Armbruster <armbru@redhat.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Fixes: 19bcc4bc32
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Reviewed-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Li Qiang <liq3ea@gmail.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
2019-02-05 10:58:33 -05:00
..
chrp_nvram.c nvram: Move the remaining CHRP NVRAM related code to chrp_nvram.[ch] 2016-10-28 09:36:58 +11:00
ds1225y.c nvram/ds1225y: Convert sysbus init function to realize function 2018-12-13 13:48:00 +00:00
eeprom93xx.c vmstate: constify VMStateField 2018-11-27 15:35:15 +01:00
eeprom_at24c.c hw/i2c: Use DeviceClass::realize instead of I2CSlaveClass::init 2018-06-01 15:14:31 +02:00
fw_cfg.c fw_cfg: fix the life cycle and the name of "qemu_extra_params_fw" 2019-02-05 10:58:33 -05:00
mac_nvram.c migration: consolidate VMStateField.start 2017-02-13 17:27:13 +00:00
Makefile.objs hw/nvram/nrf51_nvm: Add nRF51 non-volatile memories 2019-02-01 15:31:26 +00:00
nrf51_nvm.c hw/nvram/nrf51_nvm: Add nRF51 non-volatile memories 2019-02-01 15:31:26 +00:00
spapr_nvram.c hw/ppc: Use the IEC binary prefix definitions 2018-07-02 15:41:16 +02:00
trace-events trace-events: fix code style: print 0x before hex numbers 2017-08-01 12:13:07 +01:00