summaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2017-04-27 16:58:15 -0500
committerMichael Roth <mdroth@linux.vnet.ibm.com>2017-07-31 17:07:06 -0500
commit3f308bf3acc724d50ffa3f280f75f4c7b5bb6003 (patch)
tree99bbdc79a2fdf02a5440a2ea9285c88e996aa593 /block.c
parent21047240d01ac8a8b90f65b8bc41b289ee3ba6ff (diff)
downloadqemu-3f308bf3acc724d50ffa3f280f75f4c7b5bb6003.tar.gz
qobject: Drop useless QObject casts
We have macros in place to make it less verbose to add a subtype of QObject to both QDict and QList. While we have made cleanups like this in the past (see commit fcfcd8ffc, for example), having it be automated by Coccinelle makes it easier to maintain. Patch created mechanically via: spatch --sp-file scripts/coccinelle/qobject.cocci \ --macro-file scripts/cocci-macro-file.h --dir . --in-place then I verified that no manual touchups were required. Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20170427215821.19397-5-eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> (cherry picked from commit de6e7951fe66053dfeaac1a237f7aceb9e079619) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/block.c b/block.c
index 46da908c93..f15634825e 100644
--- a/block.c
+++ b/block.c
@@ -4674,11 +4674,9 @@ void bdrv_refresh_filename(BlockDriverState *bs)
* contain a representation of the filename, therefore the following
* suffices without querying the (exact_)filename of this BDS. */
if (bs->file->bs->full_open_options) {
- qdict_put_obj(opts, "driver",
- QOBJECT(qstring_from_str(drv->format_name)));
+ qdict_put(opts, "driver", qstring_from_str(drv->format_name));
QINCREF(bs->file->bs->full_open_options);
- qdict_put_obj(opts, "file",
- QOBJECT(bs->file->bs->full_open_options));
+ qdict_put(opts, "file", bs->file->bs->full_open_options);
bs->full_open_options = opts;
} else {
@@ -4694,8 +4692,7 @@ void bdrv_refresh_filename(BlockDriverState *bs)
opts = qdict_new();
append_open_options(opts, bs);
- qdict_put_obj(opts, "driver",
- QOBJECT(qstring_from_str(drv->format_name)));
+ qdict_put(opts, "driver", qstring_from_str(drv->format_name));
if (bs->exact_filename[0]) {
/* This may not work for all block protocol drivers (some may
@@ -4705,8 +4702,7 @@ void bdrv_refresh_filename(BlockDriverState *bs)
* needs some special format of the options QDict, it needs to
* implement the driver-specific bdrv_refresh_filename() function.
*/
- qdict_put_obj(opts, "filename",
- QOBJECT(qstring_from_str(bs->exact_filename)));
+ qdict_put(opts, "filename", qstring_from_str(bs->exact_filename));
}
bs->full_open_options = opts;