diff mbox

[v3,05/14] block/nbd: Use qdict_put()

Message ID 1459967330-4573-6-git-send-email-mreitz@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Max Reitz April 6, 2016, 6:28 p.m. UTC
Instead of inlining this nice macro (i.e. resorting to
qdict_put_obj(..., QOBJECT(...))), use it.

Signed-off-by: Max Reitz <mreitz@redhat.com>
---
 block/nbd.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Eric Blake June 14, 2016, 10:40 p.m. UTC | #1
On 04/06/2016 12:28 PM, Max Reitz wrote:
> Instead of inlining this nice macro (i.e. resorting to
> qdict_put_obj(..., QOBJECT(...))), use it.
> 
> Signed-off-by: Max Reitz <mreitz@redhat.com>
> ---
>  block/nbd.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)

Reviewed-by: Eric Blake <eblake@redhat.com>
diff mbox

Patch

diff --git a/block/nbd.c b/block/nbd.c
index efa5d3d..d12bcc6 100644
--- a/block/nbd.c
+++ b/block/nbd.c
@@ -437,7 +437,7 @@  static void nbd_refresh_filename(BlockDriverState *bs, QDict *options)
         port = stringify(NBD_DEFAULT_PORT);
     }
 
-    qdict_put_obj(opts, "driver", QOBJECT(qstring_from_str("nbd")));
+    qdict_put(opts, "driver", qstring_from_str("nbd"));
 
     if (path && export) {
         snprintf(bs->exact_filename, sizeof(bs->exact_filename),
@@ -454,16 +454,16 @@  static void nbd_refresh_filename(BlockDriverState *bs, QDict *options)
     }
 
     if (path) {
-        qdict_put_obj(opts, "path", QOBJECT(qstring_from_str(path)));
+        qdict_put(opts, "path", qstring_from_str(path));
     } else {
-        qdict_put_obj(opts, "host", QOBJECT(qstring_from_str(host)));
-        qdict_put_obj(opts, "port", QOBJECT(qstring_from_str(port)));
+        qdict_put(opts, "host", qstring_from_str(host));
+        qdict_put(opts, "port", qstring_from_str(port));
     }
     if (export) {
-        qdict_put_obj(opts, "export", QOBJECT(qstring_from_str(export)));
+        qdict_put(opts, "export", qstring_from_str(export));
     }
     if (tlscreds) {
-        qdict_put_obj(opts, "tls-creds", QOBJECT(qstring_from_str(tlscreds)));
+        qdict_put(opts, "tls-creds", qstring_from_str(tlscreds));
     }
 
     bs->full_open_options = opts;