1/* AUTOMATICALLY GENERATED, DO NOT MODIFY */
2
3/*
4 * Schema-defined QAPI visitors
5 *
6 * Copyright IBM, Corp. 2011
7 * Copyright (C) 2014-2018 Red Hat, Inc.
8 *
9 * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
10 * See the COPYING.LIB file in the top-level directory.
11 */
12
13#include "qemu/osdep.h"
14#include "qapi/error.h"
15#include "qapi/qmp/qerror.h"
16#include "qapi-visit-authz.h"
17
18void visit_type_QAuthZListPolicy(Visitor *v, const char *name, QAuthZListPolicy *obj, Error **errp)
19{
20 int value = *obj;
21 visit_type_enum(v, name, &value, &QAuthZListPolicy_lookup, errp);
22 *obj = value;
23}
24
25void visit_type_QAuthZListFormat(Visitor *v, const char *name, QAuthZListFormat *obj, Error **errp)
26{
27 int value = *obj;
28 visit_type_enum(v, name, &value, &QAuthZListFormat_lookup, errp);
29 *obj = value;
30}
31
32void visit_type_QAuthZListRule_members(Visitor *v, QAuthZListRule *obj, Error **errp)
33{
34 Error *err = NULL;
35
36 visit_type_str(v, "match", &obj->match, &err);
37 if (err) {
38 goto out;
39 }
40 visit_type_QAuthZListPolicy(v, "policy", &obj->policy, &err);
41 if (err) {
42 goto out;
43 }
44 if (visit_optional(v, "format", &obj->has_format)) {
45 visit_type_QAuthZListFormat(v, "format", &obj->format, &err);
46 if (err) {
47 goto out;
48 }
49 }
50
51out:
52 error_propagate(errp, err);
53}
54
55void visit_type_QAuthZListRule(Visitor *v, const char *name, QAuthZListRule **obj, Error **errp)
56{
57 Error *err = NULL;
58
59 visit_start_struct(v, name, (void **)obj, sizeof(QAuthZListRule), &err);
60 if (err) {
61 goto out;
62 }
63 if (!*obj) {
64 goto out_obj;
65 }
66 visit_type_QAuthZListRule_members(v, *obj, &err);
67 if (err) {
68 goto out_obj;
69 }
70 visit_check_struct(v, &err);
71out_obj:
72 visit_end_struct(v, (void **)obj);
73 if (err && visit_is_input(v)) {
74 qapi_free_QAuthZListRule(*obj);
75 *obj = NULL;
76 }
77out:
78 error_propagate(errp, err);
79}
80
81void visit_type_QAuthZListRuleList(Visitor *v, const char *name, QAuthZListRuleList **obj, Error **errp)
82{
83 Error *err = NULL;
84 QAuthZListRuleList *tail;
85 size_t size = sizeof(**obj);
86
87 visit_start_list(v, name, (GenericList **)obj, size, &err);
88 if (err) {
89 goto out;
90 }
91
92 for (tail = *obj; tail;
93 tail = (QAuthZListRuleList *)visit_next_list(v, (GenericList *)tail, size)) {
94 visit_type_QAuthZListRule(v, NULL, &tail->value, &err);
95 if (err) {
96 break;
97 }
98 }
99
100 if (!err) {
101 visit_check_list(v, &err);
102 }
103 visit_end_list(v, (void **)obj);
104 if (err && visit_is_input(v)) {
105 qapi_free_QAuthZListRuleList(*obj);
106 *obj = NULL;
107 }
108out:
109 error_propagate(errp, err);
110}
111
112void visit_type_QAuthZListRuleListHack_members(Visitor *v, QAuthZListRuleListHack *obj, Error **errp)
113{
114 Error *err = NULL;
115
116 visit_type_QAuthZListRuleList(v, "unused", &obj->unused, &err);
117 if (err) {
118 goto out;
119 }
120
121out:
122 error_propagate(errp, err);
123}
124
125void visit_type_QAuthZListRuleListHack(Visitor *v, const char *name, QAuthZListRuleListHack **obj, Error **errp)
126{
127 Error *err = NULL;
128
129 visit_start_struct(v, name, (void **)obj, sizeof(QAuthZListRuleListHack), &err);
130 if (err) {
131 goto out;
132 }
133 if (!*obj) {
134 goto out_obj;
135 }
136 visit_type_QAuthZListRuleListHack_members(v, *obj, &err);
137 if (err) {
138 goto out_obj;
139 }
140 visit_check_struct(v, &err);
141out_obj:
142 visit_end_struct(v, (void **)obj);
143 if (err && visit_is_input(v)) {
144 qapi_free_QAuthZListRuleListHack(*obj);
145 *obj = NULL;
146 }
147out:
148 error_propagate(errp, err);
149}
150
151/* Dummy declaration to prevent empty .o file */
152char qapi_dummy_qapi_visit_authz_c;
153