mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 02:24:58 -06:00
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>
This commit is contained in:
parent
2c0ef9f411
commit
09204eac9b
9 changed files with 42 additions and 62 deletions
|
@ -156,15 +156,15 @@ out:
|
|||
|
||||
Object *user_creatable_add_opts(QemuOpts *opts, Error **errp)
|
||||
{
|
||||
OptsVisitor *ov;
|
||||
Visitor *v;
|
||||
QDict *pdict;
|
||||
Object *obj = NULL;
|
||||
|
||||
ov = opts_visitor_new(opts);
|
||||
v = opts_visitor_new(opts);
|
||||
pdict = qemu_opts_to_qdict(opts, NULL);
|
||||
|
||||
obj = user_creatable_add(pdict, opts_get_visitor(ov), errp);
|
||||
opts_visitor_cleanup(ov);
|
||||
obj = user_creatable_add(pdict, v, errp);
|
||||
visit_free(v);
|
||||
QDECREF(pdict);
|
||||
return obj;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue