[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v7 18/27] loader: allow adding ROMs in done callback
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PATCH v7 18/27] loader: allow adding ROMs in done callbacks |
Date: |
Wed, 2 Oct 2013 00:27:11 +0300 |
Don't abort if machine done callbacks add ROMs.
Reviewed-by: Gerd Hoffmann <address@hidden>
Tested-by: Gerd Hoffmann <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
---
include/hw/loader.h | 1 +
hw/core/loader.c | 6 +++++-
vl.c | 3 +++
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/include/hw/loader.h b/include/hw/loader.h
index e0c576b..58eca98 100644
--- a/include/hw/loader.h
+++ b/include/hw/loader.h
@@ -46,6 +46,7 @@ void *rom_add_blob(const char *name, const void *blob, size_t
len,
int rom_add_elf_program(const char *name, void *data, size_t datasize,
size_t romsize, hwaddr addr);
int rom_load_all(void);
+void rom_load_done(void);
void rom_set_fw(FWCfgState *f);
int rom_copy(uint8_t *dest, hwaddr addr, size_t size);
void *rom_ptr(hwaddr addr);
diff --git a/hw/core/loader.c b/hw/core/loader.c
index 060729f..60d2ebd 100644
--- a/hw/core/loader.c
+++ b/hw/core/loader.c
@@ -812,10 +812,14 @@ int rom_load_all(void)
memory_region_unref(section.mr);
}
qemu_register_reset(rom_reset, NULL);
- roms_loaded = 1;
return 0;
}
+void rom_load_done(void)
+{
+ roms_loaded = 1;
+}
+
void rom_set_fw(FWCfgState *f)
{
fw_cfg = f;
diff --git a/vl.c b/vl.c
index fb8006e..46c29c4 100644
--- a/vl.c
+++ b/vl.c
@@ -4339,6 +4339,9 @@ int main(int argc, char **argv, char **envp)
qemu_register_reset(qbus_reset_all_fn, sysbus_get_default());
qemu_run_machine_init_done_notifiers();
+ /* Done notifiers can load ROMs */
+ rom_load_done();
+
qemu_system_reset(VMRESET_SILENT);
if (loadvm) {
if (load_vmstate(loadvm) < 0) {
--
MST
- [Qemu-devel] [PATCH v7 08/27] pcie_host: expose UNMAPPED macro, (continued)
- [Qemu-devel] [PATCH v7 08/27] pcie_host: expose UNMAPPED macro, Michael S. Tsirkin, 2013/10/01
- [Qemu-devel] [PATCH v7 09/27] pcie_host: expose address format, Michael S. Tsirkin, 2013/10/01
- [Qemu-devel] [PATCH v7 10/27] q35: use macro for MCFG property name, Michael S. Tsirkin, 2013/10/01
- [Qemu-devel] [PATCH v7 11/27] q35: expose mmcfg size as a property, Michael S. Tsirkin, 2013/10/01
- [Qemu-devel] [PATCH v7 13/27] acpi: add rules to compile ASL source, Michael S. Tsirkin, 2013/10/01
- [Qemu-devel] [PATCH v7 12/27] i386: add ACPI table files from seabios, Michael S. Tsirkin, 2013/10/01
- [Qemu-devel] [PATCH v7 15/27] acpi: ssdt pcihp: updat generated file, Michael S. Tsirkin, 2013/10/01
- [Qemu-devel] [PATCH v7 14/27] acpi: pre-compiled ASL files, Michael S. Tsirkin, 2013/10/01
- [Qemu-devel] [PATCH v7 17/27] i386: add bios linker/loader, Michael S. Tsirkin, 2013/10/01
- [Qemu-devel] [PATCH v7 16/27] loader: use file path size from fw_cfg.h, Michael S. Tsirkin, 2013/10/01
- [Qemu-devel] [PATCH v7 18/27] loader: allow adding ROMs in done callbacks,
Michael S. Tsirkin <=
- [Qemu-devel] [PATCH v7 19/27] i386: define pc guest info, Michael S. Tsirkin, 2013/10/01
- [Qemu-devel] [PATCH v7 20/27] acpi/piix: add macros for acpi property names, Michael S. Tsirkin, 2013/10/01
- [Qemu-devel] [PATCH v7 21/27] piix: APIs for pc guest info, Michael S. Tsirkin, 2013/10/01
- [Qemu-devel] [PATCH v7 22/27] ich9: APIs for pc guest info, Michael S. Tsirkin, 2013/10/01
- [Qemu-devel] [PATCH v7 23/27] pvpanic: add API to access io port, Michael S. Tsirkin, 2013/10/01
- [Qemu-devel] [PATCH v7 24/27] hpet: add API to find it, Michael S. Tsirkin, 2013/10/01
- [Qemu-devel] [PATCH v7 25/27] i386: ACPI table generation code from seabios, Michael S. Tsirkin, 2013/10/01
- [Qemu-devel] [PATCH v7 26/27] ssdt: fix PBLK length, Michael S. Tsirkin, 2013/10/01
- [Qemu-devel] [PATCH v7 27/27] ssdt-proc: update generated file, Michael S. Tsirkin, 2013/10/01
- Re: [Qemu-devel] [PATCH v7 00/27] qemu: generate acpi tables for the guest, Igor Mammedov, 2013/10/02