mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-08 10:13:56 -06:00
qapi-dealloc: Reduce use outside of generated code
No need to roll our own use of the dealloc visitors when we can just directly use the qapi_free_FOO() functions that do what we want in one line. In net.c, inline net_visit() into its remaining lone caller. After this patch, test-visitor-serialization.c is the only non-generated file that needs to use a dealloc visitor, because it is testing low level aspects of the visitor interface. Signed-off-by: Eric Blake <eblake@redhat.com> Message-Id: <1456262075-3311-2-git-send-email-eblake@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com>
This commit is contained in:
parent
e55250c6cb
commit
96a1616c85
4 changed files with 13 additions and 48 deletions
|
@ -17,7 +17,6 @@
|
|||
#include "qemu/option.h" /* qemu_opts_parse() */
|
||||
#include "qapi/opts-visitor.h" /* opts_visitor_new() */
|
||||
#include "test-qapi-visit.h" /* visit_type_UserDefOptions() */
|
||||
#include "qapi/dealloc-visitor.h" /* qapi_dealloc_visitor_new() */
|
||||
|
||||
static QemuOptsList userdef_opts = {
|
||||
.name = "userdef",
|
||||
|
@ -55,14 +54,7 @@ setup_fixture(OptsVisitorFixture *f, gconstpointer test_data)
|
|||
static void
|
||||
teardown_fixture(OptsVisitorFixture *f, gconstpointer test_data)
|
||||
{
|
||||
if (f->userdef != NULL) {
|
||||
QapiDeallocVisitor *dv;
|
||||
|
||||
dv = qapi_dealloc_visitor_new();
|
||||
visit_type_UserDefOptions(qapi_dealloc_get_visitor(dv), NULL,
|
||||
&f->userdef, NULL);
|
||||
qapi_dealloc_visitor_cleanup(dv);
|
||||
}
|
||||
qapi_free_UserDefOptions(f->userdef);
|
||||
error_free(f->err);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue