summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2017-04-27 16:58:19 -0500
committerMarkus Armbruster <armbru@redhat.com>2017-05-09 09:14:39 +0200
commit28934e0c759dae0d78b8b4336841b0287d04b4b6 (patch)
tree339e30021e10d48ed3540b2d154d180e05d59a4a /util
parentff6ed7141d87d26eafa2b8e4df969623e40fac49 (diff)
QemuOpts: Simplify qemu_opts_to_qdict()
Noticed while investigating Coccinelle cleanups. There is no need for a temporary variable when we can use the new macro to do the same thing with less typing. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20170427215821.19397-9-eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'util')
-rw-r--r--util/qemu-option.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/util/qemu-option.c b/util/qemu-option.c
index a36cafaf8c..5977bfc3e9 100644
--- a/util/qemu-option.c
+++ b/util/qemu-option.c
@@ -1054,7 +1054,6 @@ void qemu_opts_absorb_qdict(QemuOpts *opts, QDict *qdict, Error **errp)
QDict *qemu_opts_to_qdict(QemuOpts *opts, QDict *qdict)
{
QemuOpt *opt;
- QObject *val;
if (!qdict) {
qdict = qdict_new();
@@ -1063,8 +1062,7 @@ QDict *qemu_opts_to_qdict(QemuOpts *opts, QDict *qdict)
qdict_put_str(qdict, "id", opts->id);
}
QTAILQ_FOREACH(opt, &opts->head, next) {
- val = QOBJECT(qstring_from_str(opt->str));
- qdict_put_obj(qdict, opt->name, val);
+ qdict_put_str(qdict, opt->name, opt->str);
}
return qdict;
}