diff options
author | Laszlo Ersek <lersek@redhat.com> | 2013-03-21 00:23:22 +0100 |
---|---|---|
committer | Anthony Liguori <aliguori@us.ibm.com> | 2013-04-04 19:23:09 -0500 |
commit | c5a98cf333997616147a161ef4e4cf71bb9bd00a (patch) | |
tree | 983808813071ab1cc5a8eaed3f6ad7ac148a57c4 /hw | |
parent | 3a4a4697aacdd58b77f8bca6f2c0ce307b213506 (diff) |
pc_acpi_init(): don't bail as soon as failing to find default DSDT
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Anthony Liguori <aliguori@us.ibm.com>
Message-id: 1363821803-3380-11-git-send-email-lersek@redhat.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r-- | 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 09d44fcf34..ebbf059225 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -891,9 +891,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 */ @@ -903,23 +901,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, |