aboutsummaryrefslogtreecommitdiff
path: root/qapi/opts-visitor.c
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2016-06-09 10:48:36 -0600
committerMarkus Armbruster <armbru@redhat.com>2016-07-06 10:52:04 +0200
commit09204eac9bb513e56992c00c75f32f9d4766256b (patch)
treea83c6884b990b0d3782cc1f40f69787085f4a6cd /qapi/opts-visitor.c
parent2c0ef9f411ae6081efa9eca5b3eab2dbeee45a6c (diff)
downloadqemu-09204eac9bb513e56992c00c75f32f9d4766256b.zip
qemu-09204eac9bb513e56992c00c75f32f9d4766256b.tar.gz
qemu-09204eac9bb513e56992c00c75f32f9d4766256b.tar.bz2
opts-visitor: Favor new visit_free() function
Now that we have a polymorphic visit_free(), we no longer need opts_visitor_cleanup(); which in turn means we no longer need to return a subtype from opts_visitor_new() nor a public upcast function. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <1465490926-28625-6-git-send-email-eblake@redhat.com> Reviewed-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'qapi/opts-visitor.c')
-rw-r--r--qapi/opts-visitor.c26
1 files changed, 6 insertions, 20 deletions
diff --git a/qapi/opts-visitor.c b/qapi/opts-visitor.c
index 72c95ac..1048bbc 100644
--- a/qapi/opts-visitor.c
+++ b/qapi/opts-visitor.c
@@ -518,11 +518,15 @@ opts_free(Visitor *v)
{
OptsVisitor *ov = to_ov(v);
- opts_visitor_cleanup(ov);
+ if (ov->unprocessed_opts != NULL) {
+ g_hash_table_destroy(ov->unprocessed_opts);
+ }
+ g_free(ov->fake_id_opt);
+ g_free(ov);
}
-OptsVisitor *
+Visitor *
opts_visitor_new(const QemuOpts *opts)
{
OptsVisitor *ov;
@@ -553,23 +557,5 @@ opts_visitor_new(const QemuOpts *opts)
ov->opts_root = opts;
- return ov;
-}
-
-
-void
-opts_visitor_cleanup(OptsVisitor *ov)
-{
- if (ov->unprocessed_opts != NULL) {
- g_hash_table_destroy(ov->unprocessed_opts);
- }
- g_free(ov->fake_id_opt);
- g_free(ov);
-}
-
-
-Visitor *
-opts_get_visitor(OptsVisitor *ov)
-{
return &ov->visitor;
}