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>
diff --git a/net/net.c b/net/net.c
index 75bb177..d25f802 100644
--- a/net/net.c
+++ b/net/net.c
@@ -1024,8 +1024,7 @@
void *object = NULL;
Error *err = NULL;
int ret = -1;
- OptsVisitor *ov = opts_visitor_new(opts);
- Visitor *v = opts_get_visitor(ov);
+ Visitor *v = opts_visitor_new(opts);
{
/* Parse convenience option format ip6-net=fec0::0[/64] */
@@ -1075,7 +1074,7 @@
}
error_propagate(errp, err);
- opts_visitor_cleanup(ov);
+ visit_free(v);
return ret;
}