Use the new macro to avoid some boilerplate.

Signed-off-by: Eric Blake <ebl...@redhat.com>
---
 block/qapi.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/block/qapi.c b/block/qapi.c
index a62e862..802a372 100644
--- a/block/qapi.c
+++ b/block/qapi.c
@@ -691,15 +691,13 @@ void bdrv_image_info_specific_dump(fprintf_function 
func_fprintf, void *f,
                                    ImageInfoSpecific *info_spec)
 {
     QObject *obj, *data;
-    Visitor *v = qobject_output_visitor_new(&obj);

-    visit_type_ImageInfoSpecific(v, NULL, &info_spec, &error_abort);
-    visit_complete(v, &obj);
+    obj = QAPI_TO_QOBJECT(ImageInfoSpecific, info_spec, &error_abort);
+
     assert(qobject_type(obj) == QTYPE_QDICT);
     data = qdict_get(qobject_to_qdict(obj), "data");
     dump_qobject(func_fprintf, f, 1, data);
     qobject_decref(obj);
-    visit_free(v);
 }

 void bdrv_image_info_dump(fprintf_function func_fprintf, void *f,
-- 
2.7.4


Reply via email to