From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48942) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8o31-0001Tf-DC for qemu-devel@nongnu.org; Tue, 15 Dec 2015 06:45:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a8o2w-0006pW-0f for qemu-devel@nongnu.org; Tue, 15 Dec 2015 06:45:39 -0500 Received: from mx1.redhat.com ([209.132.183.28]:50583) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a8o2v-0006pK-H5 for qemu-devel@nongnu.org; Tue, 15 Dec 2015 06:45:33 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id D5C55C814 for ; Tue, 15 Dec 2015 11:45:32 +0000 (UTC) References: <1449859353-1574-1-git-send-email-ehabkost@redhat.com> <1449859353-1574-7-git-send-email-ehabkost@redhat.com> From: Marcel Apfelbaum Message-ID: <566FFD5A.3010000@redhat.com> Date: Tue, 15 Dec 2015 13:45:30 +0200 MIME-Version: 1.0 In-Reply-To: <1449859353-1574-7-git-send-email-ehabkost@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 06/14] pc: Simplify xen_load_linux() signature List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost , qemu-devel@nongnu.org Cc: Igor Mammedov , Marcel Apfelbaum , "Michael S. Tsirkin" On 12/11/2015 08:42 PM, Eduardo Habkost wrote: > We can get the PcGuestInfo struct directly from PCMachineState, > and the return value is not needed at all. > > Signed-off-by: Eduardo Habkost > --- > hw/i386/pc.c | 5 ++--- > hw/i386/pc_piix.c | 2 +- > include/hw/i386/pc.h | 3 +-- > 3 files changed, 4 insertions(+), 6 deletions(-) > > diff --git a/hw/i386/pc.c b/hw/i386/pc.c > index b4c638d..aa12814 100644 > --- a/hw/i386/pc.c > +++ b/hw/i386/pc.c > @@ -1255,11 +1255,11 @@ void pc_acpi_init(const char *default_dsdt) > } > } > > -FWCfgState *xen_load_linux(PCMachineState *pcms, > - PcGuestInfo *guest_info) > +void xen_load_linux(PCMachineState *pcms) > { > int i; > FWCfgState *fw_cfg; > + PcGuestInfo *guest_info = &pcms->acpi_guest_info; > > assert(MACHINE(pcms)->kernel_filename != NULL); > > @@ -1273,7 +1273,6 @@ FWCfgState *xen_load_linux(PCMachineState *pcms, > rom_add_option(option_rom[i].name, option_rom[i].bootindex); > } > guest_info->fw_cfg = fw_cfg; > - return fw_cfg; > } > > void pc_memory_init(PCMachineState *pcms, > diff --git a/hw/i386/pc_piix.c b/hw/i386/pc_piix.c > index f7bc1c0..f39c086 100644 > --- a/hw/i386/pc_piix.c > +++ b/hw/i386/pc_piix.c > @@ -164,7 +164,7 @@ static void pc_init1(MachineState *machine, > rom_memory, &ram_memory); > } else if (machine->kernel_filename != NULL) { > /* For xen HVM direct kernel boot, load linux here */ > - xen_load_linux(pcms, guest_info); > + xen_load_linux(pcms); > } > > gsi_state = g_malloc0(sizeof(*gsi_state)); > diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h > index 3943507..24362ef 100644 > --- a/include/hw/i386/pc.h > +++ b/include/hw/i386/pc.h > @@ -230,8 +230,7 @@ PcGuestInfo *pc_guest_info_init(PCMachineState *pcms); > void pc_pci_as_mapping_init(Object *owner, MemoryRegion *system_memory, > MemoryRegion *pci_address_space); > > -FWCfgState *xen_load_linux(PCMachineState *pcms, > - PcGuestInfo *guest_info); > +void xen_load_linux(PCMachineState *pcms); > void pc_memory_init(PCMachineState *pcms, > MemoryRegion *system_memory, > MemoryRegion *rom_memory, > Reviewed-by: Marcel Apfelbaum