From 1830f22a6777cedaccd67a08f675d30f7a85ebfd Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Thu, 9 Jun 2016 10:48:40 -0600 Subject: qmp-output-visitor: Favor new visit_free() function Now that we have a polymorphic visit_free(), we no longer need qmp_output_visitor_cleanup(); however, we still need to expose the subtype for qmp_output_get_qobject(). Signed-off-by: Eric Blake Message-Id: <1465490926-28625-10-git-send-email-eblake@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- qapi/qmp-output-visitor.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'qapi/qmp-output-visitor.c') diff --git a/qapi/qmp-output-visitor.c b/qapi/qmp-output-visitor.c index 5f0035cbf6..3d12623cf9 100644 --- a/qapi/qmp-output-visitor.c +++ b/qapi/qmp-output-visitor.c @@ -217,21 +217,15 @@ Visitor *qmp_output_get_visitor(QmpOutputVisitor *v) static void qmp_output_free(Visitor *v) { QmpOutputVisitor *qov = to_qov(v); - - qmp_output_visitor_cleanup(qov); -} - -void qmp_output_visitor_cleanup(QmpOutputVisitor *v) -{ QStackEntry *e, *tmp; - QTAILQ_FOREACH_SAFE(e, &v->stack, node, tmp) { - QTAILQ_REMOVE(&v->stack, e, node); + QTAILQ_FOREACH_SAFE(e, &qov->stack, node, tmp) { + QTAILQ_REMOVE(&qov->stack, e, node); g_free(e); } - qobject_decref(v->root); - g_free(v); + qobject_decref(qov->root); + g_free(qov); } QmpOutputVisitor *qmp_output_visitor_new(void) -- cgit v1.2.3