From: Eric Blake <eblake@redhat.com>
To: qemu-devel@nongnu.org
Cc: armbru@redhat.com, Jeff Cody <jcody@redhat.com>,
Peter Lieven <pl@kamp.de>, Kevin Wolf <kwolf@redhat.com>,
Max Reitz <mreitz@redhat.com>,
"open list:NFS" <qemu-block@nongnu.org>
Subject: [Qemu-devel] [PATCH 3/5] nfs: Use simpler QAPI_TO_QOBJECT()
Date: Mon, 17 Jul 2017 10:56:30 -0500 [thread overview]
Message-ID: <20170717155632.12754-4-eblake@redhat.com> (raw)
In-Reply-To: <20170717155632.12754-1-eblake@redhat.com>
Use the new macro to avoid some boilerplate.
Signed-off-by: Eric Blake <eblake@redhat.com>
---
block/nfs.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/block/nfs.c b/block/nfs.c
index d8db419957..5f3045c1af 100644
--- a/block/nfs.c
+++ b/block/nfs.c
@@ -819,7 +819,6 @@ static void nfs_refresh_filename(BlockDriverState *bs, QDict *options)
NFSClient *client = bs->opaque;
QDict *opts = qdict_new();
QObject *server_qdict;
- Visitor *ov;
qdict_put_str(opts, "driver", "nfs");
@@ -840,9 +839,9 @@ static void nfs_refresh_filename(BlockDriverState *bs, QDict *options)
"nfs://%s%s", client->server->host, client->path);
}
- ov = qobject_output_visitor_new(&server_qdict);
- visit_type_NFSServer(ov, NULL, &client->server, &error_abort);
- visit_complete(ov, &server_qdict);
+ server_qdict = QAPI_TO_QOBJECT(NFSServer, client->server, &error_abort);
+ assert(qobject_type(server_qdict) == QTYPE_QDICT);
+
qdict_put_obj(opts, "server", server_qdict);
qdict_put_str(opts, "path", client->path);
@@ -865,7 +864,6 @@ static void nfs_refresh_filename(BlockDriverState *bs, QDict *options)
qdict_put_int(opts, "debug", client->debug);
}
- visit_free(ov);
qdict_flatten(opts);
bs->full_open_options = opts;
}
--
2.13.3
next prev parent reply other threads:[~2017-07-17 15:56 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-17 15:56 [Qemu-devel] [PATCH 0/5] Easier conversion from qapi to qobject Eric Blake
2017-07-17 15:56 ` [Qemu-devel] [PATCH 1/5] qapi: Add QAPI_TO_QOBJECT() convenience macro Eric Blake
2017-07-17 15:56 ` [Qemu-devel] [PATCH 2/5] nbd: Use simpler QAPI_TO_QOBJECT() Eric Blake
2017-07-17 15:56 ` Eric Blake [this message]
2017-07-17 15:56 ` [Qemu-devel] [PATCH 4/5] qapi: " Eric Blake
2017-07-17 15:56 ` [Qemu-devel] [PATCH 5/5] blockdev: " Eric Blake
2017-07-17 16:02 ` [Qemu-devel] [PATCH 0/5] Easier conversion from qapi to qobject Eric Blake
2017-07-18 15:52 ` Markus Armbruster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170717155632.12754-4-eblake@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=jcody@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=pl@kamp.de \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).