1 | /* AUTOMATICALLY GENERATED, DO NOT MODIFY */ |
2 | |
3 | /* |
4 | * Schema-defined QAPI/QMP commands |
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/visitor.h" |
15 | #include "qapi/qmp/qdict.h" |
16 | #include "qapi/qobject-output-visitor.h" |
17 | #include "qapi/qobject-input-visitor.h" |
18 | #include "qapi/dealloc-visitor.h" |
19 | #include "qapi/error.h" |
20 | #include "qapi-visit-machine-target.h" |
21 | #include "qapi-commands-machine-target.h" |
22 | |
23 | |
24 | #if defined(TARGET_S390X) |
25 | static void qmp_marshal_output_CpuModelCompareInfo(CpuModelCompareInfo *ret_in, QObject **ret_out, Error **errp) |
26 | { |
27 | Error *err = NULL; |
28 | Visitor *v; |
29 | |
30 | v = qobject_output_visitor_new(ret_out); |
31 | visit_type_CpuModelCompareInfo(v, "unused" , &ret_in, &err); |
32 | if (!err) { |
33 | visit_complete(v, ret_out); |
34 | } |
35 | error_propagate(errp, err); |
36 | visit_free(v); |
37 | v = qapi_dealloc_visitor_new(); |
38 | visit_type_CpuModelCompareInfo(v, "unused" , &ret_in, NULL); |
39 | visit_free(v); |
40 | } |
41 | #endif /* defined(TARGET_S390X) */ |
42 | |
43 | #if defined(TARGET_S390X) |
44 | void qmp_marshal_query_cpu_model_comparison(QDict *args, QObject **ret, Error **errp) |
45 | { |
46 | Error *err = NULL; |
47 | CpuModelCompareInfo *retval; |
48 | Visitor *v; |
49 | q_obj_query_cpu_model_comparison_arg arg = {0}; |
50 | |
51 | v = qobject_input_visitor_new(QOBJECT(args)); |
52 | visit_start_struct(v, NULL, NULL, 0, &err); |
53 | if (err) { |
54 | goto out; |
55 | } |
56 | visit_type_q_obj_query_cpu_model_comparison_arg_members(v, &arg, &err); |
57 | if (!err) { |
58 | visit_check_struct(v, &err); |
59 | } |
60 | visit_end_struct(v, NULL); |
61 | if (err) { |
62 | goto out; |
63 | } |
64 | |
65 | retval = qmp_query_cpu_model_comparison(arg.modela, arg.modelb, &err); |
66 | if (err) { |
67 | goto out; |
68 | } |
69 | |
70 | qmp_marshal_output_CpuModelCompareInfo(retval, ret, &err); |
71 | |
72 | out: |
73 | error_propagate(errp, err); |
74 | visit_free(v); |
75 | v = qapi_dealloc_visitor_new(); |
76 | visit_start_struct(v, NULL, NULL, 0, NULL); |
77 | visit_type_q_obj_query_cpu_model_comparison_arg_members(v, &arg, NULL); |
78 | visit_end_struct(v, NULL); |
79 | visit_free(v); |
80 | } |
81 | #endif /* defined(TARGET_S390X) */ |
82 | |
83 | #if defined(TARGET_S390X) |
84 | static void qmp_marshal_output_CpuModelBaselineInfo(CpuModelBaselineInfo *ret_in, QObject **ret_out, Error **errp) |
85 | { |
86 | Error *err = NULL; |
87 | Visitor *v; |
88 | |
89 | v = qobject_output_visitor_new(ret_out); |
90 | visit_type_CpuModelBaselineInfo(v, "unused" , &ret_in, &err); |
91 | if (!err) { |
92 | visit_complete(v, ret_out); |
93 | } |
94 | error_propagate(errp, err); |
95 | visit_free(v); |
96 | v = qapi_dealloc_visitor_new(); |
97 | visit_type_CpuModelBaselineInfo(v, "unused" , &ret_in, NULL); |
98 | visit_free(v); |
99 | } |
100 | #endif /* defined(TARGET_S390X) */ |
101 | |
102 | #if defined(TARGET_S390X) |
103 | void qmp_marshal_query_cpu_model_baseline(QDict *args, QObject **ret, Error **errp) |
104 | { |
105 | Error *err = NULL; |
106 | CpuModelBaselineInfo *retval; |
107 | Visitor *v; |
108 | q_obj_query_cpu_model_baseline_arg arg = {0}; |
109 | |
110 | v = qobject_input_visitor_new(QOBJECT(args)); |
111 | visit_start_struct(v, NULL, NULL, 0, &err); |
112 | if (err) { |
113 | goto out; |
114 | } |
115 | visit_type_q_obj_query_cpu_model_baseline_arg_members(v, &arg, &err); |
116 | if (!err) { |
117 | visit_check_struct(v, &err); |
118 | } |
119 | visit_end_struct(v, NULL); |
120 | if (err) { |
121 | goto out; |
122 | } |
123 | |
124 | retval = qmp_query_cpu_model_baseline(arg.modela, arg.modelb, &err); |
125 | if (err) { |
126 | goto out; |
127 | } |
128 | |
129 | qmp_marshal_output_CpuModelBaselineInfo(retval, ret, &err); |
130 | |
131 | out: |
132 | error_propagate(errp, err); |
133 | visit_free(v); |
134 | v = qapi_dealloc_visitor_new(); |
135 | visit_start_struct(v, NULL, NULL, 0, NULL); |
136 | visit_type_q_obj_query_cpu_model_baseline_arg_members(v, &arg, NULL); |
137 | visit_end_struct(v, NULL); |
138 | visit_free(v); |
139 | } |
140 | #endif /* defined(TARGET_S390X) */ |
141 | |
142 | #if defined(TARGET_S390X) || defined(TARGET_I386) |
143 | static void qmp_marshal_output_CpuModelExpansionInfo(CpuModelExpansionInfo *ret_in, QObject **ret_out, Error **errp) |
144 | { |
145 | Error *err = NULL; |
146 | Visitor *v; |
147 | |
148 | v = qobject_output_visitor_new(ret_out); |
149 | visit_type_CpuModelExpansionInfo(v, "unused" , &ret_in, &err); |
150 | if (!err) { |
151 | visit_complete(v, ret_out); |
152 | } |
153 | error_propagate(errp, err); |
154 | visit_free(v); |
155 | v = qapi_dealloc_visitor_new(); |
156 | visit_type_CpuModelExpansionInfo(v, "unused" , &ret_in, NULL); |
157 | visit_free(v); |
158 | } |
159 | #endif /* defined(TARGET_S390X) || defined(TARGET_I386) */ |
160 | |
161 | #if defined(TARGET_S390X) || defined(TARGET_I386) |
162 | void qmp_marshal_query_cpu_model_expansion(QDict *args, QObject **ret, Error **errp) |
163 | { |
164 | Error *err = NULL; |
165 | CpuModelExpansionInfo *retval; |
166 | Visitor *v; |
167 | q_obj_query_cpu_model_expansion_arg arg = {0}; |
168 | |
169 | v = qobject_input_visitor_new(QOBJECT(args)); |
170 | visit_start_struct(v, NULL, NULL, 0, &err); |
171 | if (err) { |
172 | goto out; |
173 | } |
174 | visit_type_q_obj_query_cpu_model_expansion_arg_members(v, &arg, &err); |
175 | if (!err) { |
176 | visit_check_struct(v, &err); |
177 | } |
178 | visit_end_struct(v, NULL); |
179 | if (err) { |
180 | goto out; |
181 | } |
182 | |
183 | retval = qmp_query_cpu_model_expansion(arg.type, arg.model, &err); |
184 | if (err) { |
185 | goto out; |
186 | } |
187 | |
188 | qmp_marshal_output_CpuModelExpansionInfo(retval, ret, &err); |
189 | |
190 | out: |
191 | error_propagate(errp, err); |
192 | visit_free(v); |
193 | v = qapi_dealloc_visitor_new(); |
194 | visit_start_struct(v, NULL, NULL, 0, NULL); |
195 | visit_type_q_obj_query_cpu_model_expansion_arg_members(v, &arg, NULL); |
196 | visit_end_struct(v, NULL); |
197 | visit_free(v); |
198 | } |
199 | #endif /* defined(TARGET_S390X) || defined(TARGET_I386) */ |
200 | |
201 | #if defined(TARGET_PPC) || defined(TARGET_ARM) || defined(TARGET_I386) || defined(TARGET_S390X) || defined(TARGET_MIPS) |
202 | static void qmp_marshal_output_CpuDefinitionInfoList(CpuDefinitionInfoList *ret_in, QObject **ret_out, Error **errp) |
203 | { |
204 | Error *err = NULL; |
205 | Visitor *v; |
206 | |
207 | v = qobject_output_visitor_new(ret_out); |
208 | visit_type_CpuDefinitionInfoList(v, "unused" , &ret_in, &err); |
209 | if (!err) { |
210 | visit_complete(v, ret_out); |
211 | } |
212 | error_propagate(errp, err); |
213 | visit_free(v); |
214 | v = qapi_dealloc_visitor_new(); |
215 | visit_type_CpuDefinitionInfoList(v, "unused" , &ret_in, NULL); |
216 | visit_free(v); |
217 | } |
218 | #endif /* defined(TARGET_PPC) || defined(TARGET_ARM) || defined(TARGET_I386) || defined(TARGET_S390X) || defined(TARGET_MIPS) */ |
219 | |
220 | #if defined(TARGET_PPC) || defined(TARGET_ARM) || defined(TARGET_I386) || defined(TARGET_S390X) || defined(TARGET_MIPS) |
221 | void qmp_marshal_query_cpu_definitions(QDict *args, QObject **ret, Error **errp) |
222 | { |
223 | Error *err = NULL; |
224 | CpuDefinitionInfoList *retval; |
225 | Visitor *v = NULL; |
226 | |
227 | if (args) { |
228 | v = qobject_input_visitor_new(QOBJECT(args)); |
229 | visit_start_struct(v, NULL, NULL, 0, &err); |
230 | if (err) { |
231 | goto out; |
232 | } |
233 | |
234 | if (!err) { |
235 | visit_check_struct(v, &err); |
236 | } |
237 | visit_end_struct(v, NULL); |
238 | if (err) { |
239 | goto out; |
240 | } |
241 | } |
242 | |
243 | retval = qmp_query_cpu_definitions(&err); |
244 | if (err) { |
245 | goto out; |
246 | } |
247 | |
248 | qmp_marshal_output_CpuDefinitionInfoList(retval, ret, &err); |
249 | |
250 | out: |
251 | error_propagate(errp, err); |
252 | visit_free(v); |
253 | if (args) { |
254 | v = qapi_dealloc_visitor_new(); |
255 | visit_start_struct(v, NULL, NULL, 0, NULL); |
256 | |
257 | visit_end_struct(v, NULL); |
258 | visit_free(v); |
259 | } |
260 | } |
261 | #endif /* defined(TARGET_PPC) || defined(TARGET_ARM) || defined(TARGET_I386) || defined(TARGET_S390X) || defined(TARGET_MIPS) */ |
262 | |
263 | /* Dummy declaration to prevent empty .o file */ |
264 | char qapi_dummy_qapi_commands_machine_target_c; |
265 | |