From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53574) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bz1WJ-0003hO-S6 for qemu-devel@nongnu.org; Tue, 25 Oct 2016 09:12:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bz1WI-000366-TU for qemu-devel@nongnu.org; Tue, 25 Oct 2016 09:11:59 -0400 From: Max Reitz Date: Tue, 25 Oct 2016 15:11:32 +0200 Message-Id: <20161025131141.24762-5-mreitz@redhat.com> In-Reply-To: <20161025131141.24762-1-mreitz@redhat.com> References: <20161025131141.24762-1-mreitz@redhat.com> Subject: [Qemu-devel] [PATCH v5 04/13] block/nbd: Use qdict_put() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-block@nongnu.org Cc: qemu-devel@nongnu.org, Max Reitz , Kevin Wolf , Eric Blake , Paolo Bonzini , Markus Armbruster Instead of inlining this nice macro (i.e. resorting to qdict_put_obj(..., QOBJECT(...))), use it. Reviewed-by: Eric Blake Reviewed-by: Kevin Wolf Signed-off-by: Max Reitz --- block/nbd.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/block/nbd.c b/block/nbd.c index c77a969..c539fb5 100644 --- a/block/nbd.c +++ b/block/nbd.c @@ -446,7 +446,7 @@ static void nbd_refresh_filename(BlockDriverState *bs, QDict *options) QDict *opts = qdict_new(); const char *port = s->port ?: stringify(NBD_DEFAULT_PORT); - qdict_put_obj(opts, "driver", QOBJECT(qstring_from_str("nbd"))); + qdict_put(opts, "driver", qstring_from_str("nbd")); if (s->path && s->export) { snprintf(bs->exact_filename, sizeof(bs->exact_filename), @@ -463,17 +463,16 @@ static void nbd_refresh_filename(BlockDriverState *bs, QDict *options) } if (s->path) { - qdict_put_obj(opts, "path", QOBJECT(qstring_from_str(s->path))); + qdict_put(opts, "path", qstring_from_str(s->path)); } else { - qdict_put_obj(opts, "host", QOBJECT(qstring_from_str(s->host))); - qdict_put_obj(opts, "port", QOBJECT(qstring_from_str(port))); + qdict_put(opts, "host", qstring_from_str(s->host)); + qdict_put(opts, "port", qstring_from_str(port)); } if (s->export) { - qdict_put_obj(opts, "export", QOBJECT(qstring_from_str(s->export))); + qdict_put(opts, "export", qstring_from_str(s->export)); } if (s->tlscredsid) { - qdict_put_obj(opts, "tls-creds", - QOBJECT(qstring_from_str(s->tlscredsid))); + qdict_put(opts, "tls-creds", qstring_from_str(s->tlscredsid)); } bs->full_open_options = opts; -- 2.10.1