From: Gerd Hoffmann <kraxel@redhat.com>
To: Alexander Graf <agraf@suse.de>
Cc: "Peter Maydell" <peter.maydell@linaro.org>,
open@suse.de, "Mark Langsdorf" <mark.langsdorf@calxeda.com>,
list@suse.de, qemu-devel@nongnu.org,
"Fabien Chouteau" <chouteau@adacore.com>,
"Blue Swirl" <blauwirbel@gmail.com>,
"Michael Walle" <michael@walle.cc>,
"Hervé Poussineau" <hpoussin@reactos.org>,
"Paul Brook" <paul@codesourcery.com>,
"Anthony Liguori" <anthony@codemonkey.ws>,
"Andreas Färber" <andreas.faerber@web.de>,
"Aurelien Jarno" <aurelien@aurel32.net>,
"Richard Henderson" <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH] turn firmware image filename into a machine option
Date: Tue, 01 Oct 2013 15:32:10 +0200 [thread overview]
Message-ID: <1380634330.5280.46.camel@nilsson.home.kraxel.org> (raw)
In-Reply-To: <524AB29F.3030906@suse.de>
> > --- a/hw/arm/highbank.c
> > +++ b/hw/arm/highbank.c
> > @@ -250,15 +250,15 @@ static void calxeda_init(QEMUMachineInitArgs *args, enum cxmachines machine)
> > sysram = g_new(MemoryRegion, 1);
> > memory_region_init_ram(sysram, NULL, "highbank.sysram", 0x8000);
> > memory_region_add_subregion(sysmem, 0xfff88000, sysram);
> > - if (bios_name != NULL) {
> > - sysboot_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
> > + if (args->firmware != NULL) {
> > + sysboot_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, args->firmware);
> > if (sysboot_filename != NULL) {
> > uint32_t filesize = get_image_size(sysboot_filename);
> > if (load_image_targphys("sysram.bin", 0xfff88000, filesize)< 0) {
> > - hw_error("Unable to load %s\n", bios_name);
> > + hw_error("Unable to load %s\n", args->firmware);
> > }
> > } else {
> > - hw_error("Unable to find %s\n", bios_name);
> > + hw_error("Unable to find %s\n", args->firmware);
> > }
> > }
> >
> > diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> > index 0c313fe..3e3c9c1 100644
> > --- a/hw/i386/pc.c
> > +++ b/hw/i386/pc.c
> > @@ -1112,7 +1112,8 @@ FWCfgState *pc_memory_init(MemoryRegion *system_memory,
> > ram_addr_t above_4g_mem_size,
> > MemoryRegion *rom_memory,
> > MemoryRegion **ram_memory,
> > - PcGuestInfo *guest_info)
> > + PcGuestInfo *guest_info,
> > + const char *firmware)
>
> Looking at this I think it'd make more sense to convert all users of
> bios_name to instead base on local variables and fetch the firmware name
> directly from the firmware machine opt. If you like, add a helper to
> make the conversion easier :).
>
> But that way we don't have to touch function headers and bloat them even
> more than they are today.
For most other machines (such as the calxeda quoted above) I don't have
to touch the prototypes but just replace the global bios_name with
QemuMachineInitArgs->firmware.
pc is special here as the bios init is deeply nested. Maybe we should
pass down the whole QemuMachineInitArgs instead ...
cheers,
Gerd
prev parent reply other threads:[~2013-10-01 13:32 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-01 9:39 [Qemu-devel] [PATCH] turn firmware image filename into a machine option Gerd Hoffmann
2013-10-01 10:55 ` Peter Maydell
2013-10-01 11:22 ` Gerd Hoffmann
2013-10-01 11:32 ` Peter Maydell
2013-10-01 12:16 ` Gerd Hoffmann
2013-10-01 12:20 ` Andreas Färber
2013-10-01 13:41 ` Gerd Hoffmann
2013-10-01 13:46 ` Andreas Färber
2013-10-01 14:23 ` Alexey Kardashevskiy
2013-10-01 14:40 ` Gerd Hoffmann
2013-10-01 14:45 ` Alexander Graf
2013-10-01 21:23 ` Benjamin Herrenschmidt
2013-10-02 1:18 ` Alexey Kardashevskiy
2013-10-01 13:00 ` Peter Maydell
2013-10-01 14:57 ` Paolo Bonzini
2013-10-01 15:05 ` Gerd Hoffmann
2013-10-01 15:12 ` Peter Maydell
2013-10-01 15:28 ` Paolo Bonzini
2013-10-01 15:42 ` Anthony Liguori
[not found] ` <524AB29F.3030906@suse.de>
2013-10-01 13:32 ` Gerd Hoffmann [this message]
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=1380634330.5280.46.camel@nilsson.home.kraxel.org \
--to=kraxel@redhat.com \
--cc=agraf@suse.de \
--cc=andreas.faerber@web.de \
--cc=anthony@codemonkey.ws \
--cc=aurelien@aurel32.net \
--cc=blauwirbel@gmail.com \
--cc=chouteau@adacore.com \
--cc=hpoussin@reactos.org \
--cc=list@suse.de \
--cc=mark.langsdorf@calxeda.com \
--cc=michael@walle.cc \
--cc=open@suse.de \
--cc=paul@codesourcery.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).