aboutsummaryrefslogtreecommitdiff
path: root/tests/test-qmp-commands.c
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2016-06-09 10:48:38 -0600
committerMarkus Armbruster <armbru@redhat.com>2016-07-06 10:52:04 +0200
commitb70ce1018a251c0c33498d9c927a07cade655a5e (patch)
tree6f11b7166523750427c3bdf8f468567a80a0aea5 /tests/test-qmp-commands.c
parent7a0525c7be6b38d32d586e3fd12e7377ded21faa (diff)
qmp-input-visitor: Favor new visit_free() function
Now that we have a polymorphic visit_free(), we no longer need qmp_input_visitor_cleanup(); which in turn means we no longer need to return a subtype from qmp_input_visitor_new() nor a public upcast function. Generated code changes to qmp-marshal.c look like: |@@ -52,11 +52,10 @@ void qmp_marshal_add_fd(QDict *args, QOb | { | Error *err = NULL; | AddfdInfo *retval; |- QmpInputVisitor *qiv = qmp_input_visitor_new(QOBJECT(args), true); | Visitor *v; | q_obj_add_fd_arg arg = {0}; | |- v = qmp_input_get_visitor(qiv); |+ v = qmp_input_visitor_new(QOBJECT(args), true); | visit_start_struct(v, NULL, NULL, 0, &err); | if (err) { | goto out; Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <1465490926-28625-8-git-send-email-eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'tests/test-qmp-commands.c')
-rw-r--r--tests/test-qmp-commands.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test-qmp-commands.c b/tests/test-qmp-commands.c
index e8f619d331..8ffeb045cd 100644
--- a/tests/test-qmp-commands.c
+++ b/tests/test-qmp-commands.c
@@ -216,14 +216,14 @@ static void test_dealloc_partial(void)
/* create partial object */
{
QDict *ud2_dict;
- QmpInputVisitor *qiv;
+ Visitor *v;
ud2_dict = qdict_new();
qdict_put_obj(ud2_dict, "string0", QOBJECT(qstring_from_str(text)));
- qiv = qmp_input_visitor_new(QOBJECT(ud2_dict), true);
- visit_type_UserDefTwo(qmp_input_get_visitor(qiv), NULL, &ud2, &err);
- qmp_input_visitor_cleanup(qiv);
+ v = qmp_input_visitor_new(QOBJECT(ud2_dict), true);
+ visit_type_UserDefTwo(v, NULL, &ud2, &err);
+ visit_free(v);
QDECREF(ud2_dict);
}