Received: from eggs.gnu.org ([2001:4830:134:3::10]:44415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VBLYc-00077o-Ks for qemu-devel@nongnu.org; Mon, 19 Aug 2013 05:15:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VBLYW-0006z6-HP for qemu-devel@nongnu.org; Mon, 19 Aug 2013 05:15:26 -0400 From: Markus Armbruster References: <1376651630-9151-1-git-send-email-armbru@redhat.com> <1376651630-9151-4-git-send-email-armbru@redhat.com> <520F50A2.7090108@redhat.com> Date: Mon, 19 Aug 2013 11:15:11 +0200 In-Reply-To: <520F50A2.7090108@redhat.com> (Laszlo Ersek's message of "Sat, 17 Aug 2013 12:29:54 +0200") Message-ID: <87wqnidotc.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v4 3/6] sun4: Don't prematurely explode QEMUMachineInitArgs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laszlo Ersek Cc: aliguori@us.ibm.com, mjt@tls.msk.ru, qemu-devel@nongnu.org, agraf@suse.de, blauwirbel@gmail.com, qemu-ppc@nongnu.org, aviksil@linux.vnet.ibm.com Laszlo Ersek writes: > comments below > > On 08/16/13 13:13, armbru@redhat.com wrote: >> From: Markus Armbruster >> >> Don't explode QEMUMachineInitArgs before passing it to >> sun4m_hw_init(), sun4uv_init(). >> >> Signed-off-by: Markus Armbruster >> --- >> hw/sparc/sun4m.c | 113 >> ++++++++++++----------------------------------------- >> hw/sparc64/sun4u.c | 52 +++++++----------------- >> 2 files changed, 40 insertions(+), 125 deletions(-) >> >> diff --git a/hw/sparc/sun4m.c b/hw/sparc/sun4m.c >> index 942ca37..36ef36f 100644 >> --- a/hw/sparc/sun4m.c >> +++ b/hw/sparc/sun4m.c >> @@ -836,12 +836,10 @@ static void dummy_fdc_tc(void *opaque, int >> irq, int level) >> { >> } >> >> -static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, >> ram_addr_t RAM_size, >> - const char *boot_device, >> - const char *kernel_filename, >> - const char *kernel_cmdline, >> - const char *initrd_filename, const char *cpu_model) >> +static void sun4m_hw_init(const struct sun4m_hwdef *hwdef, >> + QEMUMachineInitArgs *args) >> { >> + const char *cpu_model = args->cpu_model; > > This may not be strictly necessary; in the first patch you modify > args->cpu_model too. Yes. > In any case the above is not wrong. > >> @@ -878,13 +875,15 @@ static void sun4uv_init(MemoryRegion *address_space_mem, >> >> initrd_size = 0; >> initrd_addr = 0; >> - kernel_size = sun4u_load_kernel(kernel_filename, initrd_filename, >> + kernel_size = sun4u_load_kernel(args->kernel_filename, >> + args->initrd_filename, >> ram_size, &initrd_size, &initrd_addr, >> &kernel_addr, &kernel_entry); > > The patch is correct / faithful here, but I smell some fubar in the code > that the patch keeps intact. > > "ram_size" is apparently the global variable from "vl.c". So this > function gets the RAM size twice, once via RAM_size / args->ram_size, > then via the "ram_size" global. (They should have identical values, > "args.ram_size" in main() is initialized with "ram_size" the global.) > > The rest of the code below this hunk (in the full source file, not just > in the patch) alternates between RAM_size / args->ram_size and > "ram_size" quite schizophrenically too; see eg. FW_CFG_RAM_SIZE. Correct. Could be cleaned up on top. > Anyway the patch only improves things. > > Reviewed-by: Laszlo Ersek Thanks!