summary refs log tree commit diff stats
path: root/hw/i386/pc.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2015-02-13 15:46:36 +0100
committerMarkus Armbruster <armbru@redhat.com>2015-02-26 14:52:07 +0100
commit5bdb59a290cfc7332fdc23c6368310e0327e3828 (patch)
tree3fdfdc49c4c0892b19f45998ae26cfce7ca5dcf2 /hw/i386/pc.c
parent62b3de693469508a58864bffefd3d54f897558b4 (diff)
downloadfocaccia-qemu-5bdb59a290cfc7332fdc23c6368310e0327e3828.tar.gz
focaccia-qemu-5bdb59a290cfc7332fdc23c6368310e0327e3828.zip
pc: Use qemu_opt_set() instead of qemu_opts_parse()
Less code, same result.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'hw/i386/pc.c')
-rw-r--r--hw/i386/pc.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
index 05008cbf6a..51b4cf5db3 100644
--- a/hw/i386/pc.c
+++ b/hw/i386/pc.c
@@ -1137,15 +1137,11 @@ void pc_acpi_init(const char *default_dsdt)
     if (filename == NULL) {
         fprintf(stderr, "WARNING: failed to find %s\n", default_dsdt);
     } else {
-        char *arg;
-        QemuOpts *opts;
+        QemuOpts *opts = qemu_opts_create(qemu_find_opts("acpi"), NULL, 0,
+                                          &error_abort);
         Error *err = NULL;
 
-        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);
+        qemu_opt_set(opts, "file", filename, &error_abort);
 
         acpi_table_add_builtin(opts, &err);
         if (err) {
@@ -1153,7 +1149,6 @@ void pc_acpi_init(const char *default_dsdt)
                          error_get_pretty(err));
             error_free(err);
         }
-        g_free(arg);
         g_free(filename);
     }
 }