From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54841) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5xt1-0007sG-Pw for qemu-devel@nongnu.org; Mon, 07 Dec 2015 10:39:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a5xsy-0001QJ-I0 for qemu-devel@nongnu.org; Mon, 07 Dec 2015 10:39:35 -0500 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]:37105) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5xsy-0001Q9-C2 for qemu-devel@nongnu.org; Mon, 07 Dec 2015 10:39:32 -0500 Received: by wmww144 with SMTP id w144so155274090wmw.0 for ; Mon, 07 Dec 2015 07:39:31 -0800 (PST) References: <1449020831-8414-1-git-send-email-ehabkost@redhat.com> <1449020831-8414-7-git-send-email-ehabkost@redhat.com> From: Marcel Apfelbaum Message-ID: <5665A831.2060504@gmail.com> Date: Mon, 7 Dec 2015 17:39:29 +0200 MIME-Version: 1.0 In-Reply-To: <1449020831-8414-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 06/16] acpi: Save PCMachineState on AcpiBuildState Reply-To: marcel@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost , qemu-devel@nongnu.org Cc: Igor Mammedov , "Michael S. Tsirkin" , Marcel Apfelbaum On 12/02/2015 03:47 AM, Eduardo Habkost wrote: > PCMachineState will be used in some of the steps of ACPI table > building. > > Signed-off-by: Eduardo Habkost > --- > hw/i386/acpi-build.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c > index 85a5c53..ca11c88 100644 > --- a/hw/i386/acpi-build.c > +++ b/hw/i386/acpi-build.c > @@ -1644,7 +1644,7 @@ struct AcpiBuildState { > MemoryRegion *table_mr; > /* Is table patched? */ > uint8_t patched; > - PcGuestInfo *guest_info; > + PCMachineState *pcms; > void *rsdp; > MemoryRegion *rsdp_mr; > MemoryRegion *linker_mr; > @@ -1855,7 +1855,7 @@ static void acpi_build_update(void *build_opaque, uint32_t offset) > > acpi_build_tables_init(&tables); > > - acpi_build(build_state->guest_info, &tables); > + acpi_build(&build_state->pcms->acpi_guest_info, &tables); > > acpi_ram_update(build_state->table_mr, tables.table_data); > > @@ -1916,12 +1916,12 @@ void acpi_setup(PCMachineState *pcms) > > build_state = g_malloc0(sizeof *build_state); > > - build_state->guest_info = guest_info; > + build_state->pcms = pcms; I am not "sold" on keeping a reference to machine in the build_state. We can always query current machine using qdev_machine() or something. Keeping the "guest info" made sense since is used especially for ACPI, however the machine has a wider scope. (And not having to keep it around is a very good thing!) Thanks, Marcel > > acpi_set_pci_info(); > > acpi_build_tables_init(&tables); > - acpi_build(build_state->guest_info, &tables); > + acpi_build(&build_state->pcms->acpi_guest_info, &tables); > > /* Now expose it all to Guest */ > build_state->table_mr = acpi_add_rom_blob(build_state, tables.table_data, >