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-job.h"
21#include "qapi-commands-job.h"
22
23
24void qmp_marshal_job_pause(QDict *args, QObject **ret, Error **errp)
25{
26 Error *err = NULL;
27 Visitor *v;
28 q_obj_job_pause_arg arg = {0};
29
30 v = qobject_input_visitor_new(QOBJECT(args));
31 visit_start_struct(v, NULL, NULL, 0, &err);
32 if (err) {
33 goto out;
34 }
35 visit_type_q_obj_job_pause_arg_members(v, &arg, &err);
36 if (!err) {
37 visit_check_struct(v, &err);
38 }
39 visit_end_struct(v, NULL);
40 if (err) {
41 goto out;
42 }
43
44 qmp_job_pause(arg.id, &err);
45
46out:
47 error_propagate(errp, err);
48 visit_free(v);
49 v = qapi_dealloc_visitor_new();
50 visit_start_struct(v, NULL, NULL, 0, NULL);
51 visit_type_q_obj_job_pause_arg_members(v, &arg, NULL);
52 visit_end_struct(v, NULL);
53 visit_free(v);
54}
55
56void qmp_marshal_job_resume(QDict *args, QObject **ret, Error **errp)
57{
58 Error *err = NULL;
59 Visitor *v;
60 q_obj_job_resume_arg arg = {0};
61
62 v = qobject_input_visitor_new(QOBJECT(args));
63 visit_start_struct(v, NULL, NULL, 0, &err);
64 if (err) {
65 goto out;
66 }
67 visit_type_q_obj_job_resume_arg_members(v, &arg, &err);
68 if (!err) {
69 visit_check_struct(v, &err);
70 }
71 visit_end_struct(v, NULL);
72 if (err) {
73 goto out;
74 }
75
76 qmp_job_resume(arg.id, &err);
77
78out:
79 error_propagate(errp, err);
80 visit_free(v);
81 v = qapi_dealloc_visitor_new();
82 visit_start_struct(v, NULL, NULL, 0, NULL);
83 visit_type_q_obj_job_resume_arg_members(v, &arg, NULL);
84 visit_end_struct(v, NULL);
85 visit_free(v);
86}
87
88void qmp_marshal_job_cancel(QDict *args, QObject **ret, Error **errp)
89{
90 Error *err = NULL;
91 Visitor *v;
92 q_obj_job_cancel_arg arg = {0};
93
94 v = qobject_input_visitor_new(QOBJECT(args));
95 visit_start_struct(v, NULL, NULL, 0, &err);
96 if (err) {
97 goto out;
98 }
99 visit_type_q_obj_job_cancel_arg_members(v, &arg, &err);
100 if (!err) {
101 visit_check_struct(v, &err);
102 }
103 visit_end_struct(v, NULL);
104 if (err) {
105 goto out;
106 }
107
108 qmp_job_cancel(arg.id, &err);
109
110out:
111 error_propagate(errp, err);
112 visit_free(v);
113 v = qapi_dealloc_visitor_new();
114 visit_start_struct(v, NULL, NULL, 0, NULL);
115 visit_type_q_obj_job_cancel_arg_members(v, &arg, NULL);
116 visit_end_struct(v, NULL);
117 visit_free(v);
118}
119
120void qmp_marshal_job_complete(QDict *args, QObject **ret, Error **errp)
121{
122 Error *err = NULL;
123 Visitor *v;
124 q_obj_job_complete_arg arg = {0};
125
126 v = qobject_input_visitor_new(QOBJECT(args));
127 visit_start_struct(v, NULL, NULL, 0, &err);
128 if (err) {
129 goto out;
130 }
131 visit_type_q_obj_job_complete_arg_members(v, &arg, &err);
132 if (!err) {
133 visit_check_struct(v, &err);
134 }
135 visit_end_struct(v, NULL);
136 if (err) {
137 goto out;
138 }
139
140 qmp_job_complete(arg.id, &err);
141
142out:
143 error_propagate(errp, err);
144 visit_free(v);
145 v = qapi_dealloc_visitor_new();
146 visit_start_struct(v, NULL, NULL, 0, NULL);
147 visit_type_q_obj_job_complete_arg_members(v, &arg, NULL);
148 visit_end_struct(v, NULL);
149 visit_free(v);
150}
151
152void qmp_marshal_job_dismiss(QDict *args, QObject **ret, Error **errp)
153{
154 Error *err = NULL;
155 Visitor *v;
156 q_obj_job_dismiss_arg arg = {0};
157
158 v = qobject_input_visitor_new(QOBJECT(args));
159 visit_start_struct(v, NULL, NULL, 0, &err);
160 if (err) {
161 goto out;
162 }
163 visit_type_q_obj_job_dismiss_arg_members(v, &arg, &err);
164 if (!err) {
165 visit_check_struct(v, &err);
166 }
167 visit_end_struct(v, NULL);
168 if (err) {
169 goto out;
170 }
171
172 qmp_job_dismiss(arg.id, &err);
173
174out:
175 error_propagate(errp, err);
176 visit_free(v);
177 v = qapi_dealloc_visitor_new();
178 visit_start_struct(v, NULL, NULL, 0, NULL);
179 visit_type_q_obj_job_dismiss_arg_members(v, &arg, NULL);
180 visit_end_struct(v, NULL);
181 visit_free(v);
182}
183
184void qmp_marshal_job_finalize(QDict *args, QObject **ret, Error **errp)
185{
186 Error *err = NULL;
187 Visitor *v;
188 q_obj_job_finalize_arg arg = {0};
189
190 v = qobject_input_visitor_new(QOBJECT(args));
191 visit_start_struct(v, NULL, NULL, 0, &err);
192 if (err) {
193 goto out;
194 }
195 visit_type_q_obj_job_finalize_arg_members(v, &arg, &err);
196 if (!err) {
197 visit_check_struct(v, &err);
198 }
199 visit_end_struct(v, NULL);
200 if (err) {
201 goto out;
202 }
203
204 qmp_job_finalize(arg.id, &err);
205
206out:
207 error_propagate(errp, err);
208 visit_free(v);
209 v = qapi_dealloc_visitor_new();
210 visit_start_struct(v, NULL, NULL, 0, NULL);
211 visit_type_q_obj_job_finalize_arg_members(v, &arg, NULL);
212 visit_end_struct(v, NULL);
213 visit_free(v);
214}
215
216static void qmp_marshal_output_JobInfoList(JobInfoList *ret_in, QObject **ret_out, Error **errp)
217{
218 Error *err = NULL;
219 Visitor *v;
220
221 v = qobject_output_visitor_new(ret_out);
222 visit_type_JobInfoList(v, "unused", &ret_in, &err);
223 if (!err) {
224 visit_complete(v, ret_out);
225 }
226 error_propagate(errp, err);
227 visit_free(v);
228 v = qapi_dealloc_visitor_new();
229 visit_type_JobInfoList(v, "unused", &ret_in, NULL);
230 visit_free(v);
231}
232
233void qmp_marshal_query_jobs(QDict *args, QObject **ret, Error **errp)
234{
235 Error *err = NULL;
236 JobInfoList *retval;
237 Visitor *v = NULL;
238
239 if (args) {
240 v = qobject_input_visitor_new(QOBJECT(args));
241 visit_start_struct(v, NULL, NULL, 0, &err);
242 if (err) {
243 goto out;
244 }
245
246 if (!err) {
247 visit_check_struct(v, &err);
248 }
249 visit_end_struct(v, NULL);
250 if (err) {
251 goto out;
252 }
253 }
254
255 retval = qmp_query_jobs(&err);
256 if (err) {
257 goto out;
258 }
259
260 qmp_marshal_output_JobInfoList(retval, ret, &err);
261
262out:
263 error_propagate(errp, err);
264 visit_free(v);
265 if (args) {
266 v = qapi_dealloc_visitor_new();
267 visit_start_struct(v, NULL, NULL, 0, NULL);
268
269 visit_end_struct(v, NULL);
270 visit_free(v);
271 }
272}
273
274/* Dummy declaration to prevent empty .o file */
275char qapi_dummy_qapi_commands_job_c;
276