From 46f5ac205a9dc5e2c24274c7df371509a286281f Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Thu, 27 Apr 2017 16:58:17 -0500 Subject: 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 Reviewed-by: Markus Armbruster Message-Id: <20170427215821.19397-7-eblake@redhat.com> Reviewed-by: Stefan Hajnoczi Reviewed-by: Alberto Garcia Signed-off-by: Markus Armbruster --- block/vvfat.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'block/vvfat.c') 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); -- cgit v1.2.1