aboutsummaryrefslogtreecommitdiff
path: root/hw/i386
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2013-03-21 00:23:17 +0100
committerAnthony Liguori <aliguori@us.ibm.com>2013-04-04 19:23:08 -0500
commit0c764a9dfc0d480c21f325480aa2e69581841858 (patch)
treeeaed2d79b7c9b91481eccb6d1d15d739a7101924 /hw/i386
parent8ccbad5c7b61c46c1b69b8089b8965cd69c0a8de (diff)
downloadqemu-0c764a9dfc0d480c21f325480aa2e69581841858.zip
qemu-0c764a9dfc0d480c21f325480aa2e69581841858.tar.gz
qemu-0c764a9dfc0d480c21f325480aa2e69581841858.tar.bz2
acpi_table_add(): accept QemuOpts and parse it with OptsVisitor
As one consequence, strtok() -- which modifies its argument -- is replaced with g_strsplit(). Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Anthony Liguori <aliguori@us.ibm.com> Message-id: 1363821803-3380-6-git-send-email-lersek@redhat.com Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'hw/i386')
-rw-r--r--hw/i386/pc.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index b1e06fa..d1bc0de 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -51,6 +51,7 @@
#include "exec/address-spaces.h"
#include "sysemu/arch_init.h"
#include "qemu/bitmap.h"
+#include "qemu/config-file.h"
/* debug PC/ISA interrupts */
//#define DEBUG_IRQ
@@ -889,6 +890,7 @@ void pc_cpus_init(const char *cpu_model)
void pc_acpi_init(const char *default_dsdt)
{
char *filename = NULL, *arg = NULL;
+ QemuOpts *opts;
if (acpi_tables != NULL) {
/* manually set via -acpitable, leave it alone */
@@ -902,7 +904,12 @@ void pc_acpi_init(const char *default_dsdt)
}
arg = g_strdup_printf("file=%s", filename);
- if (acpi_table_add(arg) != 0) {
+
+ /* creates a deep copy of "arg" */
+ opts = qemu_opts_parse(qemu_find_opts("acpi"), arg, 0);
+ g_assert(opts != NULL);
+
+ if (acpi_table_add(opts) != 0) {
fprintf(stderr, "WARNING: failed to load %s\n", filename);
}
g_free(arg);