[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v4 04/12] block/nbd: Use qdict_put()
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PATCH v4 04/12] block/nbd: Use qdict_put() |
Date: |
Wed, 28 Sep 2016 22:55:54 +0200 |
Instead of inlining this nice macro (i.e. resorting to
qdict_put_obj(..., QOBJECT(...))), use it.
Signed-off-by: Max Reitz <address@hidden>
---
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.0
- [Qemu-devel] [PATCH v4 00/12] qapi: Allow blockdev-add for NBD, Max Reitz, 2016/09/28
- [Qemu-devel] [PATCH v4 01/12] block/nbd: Drop trailing "." in error messages, Max Reitz, 2016/09/28
- [Qemu-devel] [PATCH v4 02/12] block/nbd: Reject port parameter without host, Max Reitz, 2016/09/28
- [Qemu-devel] [PATCH v4 03/12] block/nbd: Default port in nbd_refresh_filename(), Max Reitz, 2016/09/28
- [Qemu-devel] [PATCH v4 04/12] block/nbd: Use qdict_put(),
Max Reitz <=
- [Qemu-devel] [PATCH v4 05/12] block/nbd: Add nbd_has_filename_options_conflict(), Max Reitz, 2016/09/28
- [Qemu-devel] [PATCH v4 06/12] block/nbd: Accept SocketAddress, Max Reitz, 2016/09/28
- [Qemu-devel] [PATCH v4 07/12] block/nbd: Use SocketAddress options, Max Reitz, 2016/09/28
- [Qemu-devel] [PATCH v4 08/12] qapi: Allow blockdev-add for NBD, Max Reitz, 2016/09/28
- [Qemu-devel] [PATCH v4 09/12] iotests.py: Add qemu_nbd function, Max Reitz, 2016/09/28
- [Qemu-devel] [PATCH v4 10/12] iotests.py: Allow concurrent qemu instances, Max Reitz, 2016/09/28
- [Qemu-devel] [PATCH v4 11/12] socket_scm_helper: Accept fd directly, Max Reitz, 2016/09/28
- [Qemu-devel] [PATCH v4 12/12] iotests: Add test for NBD's blockdev-add interface, Max Reitz, 2016/09/28