From patchwork Wed Mar 20 23:23:22 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laszlo Ersek X-Patchwork-Id: 229514 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id EED0A2C00BA for ; Thu, 21 Mar 2013 10:23:39 +1100 (EST) Received: from localhost ([::1]:46524 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UISM6-0005ZV-2Y for incoming@patchwork.ozlabs.org; Wed, 20 Mar 2013 19:23:38 -0400 Received: from eggs.gnu.org ([208.118.235.92]:47495) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UISK8-0002kw-C1 for qemu-devel@nongnu.org; Wed, 20 Mar 2013 19:21:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UISK5-0003TS-FO for qemu-devel@nongnu.org; Wed, 20 Mar 2013 19:21:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:14114) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UISK5-0003TJ-5x for qemu-devel@nongnu.org; Wed, 20 Mar 2013 19:21:33 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2KNLWXi014898 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 20 Mar 2013 19:21:32 -0400 Received: from lacos-laptop.usersys.redhat.com (vpn1-7-176.ams2.redhat.com [10.36.7.176]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r2KNLDcP018608; Wed, 20 Mar 2013 19:21:31 -0400 From: Laszlo Ersek To: qemu-devel@nongnu.org, mst@redhat.com, aliguori@us.ibm.com, kraxel@redhat.com Date: Thu, 21 Mar 2013 00:23:22 +0100 Message-Id: <1363821803-3380-11-git-send-email-lersek@redhat.com> In-Reply-To: <1363821803-3380-1-git-send-email-lersek@redhat.com> References: <1363821803-3380-1-git-send-email-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 10/11] pc_acpi_init(): don't bail as soon as failing to find default DSDT X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Laszlo Ersek --- hw/i386/pc.c | 33 +++++++++++++++++---------------- 1 files changed, 17 insertions(+), 16 deletions(-) diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 23f9800..0a5d4d4 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -888,9 +888,7 @@ void pc_cpus_init(const char *cpu_model) void pc_acpi_init(const char *default_dsdt) { - char *filename = NULL, *arg = NULL; - QemuOpts *opts; - Error *err = NULL; + char *filename; if (acpi_tables != NULL) { /* manually set via -acpitable, leave it alone */ @@ -900,23 +898,26 @@ void pc_acpi_init(const char *default_dsdt) filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, default_dsdt); if (filename == NULL) { fprintf(stderr, "WARNING: failed to find %s\n", default_dsdt); - return; - } + } else { + char *arg; + QemuOpts *opts; + Error *err = NULL; - arg = g_strdup_printf("file=%s", filename); + arg = g_strdup_printf("file=%s", filename); - /* creates a deep copy of "arg" */ - opts = qemu_opts_parse(qemu_find_opts("acpi"), arg, 0); - g_assert(opts != NULL); + /* creates a deep copy of "arg" */ + opts = qemu_opts_parse(qemu_find_opts("acpi"), arg, 0); + g_assert(opts != NULL); - acpi_table_add(opts, &err); - if (err) { - fprintf(stderr, "WARNING: failed to load %s: %s\n", filename, - error_get_pretty(err)); - error_free(err); + acpi_table_add(opts, &err); + if (err) { + fprintf(stderr, "WARNING: failed to load %s: %s\n", filename, + error_get_pretty(err)); + error_free(err); + } + g_free(arg); + g_free(filename); } - g_free(arg); - g_free(filename); } void *pc_memory_init(MemoryRegion *system_memory,