diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2018-04-19 17:01:44 +0200 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2018-05-04 08:27:53 +0200 |
commit | f5a74a5a50387c6f980b2e2f94f062487a1826da (patch) | |
tree | eefbe4d2f8bb0f889c9643d140fd702f131c4fd0 /block/nvme.c | |
parent | cb3e7f08aeaab0ab13e629ce8496dca150a449ba (diff) | |
download | qemu-f5a74a5a50387c6f980b2e2f94f062487a1826da.zip qemu-f5a74a5a50387c6f980b2e2f94f062487a1826da.tar.gz qemu-f5a74a5a50387c6f980b2e2f94f062487a1826da.tar.bz2 |
qobject: Modify qobject_ref() to return obj
For convenience and clarity, make it possible to call qobject_ref() at
the time when the reference is associated with a variable, or
argument, by making qobject_ref() return the same pointer as given.
Use that to simplify the callers.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <20180419150145.24795-5-marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
[Useless change to qobject_ref_impl() dropped, commit message improved
slightly]
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'block/nvme.c')
-rw-r--r-- | block/nvme.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/block/nvme.c b/block/nvme.c index e192da9..6f71122 100644 --- a/block/nvme.c +++ b/block/nvme.c @@ -1073,7 +1073,6 @@ static int nvme_reopen_prepare(BDRVReopenState *reopen_state, static void nvme_refresh_filename(BlockDriverState *bs, QDict *opts) { - qobject_ref(opts); qdict_del(opts, "filename"); if (!qdict_size(opts)) { @@ -1082,7 +1081,7 @@ static void nvme_refresh_filename(BlockDriverState *bs, QDict *opts) } qdict_put_str(opts, "driver", bs->drv->format_name); - bs->full_open_options = opts; + bs->full_open_options = qobject_ref(opts); } static void nvme_refresh_limits(BlockDriverState *bs, Error **errp) |