qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 3/5] nfs: Use simpler QAPI_TO_QOBJECT()


From: Eric Blake
Subject: [Qemu-devel] [PATCH 3/5] nfs: Use simpler QAPI_TO_QOBJECT()
Date: Mon, 17 Jul 2017 10:56:30 -0500

Use the new macro to avoid some boilerplate.

Signed-off-by: Eric Blake <address@hidden>
---
 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]