1 | |
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9 | |
10 | |
11 | |
12 | |
13 | |
14 | |
15 | |
16 | #include "qemu-objects.h" |
17 | #include "qapi/qmp-core.h" |
18 | #include "qapi/qapi-visit-core.h" |
19 | #include "qapi/qmp-output-visitor.h" |
20 | #include "qapi/qmp-input-visitor.h" |
21 | #include "qapi/qapi-dealloc-visitor.h" |
22 | #include "qga-qapi-types.h" |
23 | #include "qga-qapi-visit.h" |
24 | |
25 | #include "qga-qmp-commands.h" |
26 | |
27 | static void qmp_marshal_output_guest_sync_delimited(int64_t ret_in, QObject **ret_out, Error **errp) |
28 | { |
29 | QapiDeallocVisitor *md = qapi_dealloc_visitor_new(); |
30 | QmpOutputVisitor *mo = qmp_output_visitor_new(); |
31 | Visitor *v; |
32 | |
33 | v = qmp_output_get_visitor(mo); |
34 | visit_type_int(v, &ret_in, "unused", errp); |
35 | if (!error_is_set(errp)) { |
36 | *ret_out = qmp_output_get_qobject(mo); |
37 | } |
38 | qmp_output_visitor_cleanup(mo); |
39 | v = qapi_dealloc_get_visitor(md); |
40 | visit_type_int(v, &ret_in, "unused", errp); |
41 | qapi_dealloc_visitor_cleanup(md); |
42 | } |
43 | |
44 | static void qmp_marshal_input_guest_sync_delimited(QDict *args, QObject **ret, Error **errp) |
45 | { |
46 | int64_t retval; |
47 | QmpInputVisitor *mi; |
48 | QapiDeallocVisitor *md; |
49 | Visitor *v; |
50 | int64_t id; |
51 | |
52 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
53 | v = qmp_input_get_visitor(mi); |
54 | visit_type_int(v, &id, "id", errp); |
55 | qmp_input_visitor_cleanup(mi); |
56 | |
57 | if (error_is_set(errp)) { |
58 | goto out; |
59 | } |
60 | retval = qmp_guest_sync_delimited(id, errp); |
61 | if (!error_is_set(errp)) { |
62 | qmp_marshal_output_guest_sync_delimited(retval, ret, errp); |
63 | } |
64 | |
65 | out: |
66 | md = qapi_dealloc_visitor_new(); |
67 | v = qapi_dealloc_get_visitor(md); |
68 | visit_type_int(v, &id, "id", errp); |
69 | qapi_dealloc_visitor_cleanup(md); |
70 | return; |
71 | } |
72 | |
73 | static void qmp_marshal_output_guest_sync(int64_t ret_in, QObject **ret_out, Error **errp) |
74 | { |
75 | QapiDeallocVisitor *md = qapi_dealloc_visitor_new(); |
76 | QmpOutputVisitor *mo = qmp_output_visitor_new(); |
77 | Visitor *v; |
78 | |
79 | v = qmp_output_get_visitor(mo); |
80 | visit_type_int(v, &ret_in, "unused", errp); |
81 | if (!error_is_set(errp)) { |
82 | *ret_out = qmp_output_get_qobject(mo); |
83 | } |
84 | qmp_output_visitor_cleanup(mo); |
85 | v = qapi_dealloc_get_visitor(md); |
86 | visit_type_int(v, &ret_in, "unused", errp); |
87 | qapi_dealloc_visitor_cleanup(md); |
88 | } |
89 | |
90 | static void qmp_marshal_input_guest_sync(QDict *args, QObject **ret, Error **errp) |
91 | { |
92 | int64_t retval; |
93 | QmpInputVisitor *mi; |
94 | QapiDeallocVisitor *md; |
95 | Visitor *v; |
96 | int64_t id; |
97 | |
98 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
99 | v = qmp_input_get_visitor(mi); |
100 | visit_type_int(v, &id, "id", errp); |
101 | qmp_input_visitor_cleanup(mi); |
102 | |
103 | if (error_is_set(errp)) { |
104 | goto out; |
105 | } |
106 | retval = qmp_guest_sync(id, errp); |
107 | if (!error_is_set(errp)) { |
108 | qmp_marshal_output_guest_sync(retval, ret, errp); |
109 | } |
110 | |
111 | out: |
112 | md = qapi_dealloc_visitor_new(); |
113 | v = qapi_dealloc_get_visitor(md); |
114 | visit_type_int(v, &id, "id", errp); |
115 | qapi_dealloc_visitor_cleanup(md); |
116 | return; |
117 | } |
118 | |
119 | static void qmp_marshal_input_guest_ping(QDict *args, QObject **ret, Error **errp) |
120 | { |
121 | (void)args; |
122 | if (error_is_set(errp)) { |
123 | goto out; |
124 | } |
125 | qmp_guest_ping(errp); |
126 | |
127 | out: |
128 | |
129 | return; |
130 | } |
131 | |
132 | static void qmp_marshal_output_guest_info(GuestAgentInfo * ret_in, QObject **ret_out, Error **errp) |
133 | { |
134 | QapiDeallocVisitor *md = qapi_dealloc_visitor_new(); |
135 | QmpOutputVisitor *mo = qmp_output_visitor_new(); |
136 | Visitor *v; |
137 | |
138 | v = qmp_output_get_visitor(mo); |
139 | visit_type_GuestAgentInfo(v, &ret_in, "unused", errp); |
140 | if (!error_is_set(errp)) { |
141 | *ret_out = qmp_output_get_qobject(mo); |
142 | } |
143 | qmp_output_visitor_cleanup(mo); |
144 | v = qapi_dealloc_get_visitor(md); |
145 | visit_type_GuestAgentInfo(v, &ret_in, "unused", errp); |
146 | qapi_dealloc_visitor_cleanup(md); |
147 | } |
148 | |
149 | static void qmp_marshal_input_guest_info(QDict *args, QObject **ret, Error **errp) |
150 | { |
151 | GuestAgentInfo * retval = NULL((void*)0); |
152 | (void)args; |
153 | if (error_is_set(errp)) { |
154 | goto out; |
155 | } |
156 | retval = qmp_guest_info(errp); |
157 | if (!error_is_set(errp)) { |
158 | qmp_marshal_output_guest_info(retval, ret, errp); |
159 | } |
160 | |
161 | out: |
162 | |
163 | return; |
164 | } |
165 | |
166 | static void qmp_marshal_input_guest_shutdown(QDict *args, QObject **ret, Error **errp) |
167 | { |
168 | QmpInputVisitor *mi; |
169 | QapiDeallocVisitor *md; |
170 | Visitor *v; |
171 | bool_Bool has_mode = false0; |
172 | char * mode = NULL((void*)0); |
173 | |
174 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
175 | v = qmp_input_get_visitor(mi); |
176 | visit_start_optional(v, &has_mode, "mode", errp); |
177 | if (has_mode) { |
178 | visit_type_str(v, &mode, "mode", errp); |
179 | } |
180 | visit_end_optional(v, errp); |
181 | qmp_input_visitor_cleanup(mi); |
182 | |
183 | if (error_is_set(errp)) { |
184 | goto out; |
185 | } |
186 | qmp_guest_shutdown(has_mode, mode, errp); |
187 | |
188 | out: |
189 | md = qapi_dealloc_visitor_new(); |
190 | v = qapi_dealloc_get_visitor(md); |
191 | visit_start_optional(v, &has_mode, "mode", errp); |
192 | if (has_mode) { |
193 | visit_type_str(v, &mode, "mode", errp); |
194 | } |
195 | visit_end_optional(v, errp); |
196 | qapi_dealloc_visitor_cleanup(md); |
197 | return; |
198 | } |
199 | |
200 | static void qmp_marshal_output_guest_file_open(int64_t ret_in, QObject **ret_out, Error **errp) |
201 | { |
202 | QapiDeallocVisitor *md = qapi_dealloc_visitor_new(); |
203 | QmpOutputVisitor *mo = qmp_output_visitor_new(); |
204 | Visitor *v; |
205 | |
206 | v = qmp_output_get_visitor(mo); |
207 | visit_type_int(v, &ret_in, "unused", errp); |
208 | if (!error_is_set(errp)) { |
209 | *ret_out = qmp_output_get_qobject(mo); |
210 | } |
211 | qmp_output_visitor_cleanup(mo); |
212 | v = qapi_dealloc_get_visitor(md); |
213 | visit_type_int(v, &ret_in, "unused", errp); |
214 | qapi_dealloc_visitor_cleanup(md); |
215 | } |
216 | |
217 | static void qmp_marshal_input_guest_file_open(QDict *args, QObject **ret, Error **errp) |
218 | { |
219 | int64_t retval; |
220 | QmpInputVisitor *mi; |
221 | QapiDeallocVisitor *md; |
222 | Visitor *v; |
223 | char * path = NULL((void*)0); |
224 | bool_Bool has_mode = false0; |
225 | char * mode = NULL((void*)0); |
226 | |
227 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
228 | v = qmp_input_get_visitor(mi); |
229 | visit_type_str(v, &path, "path", errp); |
230 | visit_start_optional(v, &has_mode, "mode", errp); |
231 | if (has_mode) { |
232 | visit_type_str(v, &mode, "mode", errp); |
233 | } |
234 | visit_end_optional(v, errp); |
235 | qmp_input_visitor_cleanup(mi); |
236 | |
237 | if (error_is_set(errp)) { |
238 | goto out; |
239 | } |
240 | retval = qmp_guest_file_open(path, has_mode, mode, errp); |
241 | if (!error_is_set(errp)) { |
242 | qmp_marshal_output_guest_file_open(retval, ret, errp); |
243 | } |
244 | |
245 | out: |
246 | md = qapi_dealloc_visitor_new(); |
247 | v = qapi_dealloc_get_visitor(md); |
248 | visit_type_str(v, &path, "path", errp); |
249 | visit_start_optional(v, &has_mode, "mode", errp); |
250 | if (has_mode) { |
251 | visit_type_str(v, &mode, "mode", errp); |
252 | } |
253 | visit_end_optional(v, errp); |
254 | qapi_dealloc_visitor_cleanup(md); |
255 | return; |
256 | } |
257 | |
258 | static void qmp_marshal_input_guest_file_close(QDict *args, QObject **ret, Error **errp) |
259 | { |
260 | QmpInputVisitor *mi; |
261 | QapiDeallocVisitor *md; |
262 | Visitor *v; |
263 | int64_t handle; |
264 | |
265 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
266 | v = qmp_input_get_visitor(mi); |
267 | visit_type_int(v, &handle, "handle", errp); |
268 | qmp_input_visitor_cleanup(mi); |
269 | |
270 | if (error_is_set(errp)) { |
271 | goto out; |
272 | } |
273 | qmp_guest_file_close(handle, errp); |
274 | |
275 | out: |
276 | md = qapi_dealloc_visitor_new(); |
277 | v = qapi_dealloc_get_visitor(md); |
278 | visit_type_int(v, &handle, "handle", errp); |
279 | qapi_dealloc_visitor_cleanup(md); |
280 | return; |
281 | } |
282 | |
283 | static void qmp_marshal_output_guest_file_read(GuestFileRead * ret_in, QObject **ret_out, Error **errp) |
284 | { |
285 | QapiDeallocVisitor *md = qapi_dealloc_visitor_new(); |
286 | QmpOutputVisitor *mo = qmp_output_visitor_new(); |
287 | Visitor *v; |
288 | |
289 | v = qmp_output_get_visitor(mo); |
290 | visit_type_GuestFileRead(v, &ret_in, "unused", errp); |
291 | if (!error_is_set(errp)) { |
292 | *ret_out = qmp_output_get_qobject(mo); |
293 | } |
294 | qmp_output_visitor_cleanup(mo); |
295 | v = qapi_dealloc_get_visitor(md); |
296 | visit_type_GuestFileRead(v, &ret_in, "unused", errp); |
297 | qapi_dealloc_visitor_cleanup(md); |
298 | } |
299 | |
300 | static void qmp_marshal_input_guest_file_read(QDict *args, QObject **ret, Error **errp) |
301 | { |
302 | GuestFileRead * retval = NULL((void*)0); |
303 | QmpInputVisitor *mi; |
304 | QapiDeallocVisitor *md; |
305 | Visitor *v; |
306 | int64_t handle; |
307 | bool_Bool has_count = false0; |
308 | int64_t count; |
309 | |
310 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
311 | v = qmp_input_get_visitor(mi); |
312 | visit_type_int(v, &handle, "handle", errp); |
313 | visit_start_optional(v, &has_count, "count", errp); |
314 | if (has_count) { |
315 | visit_type_int(v, &count, "count", errp); |
316 | } |
317 | visit_end_optional(v, errp); |
318 | qmp_input_visitor_cleanup(mi); |
319 | |
320 | if (error_is_set(errp)) { |
321 | goto out; |
322 | } |
323 | retval = qmp_guest_file_read(handle, has_count, count, errp); |
324 | if (!error_is_set(errp)) { |
325 | qmp_marshal_output_guest_file_read(retval, ret, errp); |
326 | } |
327 | |
328 | out: |
329 | md = qapi_dealloc_visitor_new(); |
330 | v = qapi_dealloc_get_visitor(md); |
331 | visit_type_int(v, &handle, "handle", errp); |
332 | visit_start_optional(v, &has_count, "count", errp); |
333 | if (has_count) { |
334 | visit_type_int(v, &count, "count", errp); |
335 | } |
336 | visit_end_optional(v, errp); |
337 | qapi_dealloc_visitor_cleanup(md); |
338 | return; |
339 | } |
340 | |
341 | static void qmp_marshal_output_guest_file_write(GuestFileWrite * ret_in, QObject **ret_out, Error **errp) |
342 | { |
343 | QapiDeallocVisitor *md = qapi_dealloc_visitor_new(); |
344 | QmpOutputVisitor *mo = qmp_output_visitor_new(); |
345 | Visitor *v; |
346 | |
347 | v = qmp_output_get_visitor(mo); |
348 | visit_type_GuestFileWrite(v, &ret_in, "unused", errp); |
349 | if (!error_is_set(errp)) { |
350 | *ret_out = qmp_output_get_qobject(mo); |
351 | } |
352 | qmp_output_visitor_cleanup(mo); |
353 | v = qapi_dealloc_get_visitor(md); |
354 | visit_type_GuestFileWrite(v, &ret_in, "unused", errp); |
355 | qapi_dealloc_visitor_cleanup(md); |
356 | } |
357 | |
358 | static void qmp_marshal_input_guest_file_write(QDict *args, QObject **ret, Error **errp) |
359 | { |
360 | GuestFileWrite * retval = NULL((void*)0); |
361 | QmpInputVisitor *mi; |
362 | QapiDeallocVisitor *md; |
363 | Visitor *v; |
364 | int64_t handle; |
365 | char * buf_b64 = NULL((void*)0); |
366 | bool_Bool has_count = false0; |
367 | int64_t count; |
368 | |
369 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
370 | v = qmp_input_get_visitor(mi); |
371 | visit_type_int(v, &handle, "handle", errp); |
372 | visit_type_str(v, &buf_b64, "buf-b64", errp); |
373 | visit_start_optional(v, &has_count, "count", errp); |
374 | if (has_count) { |
375 | visit_type_int(v, &count, "count", errp); |
376 | } |
377 | visit_end_optional(v, errp); |
378 | qmp_input_visitor_cleanup(mi); |
379 | |
380 | if (error_is_set(errp)) { |
381 | goto out; |
382 | } |
383 | retval = qmp_guest_file_write(handle, buf_b64, has_count, count, errp); |
384 | if (!error_is_set(errp)) { |
385 | qmp_marshal_output_guest_file_write(retval, ret, errp); |
386 | } |
387 | |
388 | out: |
389 | md = qapi_dealloc_visitor_new(); |
390 | v = qapi_dealloc_get_visitor(md); |
391 | visit_type_int(v, &handle, "handle", errp); |
392 | visit_type_str(v, &buf_b64, "buf-b64", errp); |
393 | visit_start_optional(v, &has_count, "count", errp); |
394 | if (has_count) { |
395 | visit_type_int(v, &count, "count", errp); |
396 | } |
397 | visit_end_optional(v, errp); |
398 | qapi_dealloc_visitor_cleanup(md); |
399 | return; |
400 | } |
401 | |
402 | static void qmp_marshal_output_guest_file_seek(GuestFileSeek * ret_in, QObject **ret_out, Error **errp) |
403 | { |
404 | QapiDeallocVisitor *md = qapi_dealloc_visitor_new(); |
405 | QmpOutputVisitor *mo = qmp_output_visitor_new(); |
406 | Visitor *v; |
407 | |
408 | v = qmp_output_get_visitor(mo); |
409 | visit_type_GuestFileSeek(v, &ret_in, "unused", errp); |
410 | if (!error_is_set(errp)) { |
411 | *ret_out = qmp_output_get_qobject(mo); |
412 | } |
413 | qmp_output_visitor_cleanup(mo); |
414 | v = qapi_dealloc_get_visitor(md); |
415 | visit_type_GuestFileSeek(v, &ret_in, "unused", errp); |
416 | qapi_dealloc_visitor_cleanup(md); |
417 | } |
418 | |
419 | static void qmp_marshal_input_guest_file_seek(QDict *args, QObject **ret, Error **errp) |
420 | { |
421 | GuestFileSeek * retval = NULL((void*)0); |
422 | QmpInputVisitor *mi; |
423 | QapiDeallocVisitor *md; |
424 | Visitor *v; |
425 | int64_t handle; |
426 | int64_t offset; |
427 | int64_t whence; |
428 | |
429 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
430 | v = qmp_input_get_visitor(mi); |
431 | visit_type_int(v, &handle, "handle", errp); |
432 | visit_type_int(v, &offset, "offset", errp); |
433 | visit_type_int(v, &whence, "whence", errp); |
434 | qmp_input_visitor_cleanup(mi); |
435 | |
436 | if (error_is_set(errp)) { |
437 | goto out; |
438 | } |
439 | retval = qmp_guest_file_seek(handle, offset, whence, errp); |
440 | if (!error_is_set(errp)) { |
441 | qmp_marshal_output_guest_file_seek(retval, ret, errp); |
442 | } |
443 | |
444 | out: |
445 | md = qapi_dealloc_visitor_new(); |
446 | v = qapi_dealloc_get_visitor(md); |
447 | visit_type_int(v, &handle, "handle", errp); |
448 | visit_type_int(v, &offset, "offset", errp); |
449 | visit_type_int(v, &whence, "whence", errp); |
450 | qapi_dealloc_visitor_cleanup(md); |
451 | return; |
452 | } |
453 | |
454 | static void qmp_marshal_input_guest_file_flush(QDict *args, QObject **ret, Error **errp) |
455 | { |
456 | QmpInputVisitor *mi; |
457 | QapiDeallocVisitor *md; |
458 | Visitor *v; |
459 | int64_t handle; |
460 | |
461 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
462 | v = qmp_input_get_visitor(mi); |
463 | visit_type_int(v, &handle, "handle", errp); |
464 | qmp_input_visitor_cleanup(mi); |
465 | |
466 | if (error_is_set(errp)) { |
467 | goto out; |
468 | } |
469 | qmp_guest_file_flush(handle, errp); |
470 | |
471 | out: |
472 | md = qapi_dealloc_visitor_new(); |
473 | v = qapi_dealloc_get_visitor(md); |
474 | visit_type_int(v, &handle, "handle", errp); |
475 | qapi_dealloc_visitor_cleanup(md); |
476 | return; |
477 | } |
478 | |
479 | static void qmp_marshal_output_guest_fsfreeze_status(GuestFsfreezeStatus ret_in, QObject **ret_out, Error **errp) |
480 | { |
481 | QapiDeallocVisitor *md = qapi_dealloc_visitor_new(); |
482 | QmpOutputVisitor *mo = qmp_output_visitor_new(); |
483 | Visitor *v; |
484 | |
485 | v = qmp_output_get_visitor(mo); |
486 | visit_type_GuestFsfreezeStatus(v, &ret_in, "unused", errp); |
487 | if (!error_is_set(errp)) { |
488 | *ret_out = qmp_output_get_qobject(mo); |
489 | } |
490 | qmp_output_visitor_cleanup(mo); |
491 | v = qapi_dealloc_get_visitor(md); |
492 | visit_type_GuestFsfreezeStatus(v, &ret_in, "unused", errp); |
493 | qapi_dealloc_visitor_cleanup(md); |
494 | } |
495 | |
496 | static void qmp_marshal_input_guest_fsfreeze_status(QDict *args, QObject **ret, Error **errp) |
497 | { |
498 | GuestFsfreezeStatus retval; |
499 | (void)args; |
500 | if (error_is_set(errp)) { |
501 | goto out; |
502 | } |
503 | retval = qmp_guest_fsfreeze_status(errp); |
504 | if (!error_is_set(errp)) { |
505 | qmp_marshal_output_guest_fsfreeze_status(retval, ret, errp); |
506 | } |
507 | |
508 | out: |
509 | |
510 | return; |
511 | } |
512 | |
513 | static void qmp_marshal_output_guest_fsfreeze_freeze(int64_t ret_in, QObject **ret_out, Error **errp) |
514 | { |
515 | QapiDeallocVisitor *md = qapi_dealloc_visitor_new(); |
516 | QmpOutputVisitor *mo = qmp_output_visitor_new(); |
517 | Visitor *v; |
518 | |
519 | v = qmp_output_get_visitor(mo); |
520 | visit_type_int(v, &ret_in, "unused", errp); |
521 | if (!error_is_set(errp)) { |
522 | *ret_out = qmp_output_get_qobject(mo); |
523 | } |
524 | qmp_output_visitor_cleanup(mo); |
525 | v = qapi_dealloc_get_visitor(md); |
526 | visit_type_int(v, &ret_in, "unused", errp); |
527 | qapi_dealloc_visitor_cleanup(md); |
528 | } |
529 | |
530 | static void qmp_marshal_input_guest_fsfreeze_freeze(QDict *args, QObject **ret, Error **errp) |
531 | { |
532 | int64_t retval; |
533 | (void)args; |
534 | if (error_is_set(errp)) { |
535 | goto out; |
536 | } |
537 | retval = qmp_guest_fsfreeze_freeze(errp); |
538 | if (!error_is_set(errp)) { |
539 | qmp_marshal_output_guest_fsfreeze_freeze(retval, ret, errp); |
540 | } |
541 | |
542 | out: |
543 | |
544 | return; |
545 | } |
546 | |
547 | static void qmp_marshal_output_guest_fsfreeze_thaw(int64_t ret_in, QObject **ret_out, Error **errp) |
548 | { |
549 | QapiDeallocVisitor *md = qapi_dealloc_visitor_new(); |
550 | QmpOutputVisitor *mo = qmp_output_visitor_new(); |
551 | Visitor *v; |
552 | |
553 | v = qmp_output_get_visitor(mo); |
554 | visit_type_int(v, &ret_in, "unused", errp); |
555 | if (!error_is_set(errp)) { |
556 | *ret_out = qmp_output_get_qobject(mo); |
557 | } |
558 | qmp_output_visitor_cleanup(mo); |
559 | v = qapi_dealloc_get_visitor(md); |
560 | visit_type_int(v, &ret_in, "unused", errp); |
561 | qapi_dealloc_visitor_cleanup(md); |
562 | } |
563 | |
564 | static void qmp_marshal_input_guest_fsfreeze_thaw(QDict *args, QObject **ret, Error **errp) |
565 | { |
566 | int64_t retval; |
567 | (void)args; |
568 | if (error_is_set(errp)) { |
569 | goto out; |
570 | } |
571 | retval = qmp_guest_fsfreeze_thaw(errp); |
572 | if (!error_is_set(errp)) { |
573 | qmp_marshal_output_guest_fsfreeze_thaw(retval, ret, errp); |
574 | } |
575 | |
576 | out: |
577 | |
578 | return; |
579 | } |
580 | |
581 | static void qmp_marshal_input_guest_fstrim(QDict *args, QObject **ret, Error **errp) |
582 | { |
583 | QmpInputVisitor *mi; |
584 | QapiDeallocVisitor *md; |
585 | Visitor *v; |
586 | bool_Bool has_minimum = false0; |
587 | int64_t minimum; |
| 1 | Variable 'minimum' declared without an initial value |
|
588 | |
589 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
590 | v = qmp_input_get_visitor(mi); |
591 | visit_start_optional(v, &has_minimum, "minimum", errp); |
592 | if (has_minimum) { |
| |
593 | visit_type_int(v, &minimum, "minimum", errp); |
594 | } |
595 | visit_end_optional(v, errp); |
596 | qmp_input_visitor_cleanup(mi); |
597 | |
598 | if (error_is_set(errp)) { |
| |
599 | goto out; |
600 | } |
601 | qmp_guest_fstrim(has_minimum, minimum, errp); |
| 4 | Pass-by-value argument in function call is undefined |
|
602 | |
603 | out: |
604 | md = qapi_dealloc_visitor_new(); |
605 | v = qapi_dealloc_get_visitor(md); |
606 | visit_start_optional(v, &has_minimum, "minimum", errp); |
607 | if (has_minimum) { |
608 | visit_type_int(v, &minimum, "minimum", errp); |
609 | } |
610 | visit_end_optional(v, errp); |
611 | qapi_dealloc_visitor_cleanup(md); |
612 | return; |
613 | } |
614 | |
615 | static void qmp_marshal_input_guest_suspend_disk(QDict *args, QObject **ret, Error **errp) |
616 | { |
617 | (void)args; |
618 | if (error_is_set(errp)) { |
619 | goto out; |
620 | } |
621 | qmp_guest_suspend_disk(errp); |
622 | |
623 | out: |
624 | |
625 | return; |
626 | } |
627 | |
628 | static void qmp_marshal_input_guest_suspend_ram(QDict *args, QObject **ret, Error **errp) |
629 | { |
630 | (void)args; |
631 | if (error_is_set(errp)) { |
632 | goto out; |
633 | } |
634 | qmp_guest_suspend_ram(errp); |
635 | |
636 | out: |
637 | |
638 | return; |
639 | } |
640 | |
641 | static void qmp_marshal_input_guest_suspend_hybrid(QDict *args, QObject **ret, Error **errp) |
642 | { |
643 | (void)args; |
644 | if (error_is_set(errp)) { |
645 | goto out; |
646 | } |
647 | qmp_guest_suspend_hybrid(errp); |
648 | |
649 | out: |
650 | |
651 | return; |
652 | } |
653 | |
654 | static void qmp_marshal_output_guest_network_get_interfaces(GuestNetworkInterfaceList * ret_in, QObject **ret_out, Error **errp) |
655 | { |
656 | QapiDeallocVisitor *md = qapi_dealloc_visitor_new(); |
657 | QmpOutputVisitor *mo = qmp_output_visitor_new(); |
658 | Visitor *v; |
659 | |
660 | v = qmp_output_get_visitor(mo); |
661 | visit_type_GuestNetworkInterfaceList(v, &ret_in, "unused", errp); |
662 | if (!error_is_set(errp)) { |
663 | *ret_out = qmp_output_get_qobject(mo); |
664 | } |
665 | qmp_output_visitor_cleanup(mo); |
666 | v = qapi_dealloc_get_visitor(md); |
667 | visit_type_GuestNetworkInterfaceList(v, &ret_in, "unused", errp); |
668 | qapi_dealloc_visitor_cleanup(md); |
669 | } |
670 | |
671 | static void qmp_marshal_input_guest_network_get_interfaces(QDict *args, QObject **ret, Error **errp) |
672 | { |
673 | GuestNetworkInterfaceList * retval = NULL((void*)0); |
674 | (void)args; |
675 | if (error_is_set(errp)) { |
676 | goto out; |
677 | } |
678 | retval = qmp_guest_network_get_interfaces(errp); |
679 | if (!error_is_set(errp)) { |
680 | qmp_marshal_output_guest_network_get_interfaces(retval, ret, errp); |
681 | } |
682 | |
683 | out: |
684 | |
685 | return; |
686 | } |
687 | |
688 | static void qmp_init_marshal(void) |
689 | { |
690 | qmp_register_command("guest-sync-delimited", qmp_marshal_input_guest_sync_delimited, QCO_NO_OPTIONS); |
691 | qmp_register_command("guest-sync", qmp_marshal_input_guest_sync, QCO_NO_OPTIONS); |
692 | qmp_register_command("guest-ping", qmp_marshal_input_guest_ping, QCO_NO_OPTIONS); |
693 | qmp_register_command("guest-info", qmp_marshal_input_guest_info, QCO_NO_OPTIONS); |
694 | qmp_register_command("guest-shutdown", qmp_marshal_input_guest_shutdown, QCO_NO_SUCCESS_RESP); |
695 | qmp_register_command("guest-file-open", qmp_marshal_input_guest_file_open, QCO_NO_OPTIONS); |
696 | qmp_register_command("guest-file-close", qmp_marshal_input_guest_file_close, QCO_NO_OPTIONS); |
697 | qmp_register_command("guest-file-read", qmp_marshal_input_guest_file_read, QCO_NO_OPTIONS); |
698 | qmp_register_command("guest-file-write", qmp_marshal_input_guest_file_write, QCO_NO_OPTIONS); |
699 | qmp_register_command("guest-file-seek", qmp_marshal_input_guest_file_seek, QCO_NO_OPTIONS); |
700 | qmp_register_command("guest-file-flush", qmp_marshal_input_guest_file_flush, QCO_NO_OPTIONS); |
701 | qmp_register_command("guest-fsfreeze-status", qmp_marshal_input_guest_fsfreeze_status, QCO_NO_OPTIONS); |
702 | qmp_register_command("guest-fsfreeze-freeze", qmp_marshal_input_guest_fsfreeze_freeze, QCO_NO_OPTIONS); |
703 | qmp_register_command("guest-fsfreeze-thaw", qmp_marshal_input_guest_fsfreeze_thaw, QCO_NO_OPTIONS); |
704 | qmp_register_command("guest-fstrim", qmp_marshal_input_guest_fstrim, QCO_NO_OPTIONS); |
705 | qmp_register_command("guest-suspend-disk", qmp_marshal_input_guest_suspend_disk, QCO_NO_SUCCESS_RESP); |
706 | qmp_register_command("guest-suspend-ram", qmp_marshal_input_guest_suspend_ram, QCO_NO_SUCCESS_RESP); |
707 | qmp_register_command("guest-suspend-hybrid", qmp_marshal_input_guest_suspend_hybrid, QCO_NO_SUCCESS_RESP); |
708 | qmp_register_command("guest-network-get-interfaces", qmp_marshal_input_guest_network_get_interfaces, QCO_NO_OPTIONS); |
709 | } |
710 | |
711 | qapi_init(qmp_init_marshal)static void __attribute__((constructor)) do_qemu_init_qmp_init_marshal (void) { register_module_init(qmp_init_marshal, MODULE_INIT_QAPI ); }; |