All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: qemu-devel@nongnu.org
Cc: Anthony Liguori <aliguori@us.ibm.com>,
	seabios@seabios.org, lersek@redhat.com
Subject: [Qemu-devel] [PATCH v2 2/4] loader: allow adding ROMs in done callbacks
Date: Mon, 8 Jul 2013 21:30:14 +0300	[thread overview]
Message-ID: <1373307914-18543-3-git-send-email-mst@redhat.com> (raw)
In-Reply-To: <1373307914-18543-1-git-send-email-mst@redhat.com>

Don't abort if machine done callbacks add ROMs.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
 hw/core/loader.c    | 6 +++++-
 include/hw/loader.h | 1 +
 vl.c                | 3 +++
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/hw/core/loader.c b/hw/core/loader.c
index 1ead722..3f1d89b 100644
--- a/hw/core/loader.c
+++ b/hw/core/loader.c
@@ -743,10 +743,14 @@ int rom_load_all(void)
         rom->isrom = int128_nz(section.size) && memory_region_is_rom(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/include/hw/loader.h b/include/hw/loader.h
index b39e7d1..976e5cd 100644
--- a/include/hw/loader.h
+++ b/include/hw/loader.h
@@ -31,6 +31,7 @@ int 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/vl.c b/vl.c
index 6d9fd7d..8190504 100644
--- a/vl.c
+++ b/vl.c
@@ -4377,6 +4377,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

  parent reply	other threads:[~2013-07-08 18:29 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-08 18:30 [Qemu-devel] [PATCH v2 0/4] qemu: generate acpi tables for the guest Michael S. Tsirkin
2013-07-08 18:30 ` [Qemu-devel] [PATCH v2 1/4] loader: support for unmapped ROM blobs Michael S. Tsirkin
2013-07-08 18:30 ` Michael S. Tsirkin [this message]
2013-07-08 18:30 ` [Qemu-devel] [PATCH v2 3/4] i386: generate pc guest info Michael S. Tsirkin
2013-07-08 19:10   ` [Qemu-devel] [SeaBIOS] " Anthony Liguori
2013-07-08 19:52     ` Michael S. Tsirkin
2013-07-24 14:42       ` Gerd Hoffmann
2013-07-24 14:52         ` Andreas Färber
2013-07-24 15:04           ` Gerd Hoffmann
2013-07-24 15:09             ` Andreas Färber
2013-07-24 15:11               ` Paolo Bonzini
2013-07-24 16:17           ` Michael S. Tsirkin
2013-07-24 15:28         ` Michael S. Tsirkin
2013-07-11 20:25     ` [Qemu-devel] " Michael S. Tsirkin
2013-07-08 18:30 ` [Qemu-devel] [PATCH v2 4/4] i386: ACPI table generation code from seabios Michael S. Tsirkin
2013-07-08 19:16   ` [Qemu-devel] [SeaBIOS] " Anthony Liguori
2013-07-08 19:57     ` Michael S. Tsirkin
2013-07-09  7:53 ` [Qemu-devel] [PATCH v2 0/4] qemu: generate acpi tables for the guest Laszlo Ersek
2013-07-09  7:57   ` Michael S. Tsirkin
2013-07-09  8:04     ` Laszlo Ersek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1373307914-18543-3-git-send-email-mst@redhat.com \
    --to=mst@redhat.com \
    --cc=aliguori@us.ibm.com \
    --cc=lersek@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=seabios@seabios.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.