diff options
author | Eric Blake <eblake@redhat.com> | 2017-04-27 16:58:17 -0500 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2017-05-09 09:13:51 +0200 |
commit | 46f5ac205a9dc5e2c24274c7df371509a286281f (patch) | |
tree | 52cd3eab32f34963a5275f6f291386d4ad8b6624 /block/vvfat.c | |
parent | a92c21591b5bb9543996538f14854ca6b528318b (diff) |
qobject: Use simpler QDict/QList scalar insertion macros
We now have macros in place to make it less verbose to add a scalar
to QDict and QList, so use them.
Patch created mechanically via:
spatch --sp-file scripts/coccinelle/qobject.cocci \
--macro-file scripts/cocci-macro-file.h --dir . --in-place
then touched up manually to fix a couple of '?:' back to original
spacing, as well as avoiding a long line in monitor.c.
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20170427215821.19397-7-eblake@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'block/vvfat.c')
-rw-r--r-- | block/vvfat.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/block/vvfat.c b/block/vvfat.c index b509d55642..9c82371360 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -1057,10 +1057,10 @@ static void vvfat_parse_filename(const char *filename, QDict *options, } /* Fill in the options QDict */ - qdict_put(options, "dir", qstring_from_str(filename)); - qdict_put(options, "fat-type", qint_from_int(fat_type)); - qdict_put(options, "floppy", qbool_from_bool(floppy)); - qdict_put(options, "rw", qbool_from_bool(rw)); + qdict_put_str(options, "dir", filename); + qdict_put_int(options, "fat-type", fat_type); + qdict_put_bool(options, "floppy", floppy); + qdict_put_bool(options, "rw", rw); } static int vvfat_open(BlockDriverState *bs, QDict *options, int flags, @@ -3051,7 +3051,7 @@ static int enable_write_target(BlockDriverState *bs, Error **errp) } options = qdict_new(); - qdict_put(options, "write-target.driver", qstring_from_str("qcow")); + qdict_put_str(options, "write-target.driver", "qcow"); s->qcow = bdrv_open_child(s->qcow_filename, options, "write-target", bs, &child_vvfat_qcow, false, errp); QDECREF(options); |