summaryrefslogtreecommitdiff
path: root/hw/fw_cfg.c
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2010-12-08 13:35:09 +0200
committerBlue Swirl <blauwirbel@gmail.com>2010-12-11 21:32:48 +0000
commit962630f207a33b7de4316022884b5241e05491cd (patch)
tree456f98659094302366c6caa495b2511cd69b647b /hw/fw_cfg.c
parent4cab946a4adc3094a846dd3c7ea104abe7bdc5f1 (diff)
downloadqemu-962630f207a33b7de4316022884b5241e05491cd.zip
Pass boot device list to firmware.
Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'hw/fw_cfg.c')
-rw-r--r--hw/fw_cfg.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/hw/fw_cfg.c b/hw/fw_cfg.c
index 957466dea1..85c8c3c7bf 100644
--- a/hw/fw_cfg.c
+++ b/hw/fw_cfg.c
@@ -53,6 +53,7 @@ struct FWCfgState {
FWCfgFiles *files;
uint16_t cur_entry;
uint32_t cur_offset;
+ Notifier machine_ready;
};
static void fw_cfg_write(FWCfgState *s, uint8_t value)
@@ -315,6 +316,15 @@ int fw_cfg_add_file(FWCfgState *s, const char *filename, uint8_t *data,
return 1;
}
+static void fw_cfg_machine_ready(struct Notifier* n)
+{
+ uint32_t len;
+ FWCfgState *s = container_of(n, FWCfgState, machine_ready);
+ char *bootindex = get_boot_devices_list(&len);
+
+ fw_cfg_add_file(s, "bootorder", (uint8_t*)bootindex, len);
+}
+
FWCfgState *fw_cfg_init(uint32_t ctl_port, uint32_t data_port,
target_phys_addr_t ctl_addr, target_phys_addr_t data_addr)
{
@@ -343,6 +353,10 @@ FWCfgState *fw_cfg_init(uint32_t ctl_port, uint32_t data_port,
fw_cfg_add_i16(s, FW_CFG_MAX_CPUS, (uint16_t)max_cpus);
fw_cfg_add_i16(s, FW_CFG_BOOT_MENU, (uint16_t)boot_menu);
+
+ s->machine_ready.notify = fw_cfg_machine_ready;
+ qemu_add_machine_init_done_notifier(&s->machine_ready);
+
return s;
}