From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:54578) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCQ0p-0005IS-MF for qemu-devel@nongnu.org; Fri, 14 Sep 2012 03:08:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TCQ0j-0001h6-O2 for qemu-devel@nongnu.org; Fri, 14 Sep 2012 03:08:27 -0400 Received: from mail-we0-f173.google.com ([74.125.82.173]:43574) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TCQ0j-0001h0-Ha for qemu-devel@nongnu.org; Fri, 14 Sep 2012 03:08:21 -0400 Received: by weyz53 with SMTP id z53so2128072wey.4 for ; Fri, 14 Sep 2012 00:08:20 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <5052D7E0.6010508@redhat.com> Date: Fri, 14 Sep 2012 09:08:16 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <98c6427441763d8673fcb33918945943e8396b05.1347561356.git.jbaron@redhat.com> In-Reply-To: <98c6427441763d8673fcb33918945943e8396b05.1347561356.git.jbaron@redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 25/25] q35: automatically load the q35 dsdt table List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jason Baron Cc: aliguori@us.ibm.com, juzhang@redhat.com, mst@redhat.com, jan.kiszka@siemens.com, qemu-devel@nongnu.org, agraf@suse.de, yamahata@valinux.co.jp, alex.williamson@redhat.com, kevin@koconnor.net, avi@redhat.com, mkletzan@redhat.com, lcapitulino@redhat.com, afaerber@suse.de, armbru@redhat.com Il 13/09/2012 22:12, Jason Baron ha scritto: > Automatically, locate the required q35 dsdt table on load. Otherwise we error > out. This could be done in the bios, but its harder to produce a good error > message. > > Signed-off-by: Jason Baron > --- > hw/pc_q35.c | 26 ++++++++++++++++++++++++++ > 1 files changed, 26 insertions(+), 0 deletions(-) > > diff --git a/hw/pc_q35.c b/hw/pc_q35.c > index b8c1196..08ae62b 100644 > --- a/hw/pc_q35.c > +++ b/hw/pc_q35.c > @@ -329,6 +329,25 @@ static void pc_q35_init_late(BusState **idebus, ISADevice *rtc_state, > 8, NULL, 0); > } > > +static int find_and_load_dsdt(const char *dsdt_name) > +{ > + char *filename; > + char buf[256]; > + > + filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, dsdt_name); > + if (!filename) { > + return -1; > + } > + > + snprintf(buf, 256, "file=%s", filename); > + if (acpi_table_add(buf) < 0) { > + fprintf(stderr, "Wrong acpi table provided\n"); > + return -1; > + } > + > + return 0; > +} > + > /* PC hardware initialisation */ > static void pc_q35_init(ram_addr_t ram_size, > const char *boot_device, > @@ -356,6 +375,13 @@ static void pc_q35_init(ram_addr_t ram_size, > qemu_irq *i8259; > int i; > > + /* let's first see if we can find the proper dsdt */ > + if (find_and_load_dsdt("q35-acpi-dsdt.aml")) { > + fprintf(stderr, "Couldn't find q35 dsdt table!\n" > + "Try updating your bios.\n"); > + exit(1); > + } > + > pc_cpus_init(cpu_model); > > kvmclock_create(); > Should we take the PIIX4 DSDT into the QEMU tree, and do the same thing for PIIX4? Paolo