|
@@ -949,13 +949,21 @@ void *fw_cfg_modify_file(FWCfgState *s, const char *filename,
|
|
|
|
|
|
static void fw_cfg_machine_reset(void *opaque)
|
|
static void fw_cfg_machine_reset(void *opaque)
|
|
{
|
|
{
|
|
|
|
+ MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());
|
|
|
|
+ FWCfgState *s = opaque;
|
|
void *ptr;
|
|
void *ptr;
|
|
size_t len;
|
|
size_t len;
|
|
- FWCfgState *s = opaque;
|
|
|
|
- char *bootindex = get_boot_devices_list(&len);
|
|
|
|
|
|
+ char *buf;
|
|
|
|
|
|
- ptr = fw_cfg_modify_file(s, "bootorder", (uint8_t *)bootindex, len);
|
|
|
|
|
|
+ buf = get_boot_devices_list(&len);
|
|
|
|
+ ptr = fw_cfg_modify_file(s, "bootorder", (uint8_t *)buf, len);
|
|
g_free(ptr);
|
|
g_free(ptr);
|
|
|
|
+
|
|
|
|
+ if (!mc->legacy_fw_cfg_order) {
|
|
|
|
+ buf = get_boot_devices_lchs_list(&len);
|
|
|
|
+ ptr = fw_cfg_modify_file(s, "bios-geometry", (uint8_t *)buf, len);
|
|
|
|
+ g_free(ptr);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
static void fw_cfg_machine_ready(struct Notifier *n, void *data)
|
|
static void fw_cfg_machine_ready(struct Notifier *n, void *data)
|