[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v5 08/10] QemuOpts: Simplify qemu_opts_to_qdict()
From: |
Eric Blake |
Subject: |
[Qemu-devel] [PATCH v5 08/10] QemuOpts: Simplify qemu_opts_to_qdict() |
Date: |
Thu, 27 Apr 2017 16:58:19 -0500 |
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 <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
---
v5: add R-b
v4: new patch
---
util/qemu-option.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/util/qemu-option.c b/util/qemu-option.c
index a36cafa..5977bfc 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;
}
--
2.9.3
- [Qemu-devel] [PATCH v5 00/10] qapi-related cleanups, Eric Blake, 2017/04/27
- [Qemu-devel] [PATCH v5 01/10] pci: Use struct instead of QDict to pass back parameters, Eric Blake, 2017/04/27
- [Qemu-devel] [PATCH v5 02/10] pci: Reduce scope of error injection, Eric Blake, 2017/04/27
- [Qemu-devel] [PATCH v5 03/10] coccinelle: Add script to remove useless QObject casts, Eric Blake, 2017/04/27
- [Qemu-devel] [PATCH v5 05/10] qobject: Add helper macros for common scalar insertions, Eric Blake, 2017/04/27
- [Qemu-devel] [PATCH v5 04/10] qobject: Drop useless QObject casts, Eric Blake, 2017/04/27
- [Qemu-devel] [PATCH v5 08/10] QemuOpts: Simplify qemu_opts_to_qdict(),
Eric Blake <=
- [Qemu-devel] [PATCH v5 07/10] block: Simplify bdrv_append_temp_snapshot() logic, Eric Blake, 2017/04/27
- [Qemu-devel] [PATCH v5 09/10] fdc-test: Avoid deprecated 'change' command, Eric Blake, 2017/04/27
- [Qemu-devel] [PATCH v5 10/10] test-qga: Actually test 0xff sync bytes, Eric Blake, 2017/04/27
- [Qemu-devel] [PATCH v5 06/10] qobject: Use simpler QDict/QList scalar insertion macros, Eric Blake, 2017/04/27