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 "qapi-types.h" |
23 | #include "qapi-visit.h" |
24 | |
25 | #include "qmp-commands.h" |
26 | |
27 | static void qmp_marshal_output_query_name(NameInfo * 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_NameInfo(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_NameInfo(v, &ret_in, "unused", errp); |
41 | qapi_dealloc_visitor_cleanup(md); |
42 | } |
43 | |
44 | int qmp_marshal_input_query_name(Monitor *mon, const QDict *qdict, QObject **ret) |
45 | { |
46 | Error *local_err = NULL((void*)0); |
47 | Error **errp = &local_err; |
48 | QDict *args = (QDict *)qdict; |
49 | NameInfo * retval = NULL((void*)0); |
50 | (void)args; |
51 | if (error_is_set(errp)) { |
52 | goto out; |
53 | } |
54 | retval = qmp_query_name(errp); |
55 | if (!error_is_set(errp)) { |
56 | qmp_marshal_output_query_name(retval, ret, errp); |
57 | } |
58 | |
59 | out: |
60 | |
61 | |
62 | if (local_err) { |
63 | qerror_report_err(local_err); |
64 | error_free(local_err); |
65 | return -1; |
66 | } |
67 | return 0; |
68 | } |
69 | |
70 | static void qmp_marshal_output_query_version(VersionInfo * ret_in, QObject **ret_out, Error **errp) |
71 | { |
72 | QapiDeallocVisitor *md = qapi_dealloc_visitor_new(); |
73 | QmpOutputVisitor *mo = qmp_output_visitor_new(); |
74 | Visitor *v; |
75 | |
76 | v = qmp_output_get_visitor(mo); |
77 | visit_type_VersionInfo(v, &ret_in, "unused", errp); |
78 | if (!error_is_set(errp)) { |
79 | *ret_out = qmp_output_get_qobject(mo); |
80 | } |
81 | qmp_output_visitor_cleanup(mo); |
82 | v = qapi_dealloc_get_visitor(md); |
83 | visit_type_VersionInfo(v, &ret_in, "unused", errp); |
84 | qapi_dealloc_visitor_cleanup(md); |
85 | } |
86 | |
87 | int qmp_marshal_input_query_version(Monitor *mon, const QDict *qdict, QObject **ret) |
88 | { |
89 | Error *local_err = NULL((void*)0); |
90 | Error **errp = &local_err; |
91 | QDict *args = (QDict *)qdict; |
92 | VersionInfo * retval = NULL((void*)0); |
93 | (void)args; |
94 | if (error_is_set(errp)) { |
95 | goto out; |
96 | } |
97 | retval = qmp_query_version(errp); |
98 | if (!error_is_set(errp)) { |
99 | qmp_marshal_output_query_version(retval, ret, errp); |
100 | } |
101 | |
102 | out: |
103 | |
104 | |
105 | if (local_err) { |
106 | qerror_report_err(local_err); |
107 | error_free(local_err); |
108 | return -1; |
109 | } |
110 | return 0; |
111 | } |
112 | |
113 | static void qmp_marshal_output_query_kvm(KvmInfo * ret_in, QObject **ret_out, Error **errp) |
114 | { |
115 | QapiDeallocVisitor *md = qapi_dealloc_visitor_new(); |
116 | QmpOutputVisitor *mo = qmp_output_visitor_new(); |
117 | Visitor *v; |
118 | |
119 | v = qmp_output_get_visitor(mo); |
120 | visit_type_KvmInfo(v, &ret_in, "unused", errp); |
121 | if (!error_is_set(errp)) { |
122 | *ret_out = qmp_output_get_qobject(mo); |
123 | } |
124 | qmp_output_visitor_cleanup(mo); |
125 | v = qapi_dealloc_get_visitor(md); |
126 | visit_type_KvmInfo(v, &ret_in, "unused", errp); |
127 | qapi_dealloc_visitor_cleanup(md); |
128 | } |
129 | |
130 | int qmp_marshal_input_query_kvm(Monitor *mon, const QDict *qdict, QObject **ret) |
131 | { |
132 | Error *local_err = NULL((void*)0); |
133 | Error **errp = &local_err; |
134 | QDict *args = (QDict *)qdict; |
135 | KvmInfo * retval = NULL((void*)0); |
136 | (void)args; |
137 | if (error_is_set(errp)) { |
138 | goto out; |
139 | } |
140 | retval = qmp_query_kvm(errp); |
141 | if (!error_is_set(errp)) { |
142 | qmp_marshal_output_query_kvm(retval, ret, errp); |
143 | } |
144 | |
145 | out: |
146 | |
147 | |
148 | if (local_err) { |
149 | qerror_report_err(local_err); |
150 | error_free(local_err); |
151 | return -1; |
152 | } |
153 | return 0; |
154 | } |
155 | |
156 | static void qmp_marshal_output_query_status(StatusInfo * ret_in, QObject **ret_out, Error **errp) |
157 | { |
158 | QapiDeallocVisitor *md = qapi_dealloc_visitor_new(); |
159 | QmpOutputVisitor *mo = qmp_output_visitor_new(); |
160 | Visitor *v; |
161 | |
162 | v = qmp_output_get_visitor(mo); |
163 | visit_type_StatusInfo(v, &ret_in, "unused", errp); |
164 | if (!error_is_set(errp)) { |
165 | *ret_out = qmp_output_get_qobject(mo); |
166 | } |
167 | qmp_output_visitor_cleanup(mo); |
168 | v = qapi_dealloc_get_visitor(md); |
169 | visit_type_StatusInfo(v, &ret_in, "unused", errp); |
170 | qapi_dealloc_visitor_cleanup(md); |
171 | } |
172 | |
173 | int qmp_marshal_input_query_status(Monitor *mon, const QDict *qdict, QObject **ret) |
174 | { |
175 | Error *local_err = NULL((void*)0); |
176 | Error **errp = &local_err; |
177 | QDict *args = (QDict *)qdict; |
178 | StatusInfo * retval = NULL((void*)0); |
179 | (void)args; |
180 | if (error_is_set(errp)) { |
181 | goto out; |
182 | } |
183 | retval = qmp_query_status(errp); |
184 | if (!error_is_set(errp)) { |
185 | qmp_marshal_output_query_status(retval, ret, errp); |
186 | } |
187 | |
188 | out: |
189 | |
190 | |
191 | if (local_err) { |
192 | qerror_report_err(local_err); |
193 | error_free(local_err); |
194 | return -1; |
195 | } |
196 | return 0; |
197 | } |
198 | |
199 | static void qmp_marshal_output_query_uuid(UuidInfo * ret_in, QObject **ret_out, Error **errp) |
200 | { |
201 | QapiDeallocVisitor *md = qapi_dealloc_visitor_new(); |
202 | QmpOutputVisitor *mo = qmp_output_visitor_new(); |
203 | Visitor *v; |
204 | |
205 | v = qmp_output_get_visitor(mo); |
206 | visit_type_UuidInfo(v, &ret_in, "unused", errp); |
207 | if (!error_is_set(errp)) { |
208 | *ret_out = qmp_output_get_qobject(mo); |
209 | } |
210 | qmp_output_visitor_cleanup(mo); |
211 | v = qapi_dealloc_get_visitor(md); |
212 | visit_type_UuidInfo(v, &ret_in, "unused", errp); |
213 | qapi_dealloc_visitor_cleanup(md); |
214 | } |
215 | |
216 | int qmp_marshal_input_query_uuid(Monitor *mon, const QDict *qdict, QObject **ret) |
217 | { |
218 | Error *local_err = NULL((void*)0); |
219 | Error **errp = &local_err; |
220 | QDict *args = (QDict *)qdict; |
221 | UuidInfo * retval = NULL((void*)0); |
222 | (void)args; |
223 | if (error_is_set(errp)) { |
224 | goto out; |
225 | } |
226 | retval = qmp_query_uuid(errp); |
227 | if (!error_is_set(errp)) { |
228 | qmp_marshal_output_query_uuid(retval, ret, errp); |
229 | } |
230 | |
231 | out: |
232 | |
233 | |
234 | if (local_err) { |
235 | qerror_report_err(local_err); |
236 | error_free(local_err); |
237 | return -1; |
238 | } |
239 | return 0; |
240 | } |
241 | |
242 | static void qmp_marshal_output_query_chardev(ChardevInfoList * ret_in, QObject **ret_out, Error **errp) |
243 | { |
244 | QapiDeallocVisitor *md = qapi_dealloc_visitor_new(); |
245 | QmpOutputVisitor *mo = qmp_output_visitor_new(); |
246 | Visitor *v; |
247 | |
248 | v = qmp_output_get_visitor(mo); |
249 | visit_type_ChardevInfoList(v, &ret_in, "unused", errp); |
250 | if (!error_is_set(errp)) { |
251 | *ret_out = qmp_output_get_qobject(mo); |
252 | } |
253 | qmp_output_visitor_cleanup(mo); |
254 | v = qapi_dealloc_get_visitor(md); |
255 | visit_type_ChardevInfoList(v, &ret_in, "unused", errp); |
256 | qapi_dealloc_visitor_cleanup(md); |
257 | } |
258 | |
259 | int qmp_marshal_input_query_chardev(Monitor *mon, const QDict *qdict, QObject **ret) |
260 | { |
261 | Error *local_err = NULL((void*)0); |
262 | Error **errp = &local_err; |
263 | QDict *args = (QDict *)qdict; |
264 | ChardevInfoList * retval = NULL((void*)0); |
265 | (void)args; |
266 | if (error_is_set(errp)) { |
267 | goto out; |
268 | } |
269 | retval = qmp_query_chardev(errp); |
270 | if (!error_is_set(errp)) { |
271 | qmp_marshal_output_query_chardev(retval, ret, errp); |
272 | } |
273 | |
274 | out: |
275 | |
276 | |
277 | if (local_err) { |
278 | qerror_report_err(local_err); |
279 | error_free(local_err); |
280 | return -1; |
281 | } |
282 | return 0; |
283 | } |
284 | |
285 | static void qmp_marshal_output_query_commands(CommandInfoList * ret_in, QObject **ret_out, Error **errp) |
286 | { |
287 | QapiDeallocVisitor *md = qapi_dealloc_visitor_new(); |
288 | QmpOutputVisitor *mo = qmp_output_visitor_new(); |
289 | Visitor *v; |
290 | |
291 | v = qmp_output_get_visitor(mo); |
292 | visit_type_CommandInfoList(v, &ret_in, "unused", errp); |
293 | if (!error_is_set(errp)) { |
294 | *ret_out = qmp_output_get_qobject(mo); |
295 | } |
296 | qmp_output_visitor_cleanup(mo); |
297 | v = qapi_dealloc_get_visitor(md); |
298 | visit_type_CommandInfoList(v, &ret_in, "unused", errp); |
299 | qapi_dealloc_visitor_cleanup(md); |
300 | } |
301 | |
302 | int qmp_marshal_input_query_commands(Monitor *mon, const QDict *qdict, QObject **ret) |
303 | { |
304 | Error *local_err = NULL((void*)0); |
305 | Error **errp = &local_err; |
306 | QDict *args = (QDict *)qdict; |
307 | CommandInfoList * retval = NULL((void*)0); |
308 | (void)args; |
309 | if (error_is_set(errp)) { |
310 | goto out; |
311 | } |
312 | retval = qmp_query_commands(errp); |
313 | if (!error_is_set(errp)) { |
314 | qmp_marshal_output_query_commands(retval, ret, errp); |
315 | } |
316 | |
317 | out: |
318 | |
319 | |
320 | if (local_err) { |
321 | qerror_report_err(local_err); |
322 | error_free(local_err); |
323 | return -1; |
324 | } |
325 | return 0; |
326 | } |
327 | |
328 | static void qmp_marshal_output_query_events(EventInfoList * ret_in, QObject **ret_out, Error **errp) |
329 | { |
330 | QapiDeallocVisitor *md = qapi_dealloc_visitor_new(); |
331 | QmpOutputVisitor *mo = qmp_output_visitor_new(); |
332 | Visitor *v; |
333 | |
334 | v = qmp_output_get_visitor(mo); |
335 | visit_type_EventInfoList(v, &ret_in, "unused", errp); |
336 | if (!error_is_set(errp)) { |
337 | *ret_out = qmp_output_get_qobject(mo); |
338 | } |
339 | qmp_output_visitor_cleanup(mo); |
340 | v = qapi_dealloc_get_visitor(md); |
341 | visit_type_EventInfoList(v, &ret_in, "unused", errp); |
342 | qapi_dealloc_visitor_cleanup(md); |
343 | } |
344 | |
345 | int qmp_marshal_input_query_events(Monitor *mon, const QDict *qdict, QObject **ret) |
346 | { |
347 | Error *local_err = NULL((void*)0); |
348 | Error **errp = &local_err; |
349 | QDict *args = (QDict *)qdict; |
350 | EventInfoList * retval = NULL((void*)0); |
351 | (void)args; |
352 | if (error_is_set(errp)) { |
353 | goto out; |
354 | } |
355 | retval = qmp_query_events(errp); |
356 | if (!error_is_set(errp)) { |
357 | qmp_marshal_output_query_events(retval, ret, errp); |
358 | } |
359 | |
360 | out: |
361 | |
362 | |
363 | if (local_err) { |
364 | qerror_report_err(local_err); |
365 | error_free(local_err); |
366 | return -1; |
367 | } |
368 | return 0; |
369 | } |
370 | |
371 | static void qmp_marshal_output_query_migrate(MigrationInfo * ret_in, QObject **ret_out, Error **errp) |
372 | { |
373 | QapiDeallocVisitor *md = qapi_dealloc_visitor_new(); |
374 | QmpOutputVisitor *mo = qmp_output_visitor_new(); |
375 | Visitor *v; |
376 | |
377 | v = qmp_output_get_visitor(mo); |
378 | visit_type_MigrationInfo(v, &ret_in, "unused", errp); |
379 | if (!error_is_set(errp)) { |
380 | *ret_out = qmp_output_get_qobject(mo); |
381 | } |
382 | qmp_output_visitor_cleanup(mo); |
383 | v = qapi_dealloc_get_visitor(md); |
384 | visit_type_MigrationInfo(v, &ret_in, "unused", errp); |
385 | qapi_dealloc_visitor_cleanup(md); |
386 | } |
387 | |
388 | int qmp_marshal_input_query_migrate(Monitor *mon, const QDict *qdict, QObject **ret) |
389 | { |
390 | Error *local_err = NULL((void*)0); |
391 | Error **errp = &local_err; |
392 | QDict *args = (QDict *)qdict; |
393 | MigrationInfo * retval = NULL((void*)0); |
394 | (void)args; |
395 | if (error_is_set(errp)) { |
396 | goto out; |
397 | } |
398 | retval = qmp_query_migrate(errp); |
399 | if (!error_is_set(errp)) { |
400 | qmp_marshal_output_query_migrate(retval, ret, errp); |
401 | } |
402 | |
403 | out: |
404 | |
405 | |
406 | if (local_err) { |
407 | qerror_report_err(local_err); |
408 | error_free(local_err); |
409 | return -1; |
410 | } |
411 | return 0; |
412 | } |
413 | |
414 | static void qmp_marshal_output_query_mice(MouseInfoList * ret_in, QObject **ret_out, Error **errp) |
415 | { |
416 | QapiDeallocVisitor *md = qapi_dealloc_visitor_new(); |
417 | QmpOutputVisitor *mo = qmp_output_visitor_new(); |
418 | Visitor *v; |
419 | |
420 | v = qmp_output_get_visitor(mo); |
421 | visit_type_MouseInfoList(v, &ret_in, "unused", errp); |
422 | if (!error_is_set(errp)) { |
423 | *ret_out = qmp_output_get_qobject(mo); |
424 | } |
425 | qmp_output_visitor_cleanup(mo); |
426 | v = qapi_dealloc_get_visitor(md); |
427 | visit_type_MouseInfoList(v, &ret_in, "unused", errp); |
428 | qapi_dealloc_visitor_cleanup(md); |
429 | } |
430 | |
431 | int qmp_marshal_input_query_mice(Monitor *mon, const QDict *qdict, QObject **ret) |
432 | { |
433 | Error *local_err = NULL((void*)0); |
434 | Error **errp = &local_err; |
435 | QDict *args = (QDict *)qdict; |
436 | MouseInfoList * retval = NULL((void*)0); |
437 | (void)args; |
438 | if (error_is_set(errp)) { |
439 | goto out; |
440 | } |
441 | retval = qmp_query_mice(errp); |
442 | if (!error_is_set(errp)) { |
443 | qmp_marshal_output_query_mice(retval, ret, errp); |
444 | } |
445 | |
446 | out: |
447 | |
448 | |
449 | if (local_err) { |
450 | qerror_report_err(local_err); |
451 | error_free(local_err); |
452 | return -1; |
453 | } |
454 | return 0; |
455 | } |
456 | |
457 | static void qmp_marshal_output_query_cpus(CpuInfoList * ret_in, QObject **ret_out, Error **errp) |
458 | { |
459 | QapiDeallocVisitor *md = qapi_dealloc_visitor_new(); |
460 | QmpOutputVisitor *mo = qmp_output_visitor_new(); |
461 | Visitor *v; |
462 | |
463 | v = qmp_output_get_visitor(mo); |
464 | visit_type_CpuInfoList(v, &ret_in, "unused", errp); |
465 | if (!error_is_set(errp)) { |
466 | *ret_out = qmp_output_get_qobject(mo); |
467 | } |
468 | qmp_output_visitor_cleanup(mo); |
469 | v = qapi_dealloc_get_visitor(md); |
470 | visit_type_CpuInfoList(v, &ret_in, "unused", errp); |
471 | qapi_dealloc_visitor_cleanup(md); |
472 | } |
473 | |
474 | int qmp_marshal_input_query_cpus(Monitor *mon, const QDict *qdict, QObject **ret) |
475 | { |
476 | Error *local_err = NULL((void*)0); |
477 | Error **errp = &local_err; |
478 | QDict *args = (QDict *)qdict; |
479 | CpuInfoList * retval = NULL((void*)0); |
480 | (void)args; |
481 | if (error_is_set(errp)) { |
482 | goto out; |
483 | } |
484 | retval = qmp_query_cpus(errp); |
485 | if (!error_is_set(errp)) { |
486 | qmp_marshal_output_query_cpus(retval, ret, errp); |
487 | } |
488 | |
489 | out: |
490 | |
491 | |
492 | if (local_err) { |
493 | qerror_report_err(local_err); |
494 | error_free(local_err); |
495 | return -1; |
496 | } |
497 | return 0; |
498 | } |
499 | |
500 | static void qmp_marshal_output_query_block(BlockInfoList * ret_in, QObject **ret_out, Error **errp) |
501 | { |
502 | QapiDeallocVisitor *md = qapi_dealloc_visitor_new(); |
503 | QmpOutputVisitor *mo = qmp_output_visitor_new(); |
504 | Visitor *v; |
505 | |
506 | v = qmp_output_get_visitor(mo); |
507 | visit_type_BlockInfoList(v, &ret_in, "unused", errp); |
508 | if (!error_is_set(errp)) { |
509 | *ret_out = qmp_output_get_qobject(mo); |
510 | } |
511 | qmp_output_visitor_cleanup(mo); |
512 | v = qapi_dealloc_get_visitor(md); |
513 | visit_type_BlockInfoList(v, &ret_in, "unused", errp); |
514 | qapi_dealloc_visitor_cleanup(md); |
515 | } |
516 | |
517 | int qmp_marshal_input_query_block(Monitor *mon, const QDict *qdict, QObject **ret) |
518 | { |
519 | Error *local_err = NULL((void*)0); |
520 | Error **errp = &local_err; |
521 | QDict *args = (QDict *)qdict; |
522 | BlockInfoList * retval = NULL((void*)0); |
523 | (void)args; |
524 | if (error_is_set(errp)) { |
525 | goto out; |
526 | } |
527 | retval = qmp_query_block(errp); |
528 | if (!error_is_set(errp)) { |
529 | qmp_marshal_output_query_block(retval, ret, errp); |
530 | } |
531 | |
532 | out: |
533 | |
534 | |
535 | if (local_err) { |
536 | qerror_report_err(local_err); |
537 | error_free(local_err); |
538 | return -1; |
539 | } |
540 | return 0; |
541 | } |
542 | |
543 | static void qmp_marshal_output_query_blockstats(BlockStatsList * ret_in, QObject **ret_out, Error **errp) |
544 | { |
545 | QapiDeallocVisitor *md = qapi_dealloc_visitor_new(); |
546 | QmpOutputVisitor *mo = qmp_output_visitor_new(); |
547 | Visitor *v; |
548 | |
549 | v = qmp_output_get_visitor(mo); |
550 | visit_type_BlockStatsList(v, &ret_in, "unused", errp); |
551 | if (!error_is_set(errp)) { |
552 | *ret_out = qmp_output_get_qobject(mo); |
553 | } |
554 | qmp_output_visitor_cleanup(mo); |
555 | v = qapi_dealloc_get_visitor(md); |
556 | visit_type_BlockStatsList(v, &ret_in, "unused", errp); |
557 | qapi_dealloc_visitor_cleanup(md); |
558 | } |
559 | |
560 | int qmp_marshal_input_query_blockstats(Monitor *mon, const QDict *qdict, QObject **ret) |
561 | { |
562 | Error *local_err = NULL((void*)0); |
563 | Error **errp = &local_err; |
564 | QDict *args = (QDict *)qdict; |
565 | BlockStatsList * retval = NULL((void*)0); |
566 | (void)args; |
567 | if (error_is_set(errp)) { |
568 | goto out; |
569 | } |
570 | retval = qmp_query_blockstats(errp); |
571 | if (!error_is_set(errp)) { |
572 | qmp_marshal_output_query_blockstats(retval, ret, errp); |
573 | } |
574 | |
575 | out: |
576 | |
577 | |
578 | if (local_err) { |
579 | qerror_report_err(local_err); |
580 | error_free(local_err); |
581 | return -1; |
582 | } |
583 | return 0; |
584 | } |
585 | |
586 | static void qmp_marshal_output_query_vnc(VncInfo * ret_in, QObject **ret_out, Error **errp) |
587 | { |
588 | QapiDeallocVisitor *md = qapi_dealloc_visitor_new(); |
589 | QmpOutputVisitor *mo = qmp_output_visitor_new(); |
590 | Visitor *v; |
591 | |
592 | v = qmp_output_get_visitor(mo); |
593 | visit_type_VncInfo(v, &ret_in, "unused", errp); |
594 | if (!error_is_set(errp)) { |
595 | *ret_out = qmp_output_get_qobject(mo); |
596 | } |
597 | qmp_output_visitor_cleanup(mo); |
598 | v = qapi_dealloc_get_visitor(md); |
599 | visit_type_VncInfo(v, &ret_in, "unused", errp); |
600 | qapi_dealloc_visitor_cleanup(md); |
601 | } |
602 | |
603 | int qmp_marshal_input_query_vnc(Monitor *mon, const QDict *qdict, QObject **ret) |
604 | { |
605 | Error *local_err = NULL((void*)0); |
606 | Error **errp = &local_err; |
607 | QDict *args = (QDict *)qdict; |
608 | VncInfo * retval = NULL((void*)0); |
609 | (void)args; |
610 | if (error_is_set(errp)) { |
611 | goto out; |
612 | } |
613 | retval = qmp_query_vnc(errp); |
614 | if (!error_is_set(errp)) { |
615 | qmp_marshal_output_query_vnc(retval, ret, errp); |
616 | } |
617 | |
618 | out: |
619 | |
620 | |
621 | if (local_err) { |
622 | qerror_report_err(local_err); |
623 | error_free(local_err); |
624 | return -1; |
625 | } |
626 | return 0; |
627 | } |
628 | |
629 | static void qmp_marshal_output_query_spice(SpiceInfo * ret_in, QObject **ret_out, Error **errp) |
630 | { |
631 | QapiDeallocVisitor *md = qapi_dealloc_visitor_new(); |
632 | QmpOutputVisitor *mo = qmp_output_visitor_new(); |
633 | Visitor *v; |
634 | |
635 | v = qmp_output_get_visitor(mo); |
636 | visit_type_SpiceInfo(v, &ret_in, "unused", errp); |
637 | if (!error_is_set(errp)) { |
638 | *ret_out = qmp_output_get_qobject(mo); |
639 | } |
640 | qmp_output_visitor_cleanup(mo); |
641 | v = qapi_dealloc_get_visitor(md); |
642 | visit_type_SpiceInfo(v, &ret_in, "unused", errp); |
643 | qapi_dealloc_visitor_cleanup(md); |
644 | } |
645 | |
646 | int qmp_marshal_input_query_spice(Monitor *mon, const QDict *qdict, QObject **ret) |
647 | { |
648 | Error *local_err = NULL((void*)0); |
649 | Error **errp = &local_err; |
650 | QDict *args = (QDict *)qdict; |
651 | SpiceInfo * retval = NULL((void*)0); |
652 | (void)args; |
653 | if (error_is_set(errp)) { |
654 | goto out; |
655 | } |
656 | retval = qmp_query_spice(errp); |
657 | if (!error_is_set(errp)) { |
658 | qmp_marshal_output_query_spice(retval, ret, errp); |
659 | } |
660 | |
661 | out: |
662 | |
663 | |
664 | if (local_err) { |
665 | qerror_report_err(local_err); |
666 | error_free(local_err); |
667 | return -1; |
668 | } |
669 | return 0; |
670 | } |
671 | |
672 | static void qmp_marshal_output_query_balloon(BalloonInfo * ret_in, QObject **ret_out, Error **errp) |
673 | { |
674 | QapiDeallocVisitor *md = qapi_dealloc_visitor_new(); |
675 | QmpOutputVisitor *mo = qmp_output_visitor_new(); |
676 | Visitor *v; |
677 | |
678 | v = qmp_output_get_visitor(mo); |
679 | visit_type_BalloonInfo(v, &ret_in, "unused", errp); |
680 | if (!error_is_set(errp)) { |
681 | *ret_out = qmp_output_get_qobject(mo); |
682 | } |
683 | qmp_output_visitor_cleanup(mo); |
684 | v = qapi_dealloc_get_visitor(md); |
685 | visit_type_BalloonInfo(v, &ret_in, "unused", errp); |
686 | qapi_dealloc_visitor_cleanup(md); |
687 | } |
688 | |
689 | int qmp_marshal_input_query_balloon(Monitor *mon, const QDict *qdict, QObject **ret) |
690 | { |
691 | Error *local_err = NULL((void*)0); |
692 | Error **errp = &local_err; |
693 | QDict *args = (QDict *)qdict; |
694 | BalloonInfo * retval = NULL((void*)0); |
695 | (void)args; |
696 | if (error_is_set(errp)) { |
697 | goto out; |
698 | } |
699 | retval = qmp_query_balloon(errp); |
700 | if (!error_is_set(errp)) { |
701 | qmp_marshal_output_query_balloon(retval, ret, errp); |
702 | } |
703 | |
704 | out: |
705 | |
706 | |
707 | if (local_err) { |
708 | qerror_report_err(local_err); |
709 | error_free(local_err); |
710 | return -1; |
711 | } |
712 | return 0; |
713 | } |
714 | |
715 | static void qmp_marshal_output_query_pci(PciInfoList * ret_in, QObject **ret_out, Error **errp) |
716 | { |
717 | QapiDeallocVisitor *md = qapi_dealloc_visitor_new(); |
718 | QmpOutputVisitor *mo = qmp_output_visitor_new(); |
719 | Visitor *v; |
720 | |
721 | v = qmp_output_get_visitor(mo); |
722 | visit_type_PciInfoList(v, &ret_in, "unused", errp); |
723 | if (!error_is_set(errp)) { |
724 | *ret_out = qmp_output_get_qobject(mo); |
725 | } |
726 | qmp_output_visitor_cleanup(mo); |
727 | v = qapi_dealloc_get_visitor(md); |
728 | visit_type_PciInfoList(v, &ret_in, "unused", errp); |
729 | qapi_dealloc_visitor_cleanup(md); |
730 | } |
731 | |
732 | int qmp_marshal_input_query_pci(Monitor *mon, const QDict *qdict, QObject **ret) |
733 | { |
734 | Error *local_err = NULL((void*)0); |
735 | Error **errp = &local_err; |
736 | QDict *args = (QDict *)qdict; |
737 | PciInfoList * retval = NULL((void*)0); |
738 | (void)args; |
739 | if (error_is_set(errp)) { |
740 | goto out; |
741 | } |
742 | retval = qmp_query_pci(errp); |
743 | if (!error_is_set(errp)) { |
744 | qmp_marshal_output_query_pci(retval, ret, errp); |
745 | } |
746 | |
747 | out: |
748 | |
749 | |
750 | if (local_err) { |
751 | qerror_report_err(local_err); |
752 | error_free(local_err); |
753 | return -1; |
754 | } |
755 | return 0; |
756 | } |
757 | |
758 | static void qmp_marshal_output_query_block_jobs(BlockJobInfoList * ret_in, QObject **ret_out, Error **errp) |
759 | { |
760 | QapiDeallocVisitor *md = qapi_dealloc_visitor_new(); |
761 | QmpOutputVisitor *mo = qmp_output_visitor_new(); |
762 | Visitor *v; |
763 | |
764 | v = qmp_output_get_visitor(mo); |
765 | visit_type_BlockJobInfoList(v, &ret_in, "unused", errp); |
766 | if (!error_is_set(errp)) { |
767 | *ret_out = qmp_output_get_qobject(mo); |
768 | } |
769 | qmp_output_visitor_cleanup(mo); |
770 | v = qapi_dealloc_get_visitor(md); |
771 | visit_type_BlockJobInfoList(v, &ret_in, "unused", errp); |
772 | qapi_dealloc_visitor_cleanup(md); |
773 | } |
774 | |
775 | int qmp_marshal_input_query_block_jobs(Monitor *mon, const QDict *qdict, QObject **ret) |
776 | { |
777 | Error *local_err = NULL((void*)0); |
778 | Error **errp = &local_err; |
779 | QDict *args = (QDict *)qdict; |
780 | BlockJobInfoList * retval = NULL((void*)0); |
781 | (void)args; |
782 | if (error_is_set(errp)) { |
783 | goto out; |
784 | } |
785 | retval = qmp_query_block_jobs(errp); |
786 | if (!error_is_set(errp)) { |
787 | qmp_marshal_output_query_block_jobs(retval, ret, errp); |
788 | } |
789 | |
790 | out: |
791 | |
792 | |
793 | if (local_err) { |
794 | qerror_report_err(local_err); |
795 | error_free(local_err); |
796 | return -1; |
797 | } |
798 | return 0; |
799 | } |
800 | |
801 | int qmp_marshal_input_quit(Monitor *mon, const QDict *qdict, QObject **ret) |
802 | { |
803 | Error *local_err = NULL((void*)0); |
804 | Error **errp = &local_err; |
805 | QDict *args = (QDict *)qdict; |
806 | (void)args; |
807 | if (error_is_set(errp)) { |
808 | goto out; |
809 | } |
810 | qmp_quit(errp); |
811 | |
812 | out: |
813 | |
814 | |
815 | if (local_err) { |
816 | qerror_report_err(local_err); |
817 | error_free(local_err); |
818 | return -1; |
819 | } |
820 | return 0; |
821 | } |
822 | |
823 | int qmp_marshal_input_stop(Monitor *mon, const QDict *qdict, QObject **ret) |
824 | { |
825 | Error *local_err = NULL((void*)0); |
826 | Error **errp = &local_err; |
827 | QDict *args = (QDict *)qdict; |
828 | (void)args; |
829 | if (error_is_set(errp)) { |
830 | goto out; |
831 | } |
832 | qmp_stop(errp); |
833 | |
834 | out: |
835 | |
836 | |
837 | if (local_err) { |
838 | qerror_report_err(local_err); |
839 | error_free(local_err); |
840 | return -1; |
841 | } |
842 | return 0; |
843 | } |
844 | |
845 | int qmp_marshal_input_system_reset(Monitor *mon, const QDict *qdict, QObject **ret) |
846 | { |
847 | Error *local_err = NULL((void*)0); |
848 | Error **errp = &local_err; |
849 | QDict *args = (QDict *)qdict; |
850 | (void)args; |
851 | if (error_is_set(errp)) { |
852 | goto out; |
853 | } |
854 | qmp_system_reset(errp); |
855 | |
856 | out: |
857 | |
858 | |
859 | if (local_err) { |
860 | qerror_report_err(local_err); |
861 | error_free(local_err); |
862 | return -1; |
863 | } |
864 | return 0; |
865 | } |
866 | |
867 | int qmp_marshal_input_system_powerdown(Monitor *mon, const QDict *qdict, QObject **ret) |
868 | { |
869 | Error *local_err = NULL((void*)0); |
870 | Error **errp = &local_err; |
871 | QDict *args = (QDict *)qdict; |
872 | (void)args; |
873 | if (error_is_set(errp)) { |
874 | goto out; |
875 | } |
876 | qmp_system_powerdown(errp); |
877 | |
878 | out: |
879 | |
880 | |
881 | if (local_err) { |
882 | qerror_report_err(local_err); |
883 | error_free(local_err); |
884 | return -1; |
885 | } |
886 | return 0; |
887 | } |
888 | |
889 | int qmp_marshal_input_cpu(Monitor *mon, const QDict *qdict, QObject **ret) |
890 | { |
891 | Error *local_err = NULL((void*)0); |
892 | Error **errp = &local_err; |
893 | QDict *args = (QDict *)qdict; |
894 | QmpInputVisitor *mi; |
895 | QapiDeallocVisitor *md; |
896 | Visitor *v; |
897 | int64_t index; |
898 | |
899 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
900 | v = qmp_input_get_visitor(mi); |
901 | visit_type_int(v, &index, "index", errp); |
902 | qmp_input_visitor_cleanup(mi); |
903 | |
904 | if (error_is_set(errp)) { |
905 | goto out; |
906 | } |
907 | qmp_cpu(index, errp); |
908 | |
909 | out: |
910 | md = qapi_dealloc_visitor_new(); |
911 | v = qapi_dealloc_get_visitor(md); |
912 | visit_type_int(v, &index, "index", errp); |
913 | qapi_dealloc_visitor_cleanup(md); |
914 | |
915 | if (local_err) { |
916 | qerror_report_err(local_err); |
917 | error_free(local_err); |
918 | return -1; |
919 | } |
920 | return 0; |
921 | } |
922 | |
923 | int qmp_marshal_input_memsave(Monitor *mon, const QDict *qdict, QObject **ret) |
924 | { |
925 | Error *local_err = NULL((void*)0); |
926 | Error **errp = &local_err; |
927 | QDict *args = (QDict *)qdict; |
928 | QmpInputVisitor *mi; |
929 | QapiDeallocVisitor *md; |
930 | Visitor *v; |
931 | int64_t val; |
932 | int64_t size; |
933 | char * filename = NULL((void*)0); |
934 | bool_Bool has_cpu_index = false0; |
935 | int64_t cpu_index; |
| 1 | Variable 'cpu_index' declared without an initial value |
|
936 | |
937 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
938 | v = qmp_input_get_visitor(mi); |
939 | visit_type_int(v, &val, "val", errp); |
940 | visit_type_int(v, &size, "size", errp); |
941 | visit_type_str(v, &filename, "filename", errp); |
942 | visit_start_optional(v, &has_cpu_index, "cpu-index", errp); |
943 | if (has_cpu_index) { |
| |
944 | visit_type_int(v, &cpu_index, "cpu-index", errp); |
945 | } |
946 | visit_end_optional(v, errp); |
947 | qmp_input_visitor_cleanup(mi); |
948 | |
949 | if (error_is_set(errp)) { |
| |
950 | goto out; |
951 | } |
952 | qmp_memsave(val, size, filename, has_cpu_index, cpu_index, errp); |
| 4 | Pass-by-value argument in function call is undefined |
|
953 | |
954 | out: |
955 | md = qapi_dealloc_visitor_new(); |
956 | v = qapi_dealloc_get_visitor(md); |
957 | visit_type_int(v, &val, "val", errp); |
958 | visit_type_int(v, &size, "size", errp); |
959 | visit_type_str(v, &filename, "filename", errp); |
960 | visit_start_optional(v, &has_cpu_index, "cpu-index", errp); |
961 | if (has_cpu_index) { |
962 | visit_type_int(v, &cpu_index, "cpu-index", errp); |
963 | } |
964 | visit_end_optional(v, errp); |
965 | qapi_dealloc_visitor_cleanup(md); |
966 | |
967 | if (local_err) { |
968 | qerror_report_err(local_err); |
969 | error_free(local_err); |
970 | return -1; |
971 | } |
972 | return 0; |
973 | } |
974 | |
975 | int qmp_marshal_input_pmemsave(Monitor *mon, const QDict *qdict, QObject **ret) |
976 | { |
977 | Error *local_err = NULL((void*)0); |
978 | Error **errp = &local_err; |
979 | QDict *args = (QDict *)qdict; |
980 | QmpInputVisitor *mi; |
981 | QapiDeallocVisitor *md; |
982 | Visitor *v; |
983 | int64_t val; |
984 | int64_t size; |
985 | char * filename = NULL((void*)0); |
986 | |
987 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
988 | v = qmp_input_get_visitor(mi); |
989 | visit_type_int(v, &val, "val", errp); |
990 | visit_type_int(v, &size, "size", errp); |
991 | visit_type_str(v, &filename, "filename", errp); |
992 | qmp_input_visitor_cleanup(mi); |
993 | |
994 | if (error_is_set(errp)) { |
995 | goto out; |
996 | } |
997 | qmp_pmemsave(val, size, filename, errp); |
998 | |
999 | out: |
1000 | md = qapi_dealloc_visitor_new(); |
1001 | v = qapi_dealloc_get_visitor(md); |
1002 | visit_type_int(v, &val, "val", errp); |
1003 | visit_type_int(v, &size, "size", errp); |
1004 | visit_type_str(v, &filename, "filename", errp); |
1005 | qapi_dealloc_visitor_cleanup(md); |
1006 | |
1007 | if (local_err) { |
1008 | qerror_report_err(local_err); |
1009 | error_free(local_err); |
1010 | return -1; |
1011 | } |
1012 | return 0; |
1013 | } |
1014 | |
1015 | int qmp_marshal_input_cont(Monitor *mon, const QDict *qdict, QObject **ret) |
1016 | { |
1017 | Error *local_err = NULL((void*)0); |
1018 | Error **errp = &local_err; |
1019 | QDict *args = (QDict *)qdict; |
1020 | (void)args; |
1021 | if (error_is_set(errp)) { |
1022 | goto out; |
1023 | } |
1024 | qmp_cont(errp); |
1025 | |
1026 | out: |
1027 | |
1028 | |
1029 | if (local_err) { |
1030 | qerror_report_err(local_err); |
1031 | error_free(local_err); |
1032 | return -1; |
1033 | } |
1034 | return 0; |
1035 | } |
1036 | |
1037 | int qmp_marshal_input_system_wakeup(Monitor *mon, const QDict *qdict, QObject **ret) |
1038 | { |
1039 | Error *local_err = NULL((void*)0); |
1040 | Error **errp = &local_err; |
1041 | QDict *args = (QDict *)qdict; |
1042 | (void)args; |
1043 | if (error_is_set(errp)) { |
1044 | goto out; |
1045 | } |
1046 | qmp_system_wakeup(errp); |
1047 | |
1048 | out: |
1049 | |
1050 | |
1051 | if (local_err) { |
1052 | qerror_report_err(local_err); |
1053 | error_free(local_err); |
1054 | return -1; |
1055 | } |
1056 | return 0; |
1057 | } |
1058 | |
1059 | int qmp_marshal_input_inject_nmi(Monitor *mon, const QDict *qdict, QObject **ret) |
1060 | { |
1061 | Error *local_err = NULL((void*)0); |
1062 | Error **errp = &local_err; |
1063 | QDict *args = (QDict *)qdict; |
1064 | (void)args; |
1065 | if (error_is_set(errp)) { |
1066 | goto out; |
1067 | } |
1068 | qmp_inject_nmi(errp); |
1069 | |
1070 | out: |
1071 | |
1072 | |
1073 | if (local_err) { |
1074 | qerror_report_err(local_err); |
1075 | error_free(local_err); |
1076 | return -1; |
1077 | } |
1078 | return 0; |
1079 | } |
1080 | |
1081 | int qmp_marshal_input_set_link(Monitor *mon, const QDict *qdict, QObject **ret) |
1082 | { |
1083 | Error *local_err = NULL((void*)0); |
1084 | Error **errp = &local_err; |
1085 | QDict *args = (QDict *)qdict; |
1086 | QmpInputVisitor *mi; |
1087 | QapiDeallocVisitor *md; |
1088 | Visitor *v; |
1089 | char * name = NULL((void*)0); |
1090 | bool_Bool up; |
1091 | |
1092 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
1093 | v = qmp_input_get_visitor(mi); |
1094 | visit_type_str(v, &name, "name", errp); |
1095 | visit_type_bool(v, &up, "up", errp); |
1096 | qmp_input_visitor_cleanup(mi); |
1097 | |
1098 | if (error_is_set(errp)) { |
1099 | goto out; |
1100 | } |
1101 | qmp_set_link(name, up, errp); |
1102 | |
1103 | out: |
1104 | md = qapi_dealloc_visitor_new(); |
1105 | v = qapi_dealloc_get_visitor(md); |
1106 | visit_type_str(v, &name, "name", errp); |
1107 | visit_type_bool(v, &up, "up", errp); |
1108 | qapi_dealloc_visitor_cleanup(md); |
1109 | |
1110 | if (local_err) { |
1111 | qerror_report_err(local_err); |
1112 | error_free(local_err); |
1113 | return -1; |
1114 | } |
1115 | return 0; |
1116 | } |
1117 | |
1118 | int qmp_marshal_input_block_passwd(Monitor *mon, const QDict *qdict, QObject **ret) |
1119 | { |
1120 | Error *local_err = NULL((void*)0); |
1121 | Error **errp = &local_err; |
1122 | QDict *args = (QDict *)qdict; |
1123 | QmpInputVisitor *mi; |
1124 | QapiDeallocVisitor *md; |
1125 | Visitor *v; |
1126 | char * device = NULL((void*)0); |
1127 | char * password = NULL((void*)0); |
1128 | |
1129 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
1130 | v = qmp_input_get_visitor(mi); |
1131 | visit_type_str(v, &device, "device", errp); |
1132 | visit_type_str(v, &password, "password", errp); |
1133 | qmp_input_visitor_cleanup(mi); |
1134 | |
1135 | if (error_is_set(errp)) { |
1136 | goto out; |
1137 | } |
1138 | qmp_block_passwd(device, password, errp); |
1139 | |
1140 | out: |
1141 | md = qapi_dealloc_visitor_new(); |
1142 | v = qapi_dealloc_get_visitor(md); |
1143 | visit_type_str(v, &device, "device", errp); |
1144 | visit_type_str(v, &password, "password", errp); |
1145 | qapi_dealloc_visitor_cleanup(md); |
1146 | |
1147 | if (local_err) { |
1148 | qerror_report_err(local_err); |
1149 | error_free(local_err); |
1150 | return -1; |
1151 | } |
1152 | return 0; |
1153 | } |
1154 | |
1155 | int qmp_marshal_input_balloon(Monitor *mon, const QDict *qdict, QObject **ret) |
1156 | { |
1157 | Error *local_err = NULL((void*)0); |
1158 | Error **errp = &local_err; |
1159 | QDict *args = (QDict *)qdict; |
1160 | QmpInputVisitor *mi; |
1161 | QapiDeallocVisitor *md; |
1162 | Visitor *v; |
1163 | int64_t value; |
1164 | |
1165 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
1166 | v = qmp_input_get_visitor(mi); |
1167 | visit_type_int(v, &value, "value", errp); |
1168 | qmp_input_visitor_cleanup(mi); |
1169 | |
1170 | if (error_is_set(errp)) { |
1171 | goto out; |
1172 | } |
1173 | qmp_balloon(value, errp); |
1174 | |
1175 | out: |
1176 | md = qapi_dealloc_visitor_new(); |
1177 | v = qapi_dealloc_get_visitor(md); |
1178 | visit_type_int(v, &value, "value", errp); |
1179 | qapi_dealloc_visitor_cleanup(md); |
1180 | |
1181 | if (local_err) { |
1182 | qerror_report_err(local_err); |
1183 | error_free(local_err); |
1184 | return -1; |
1185 | } |
1186 | return 0; |
1187 | } |
1188 | |
1189 | int qmp_marshal_input_block_resize(Monitor *mon, const QDict *qdict, QObject **ret) |
1190 | { |
1191 | Error *local_err = NULL((void*)0); |
1192 | Error **errp = &local_err; |
1193 | QDict *args = (QDict *)qdict; |
1194 | QmpInputVisitor *mi; |
1195 | QapiDeallocVisitor *md; |
1196 | Visitor *v; |
1197 | char * device = NULL((void*)0); |
1198 | int64_t size; |
1199 | |
1200 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
1201 | v = qmp_input_get_visitor(mi); |
1202 | visit_type_str(v, &device, "device", errp); |
1203 | visit_type_int(v, &size, "size", errp); |
1204 | qmp_input_visitor_cleanup(mi); |
1205 | |
1206 | if (error_is_set(errp)) { |
1207 | goto out; |
1208 | } |
1209 | qmp_block_resize(device, size, errp); |
1210 | |
1211 | out: |
1212 | md = qapi_dealloc_visitor_new(); |
1213 | v = qapi_dealloc_get_visitor(md); |
1214 | visit_type_str(v, &device, "device", errp); |
1215 | visit_type_int(v, &size, "size", errp); |
1216 | qapi_dealloc_visitor_cleanup(md); |
1217 | |
1218 | if (local_err) { |
1219 | qerror_report_err(local_err); |
1220 | error_free(local_err); |
1221 | return -1; |
1222 | } |
1223 | return 0; |
1224 | } |
1225 | |
1226 | int qmp_marshal_input_transaction(Monitor *mon, const QDict *qdict, QObject **ret) |
1227 | { |
1228 | Error *local_err = NULL((void*)0); |
1229 | Error **errp = &local_err; |
1230 | QDict *args = (QDict *)qdict; |
1231 | QmpInputVisitor *mi; |
1232 | QapiDeallocVisitor *md; |
1233 | Visitor *v; |
1234 | BlockdevActionList * actions = NULL((void*)0); |
1235 | |
1236 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
1237 | v = qmp_input_get_visitor(mi); |
1238 | visit_type_BlockdevActionList(v, &actions, "actions", errp); |
1239 | qmp_input_visitor_cleanup(mi); |
1240 | |
1241 | if (error_is_set(errp)) { |
1242 | goto out; |
1243 | } |
1244 | qmp_transaction(actions, errp); |
1245 | |
1246 | out: |
1247 | md = qapi_dealloc_visitor_new(); |
1248 | v = qapi_dealloc_get_visitor(md); |
1249 | visit_type_BlockdevActionList(v, &actions, "actions", errp); |
1250 | qapi_dealloc_visitor_cleanup(md); |
1251 | |
1252 | if (local_err) { |
1253 | qerror_report_err(local_err); |
1254 | error_free(local_err); |
1255 | return -1; |
1256 | } |
1257 | return 0; |
1258 | } |
1259 | |
1260 | int qmp_marshal_input_blockdev_snapshot_sync(Monitor *mon, const QDict *qdict, QObject **ret) |
1261 | { |
1262 | Error *local_err = NULL((void*)0); |
1263 | Error **errp = &local_err; |
1264 | QDict *args = (QDict *)qdict; |
1265 | QmpInputVisitor *mi; |
1266 | QapiDeallocVisitor *md; |
1267 | Visitor *v; |
1268 | char * device = NULL((void*)0); |
1269 | char * snapshot_file = NULL((void*)0); |
1270 | bool_Bool has_format = false0; |
1271 | char * format = NULL((void*)0); |
1272 | bool_Bool has_mode = false0; |
1273 | NewImageMode mode; |
1274 | |
1275 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
1276 | v = qmp_input_get_visitor(mi); |
1277 | visit_type_str(v, &device, "device", errp); |
1278 | visit_type_str(v, &snapshot_file, "snapshot-file", errp); |
1279 | visit_start_optional(v, &has_format, "format", errp); |
1280 | if (has_format) { |
1281 | visit_type_str(v, &format, "format", errp); |
1282 | } |
1283 | visit_end_optional(v, errp); |
1284 | visit_start_optional(v, &has_mode, "mode", errp); |
1285 | if (has_mode) { |
1286 | visit_type_NewImageMode(v, &mode, "mode", errp); |
1287 | } |
1288 | visit_end_optional(v, errp); |
1289 | qmp_input_visitor_cleanup(mi); |
1290 | |
1291 | if (error_is_set(errp)) { |
1292 | goto out; |
1293 | } |
1294 | qmp_blockdev_snapshot_sync(device, snapshot_file, has_format, format, has_mode, mode, errp); |
1295 | |
1296 | out: |
1297 | md = qapi_dealloc_visitor_new(); |
1298 | v = qapi_dealloc_get_visitor(md); |
1299 | visit_type_str(v, &device, "device", errp); |
1300 | visit_type_str(v, &snapshot_file, "snapshot-file", errp); |
1301 | visit_start_optional(v, &has_format, "format", errp); |
1302 | if (has_format) { |
1303 | visit_type_str(v, &format, "format", errp); |
1304 | } |
1305 | visit_end_optional(v, errp); |
1306 | visit_start_optional(v, &has_mode, "mode", errp); |
1307 | if (has_mode) { |
1308 | visit_type_NewImageMode(v, &mode, "mode", errp); |
1309 | } |
1310 | visit_end_optional(v, errp); |
1311 | qapi_dealloc_visitor_cleanup(md); |
1312 | |
1313 | if (local_err) { |
1314 | qerror_report_err(local_err); |
1315 | error_free(local_err); |
1316 | return -1; |
1317 | } |
1318 | return 0; |
1319 | } |
1320 | |
1321 | static void qmp_marshal_output_human_monitor_command(char * ret_in, QObject **ret_out, Error **errp) |
1322 | { |
1323 | QapiDeallocVisitor *md = qapi_dealloc_visitor_new(); |
1324 | QmpOutputVisitor *mo = qmp_output_visitor_new(); |
1325 | Visitor *v; |
1326 | |
1327 | v = qmp_output_get_visitor(mo); |
1328 | visit_type_str(v, &ret_in, "unused", errp); |
1329 | if (!error_is_set(errp)) { |
1330 | *ret_out = qmp_output_get_qobject(mo); |
1331 | } |
1332 | qmp_output_visitor_cleanup(mo); |
1333 | v = qapi_dealloc_get_visitor(md); |
1334 | visit_type_str(v, &ret_in, "unused", errp); |
1335 | qapi_dealloc_visitor_cleanup(md); |
1336 | } |
1337 | |
1338 | int qmp_marshal_input_human_monitor_command(Monitor *mon, const QDict *qdict, QObject **ret) |
1339 | { |
1340 | Error *local_err = NULL((void*)0); |
1341 | Error **errp = &local_err; |
1342 | QDict *args = (QDict *)qdict; |
1343 | char * retval = NULL((void*)0); |
1344 | QmpInputVisitor *mi; |
1345 | QapiDeallocVisitor *md; |
1346 | Visitor *v; |
1347 | char * command_line = NULL((void*)0); |
1348 | bool_Bool has_cpu_index = false0; |
1349 | int64_t cpu_index; |
1350 | |
1351 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
1352 | v = qmp_input_get_visitor(mi); |
1353 | visit_type_str(v, &command_line, "command-line", errp); |
1354 | visit_start_optional(v, &has_cpu_index, "cpu-index", errp); |
1355 | if (has_cpu_index) { |
1356 | visit_type_int(v, &cpu_index, "cpu-index", errp); |
1357 | } |
1358 | visit_end_optional(v, errp); |
1359 | qmp_input_visitor_cleanup(mi); |
1360 | |
1361 | if (error_is_set(errp)) { |
1362 | goto out; |
1363 | } |
1364 | retval = qmp_human_monitor_command(command_line, has_cpu_index, cpu_index, errp); |
1365 | if (!error_is_set(errp)) { |
1366 | qmp_marshal_output_human_monitor_command(retval, ret, errp); |
1367 | } |
1368 | |
1369 | out: |
1370 | md = qapi_dealloc_visitor_new(); |
1371 | v = qapi_dealloc_get_visitor(md); |
1372 | visit_type_str(v, &command_line, "command-line", errp); |
1373 | visit_start_optional(v, &has_cpu_index, "cpu-index", errp); |
1374 | if (has_cpu_index) { |
1375 | visit_type_int(v, &cpu_index, "cpu-index", errp); |
1376 | } |
1377 | visit_end_optional(v, errp); |
1378 | qapi_dealloc_visitor_cleanup(md); |
1379 | |
1380 | if (local_err) { |
1381 | qerror_report_err(local_err); |
1382 | error_free(local_err); |
1383 | return -1; |
1384 | } |
1385 | return 0; |
1386 | } |
1387 | |
1388 | int qmp_marshal_input_migrate_cancel(Monitor *mon, const QDict *qdict, QObject **ret) |
1389 | { |
1390 | Error *local_err = NULL((void*)0); |
1391 | Error **errp = &local_err; |
1392 | QDict *args = (QDict *)qdict; |
1393 | (void)args; |
1394 | if (error_is_set(errp)) { |
1395 | goto out; |
1396 | } |
1397 | qmp_migrate_cancel(errp); |
1398 | |
1399 | out: |
1400 | |
1401 | |
1402 | if (local_err) { |
1403 | qerror_report_err(local_err); |
1404 | error_free(local_err); |
1405 | return -1; |
1406 | } |
1407 | return 0; |
1408 | } |
1409 | |
1410 | int qmp_marshal_input_migrate_set_downtime(Monitor *mon, const QDict *qdict, QObject **ret) |
1411 | { |
1412 | Error *local_err = NULL((void*)0); |
1413 | Error **errp = &local_err; |
1414 | QDict *args = (QDict *)qdict; |
1415 | QmpInputVisitor *mi; |
1416 | QapiDeallocVisitor *md; |
1417 | Visitor *v; |
1418 | double value; |
1419 | |
1420 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
1421 | v = qmp_input_get_visitor(mi); |
1422 | visit_type_number(v, &value, "value", errp); |
1423 | qmp_input_visitor_cleanup(mi); |
1424 | |
1425 | if (error_is_set(errp)) { |
1426 | goto out; |
1427 | } |
1428 | qmp_migrate_set_downtime(value, errp); |
1429 | |
1430 | out: |
1431 | md = qapi_dealloc_visitor_new(); |
1432 | v = qapi_dealloc_get_visitor(md); |
1433 | visit_type_number(v, &value, "value", errp); |
1434 | qapi_dealloc_visitor_cleanup(md); |
1435 | |
1436 | if (local_err) { |
1437 | qerror_report_err(local_err); |
1438 | error_free(local_err); |
1439 | return -1; |
1440 | } |
1441 | return 0; |
1442 | } |
1443 | |
1444 | int qmp_marshal_input_migrate_set_speed(Monitor *mon, const QDict *qdict, QObject **ret) |
1445 | { |
1446 | Error *local_err = NULL((void*)0); |
1447 | Error **errp = &local_err; |
1448 | QDict *args = (QDict *)qdict; |
1449 | QmpInputVisitor *mi; |
1450 | QapiDeallocVisitor *md; |
1451 | Visitor *v; |
1452 | int64_t value; |
1453 | |
1454 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
1455 | v = qmp_input_get_visitor(mi); |
1456 | visit_type_int(v, &value, "value", errp); |
1457 | qmp_input_visitor_cleanup(mi); |
1458 | |
1459 | if (error_is_set(errp)) { |
1460 | goto out; |
1461 | } |
1462 | qmp_migrate_set_speed(value, errp); |
1463 | |
1464 | out: |
1465 | md = qapi_dealloc_visitor_new(); |
1466 | v = qapi_dealloc_get_visitor(md); |
1467 | visit_type_int(v, &value, "value", errp); |
1468 | qapi_dealloc_visitor_cleanup(md); |
1469 | |
1470 | if (local_err) { |
1471 | qerror_report_err(local_err); |
1472 | error_free(local_err); |
1473 | return -1; |
1474 | } |
1475 | return 0; |
1476 | } |
1477 | |
1478 | static void qmp_marshal_output_qom_list(ObjectPropertyInfoList * ret_in, QObject **ret_out, Error **errp) |
1479 | { |
1480 | QapiDeallocVisitor *md = qapi_dealloc_visitor_new(); |
1481 | QmpOutputVisitor *mo = qmp_output_visitor_new(); |
1482 | Visitor *v; |
1483 | |
1484 | v = qmp_output_get_visitor(mo); |
1485 | visit_type_ObjectPropertyInfoList(v, &ret_in, "unused", errp); |
1486 | if (!error_is_set(errp)) { |
1487 | *ret_out = qmp_output_get_qobject(mo); |
1488 | } |
1489 | qmp_output_visitor_cleanup(mo); |
1490 | v = qapi_dealloc_get_visitor(md); |
1491 | visit_type_ObjectPropertyInfoList(v, &ret_in, "unused", errp); |
1492 | qapi_dealloc_visitor_cleanup(md); |
1493 | } |
1494 | |
1495 | int qmp_marshal_input_qom_list(Monitor *mon, const QDict *qdict, QObject **ret) |
1496 | { |
1497 | Error *local_err = NULL((void*)0); |
1498 | Error **errp = &local_err; |
1499 | QDict *args = (QDict *)qdict; |
1500 | ObjectPropertyInfoList * retval = NULL((void*)0); |
1501 | QmpInputVisitor *mi; |
1502 | QapiDeallocVisitor *md; |
1503 | Visitor *v; |
1504 | char * path = NULL((void*)0); |
1505 | |
1506 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
1507 | v = qmp_input_get_visitor(mi); |
1508 | visit_type_str(v, &path, "path", errp); |
1509 | qmp_input_visitor_cleanup(mi); |
1510 | |
1511 | if (error_is_set(errp)) { |
1512 | goto out; |
1513 | } |
1514 | retval = qmp_qom_list(path, errp); |
1515 | if (!error_is_set(errp)) { |
1516 | qmp_marshal_output_qom_list(retval, ret, errp); |
1517 | } |
1518 | |
1519 | out: |
1520 | md = qapi_dealloc_visitor_new(); |
1521 | v = qapi_dealloc_get_visitor(md); |
1522 | visit_type_str(v, &path, "path", errp); |
1523 | qapi_dealloc_visitor_cleanup(md); |
1524 | |
1525 | if (local_err) { |
1526 | qerror_report_err(local_err); |
1527 | error_free(local_err); |
1528 | return -1; |
1529 | } |
1530 | return 0; |
1531 | } |
1532 | |
1533 | int qmp_marshal_input_set_password(Monitor *mon, const QDict *qdict, QObject **ret) |
1534 | { |
1535 | Error *local_err = NULL((void*)0); |
1536 | Error **errp = &local_err; |
1537 | QDict *args = (QDict *)qdict; |
1538 | QmpInputVisitor *mi; |
1539 | QapiDeallocVisitor *md; |
1540 | Visitor *v; |
1541 | char * protocol = NULL((void*)0); |
1542 | char * password = NULL((void*)0); |
1543 | bool_Bool has_connected = false0; |
1544 | char * connected = NULL((void*)0); |
1545 | |
1546 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
1547 | v = qmp_input_get_visitor(mi); |
1548 | visit_type_str(v, &protocol, "protocol", errp); |
1549 | visit_type_str(v, &password, "password", errp); |
1550 | visit_start_optional(v, &has_connected, "connected", errp); |
1551 | if (has_connected) { |
1552 | visit_type_str(v, &connected, "connected", errp); |
1553 | } |
1554 | visit_end_optional(v, errp); |
1555 | qmp_input_visitor_cleanup(mi); |
1556 | |
1557 | if (error_is_set(errp)) { |
1558 | goto out; |
1559 | } |
1560 | qmp_set_password(protocol, password, has_connected, connected, errp); |
1561 | |
1562 | out: |
1563 | md = qapi_dealloc_visitor_new(); |
1564 | v = qapi_dealloc_get_visitor(md); |
1565 | visit_type_str(v, &protocol, "protocol", errp); |
1566 | visit_type_str(v, &password, "password", errp); |
1567 | visit_start_optional(v, &has_connected, "connected", errp); |
1568 | if (has_connected) { |
1569 | visit_type_str(v, &connected, "connected", errp); |
1570 | } |
1571 | visit_end_optional(v, errp); |
1572 | qapi_dealloc_visitor_cleanup(md); |
1573 | |
1574 | if (local_err) { |
1575 | qerror_report_err(local_err); |
1576 | error_free(local_err); |
1577 | return -1; |
1578 | } |
1579 | return 0; |
1580 | } |
1581 | |
1582 | int qmp_marshal_input_expire_password(Monitor *mon, const QDict *qdict, QObject **ret) |
1583 | { |
1584 | Error *local_err = NULL((void*)0); |
1585 | Error **errp = &local_err; |
1586 | QDict *args = (QDict *)qdict; |
1587 | QmpInputVisitor *mi; |
1588 | QapiDeallocVisitor *md; |
1589 | Visitor *v; |
1590 | char * protocol = NULL((void*)0); |
1591 | char * time = NULL((void*)0); |
1592 | |
1593 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
1594 | v = qmp_input_get_visitor(mi); |
1595 | visit_type_str(v, &protocol, "protocol", errp); |
1596 | visit_type_str(v, &time, "time", errp); |
1597 | qmp_input_visitor_cleanup(mi); |
1598 | |
1599 | if (error_is_set(errp)) { |
1600 | goto out; |
1601 | } |
1602 | qmp_expire_password(protocol, time, errp); |
1603 | |
1604 | out: |
1605 | md = qapi_dealloc_visitor_new(); |
1606 | v = qapi_dealloc_get_visitor(md); |
1607 | visit_type_str(v, &protocol, "protocol", errp); |
1608 | visit_type_str(v, &time, "time", errp); |
1609 | qapi_dealloc_visitor_cleanup(md); |
1610 | |
1611 | if (local_err) { |
1612 | qerror_report_err(local_err); |
1613 | error_free(local_err); |
1614 | return -1; |
1615 | } |
1616 | return 0; |
1617 | } |
1618 | |
1619 | int qmp_marshal_input_eject(Monitor *mon, const QDict *qdict, QObject **ret) |
1620 | { |
1621 | Error *local_err = NULL((void*)0); |
1622 | Error **errp = &local_err; |
1623 | QDict *args = (QDict *)qdict; |
1624 | QmpInputVisitor *mi; |
1625 | QapiDeallocVisitor *md; |
1626 | Visitor *v; |
1627 | char * device = NULL((void*)0); |
1628 | bool_Bool has_force = false0; |
1629 | bool_Bool force; |
1630 | |
1631 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
1632 | v = qmp_input_get_visitor(mi); |
1633 | visit_type_str(v, &device, "device", errp); |
1634 | visit_start_optional(v, &has_force, "force", errp); |
1635 | if (has_force) { |
1636 | visit_type_bool(v, &force, "force", errp); |
1637 | } |
1638 | visit_end_optional(v, errp); |
1639 | qmp_input_visitor_cleanup(mi); |
1640 | |
1641 | if (error_is_set(errp)) { |
1642 | goto out; |
1643 | } |
1644 | qmp_eject(device, has_force, force, errp); |
1645 | |
1646 | out: |
1647 | md = qapi_dealloc_visitor_new(); |
1648 | v = qapi_dealloc_get_visitor(md); |
1649 | visit_type_str(v, &device, "device", errp); |
1650 | visit_start_optional(v, &has_force, "force", errp); |
1651 | if (has_force) { |
1652 | visit_type_bool(v, &force, "force", errp); |
1653 | } |
1654 | visit_end_optional(v, errp); |
1655 | qapi_dealloc_visitor_cleanup(md); |
1656 | |
1657 | if (local_err) { |
1658 | qerror_report_err(local_err); |
1659 | error_free(local_err); |
1660 | return -1; |
1661 | } |
1662 | return 0; |
1663 | } |
1664 | |
1665 | int qmp_marshal_input_change_vnc_password(Monitor *mon, const QDict *qdict, QObject **ret) |
1666 | { |
1667 | Error *local_err = NULL((void*)0); |
1668 | Error **errp = &local_err; |
1669 | QDict *args = (QDict *)qdict; |
1670 | QmpInputVisitor *mi; |
1671 | QapiDeallocVisitor *md; |
1672 | Visitor *v; |
1673 | char * password = NULL((void*)0); |
1674 | |
1675 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
1676 | v = qmp_input_get_visitor(mi); |
1677 | visit_type_str(v, &password, "password", errp); |
1678 | qmp_input_visitor_cleanup(mi); |
1679 | |
1680 | if (error_is_set(errp)) { |
1681 | goto out; |
1682 | } |
1683 | qmp_change_vnc_password(password, errp); |
1684 | |
1685 | out: |
1686 | md = qapi_dealloc_visitor_new(); |
1687 | v = qapi_dealloc_get_visitor(md); |
1688 | visit_type_str(v, &password, "password", errp); |
1689 | qapi_dealloc_visitor_cleanup(md); |
1690 | |
1691 | if (local_err) { |
1692 | qerror_report_err(local_err); |
1693 | error_free(local_err); |
1694 | return -1; |
1695 | } |
1696 | return 0; |
1697 | } |
1698 | |
1699 | int qmp_marshal_input_change(Monitor *mon, const QDict *qdict, QObject **ret) |
1700 | { |
1701 | Error *local_err = NULL((void*)0); |
1702 | Error **errp = &local_err; |
1703 | QDict *args = (QDict *)qdict; |
1704 | QmpInputVisitor *mi; |
1705 | QapiDeallocVisitor *md; |
1706 | Visitor *v; |
1707 | char * device = NULL((void*)0); |
1708 | char * target = NULL((void*)0); |
1709 | bool_Bool has_arg = false0; |
1710 | char * arg = NULL((void*)0); |
1711 | |
1712 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
1713 | v = qmp_input_get_visitor(mi); |
1714 | visit_type_str(v, &device, "device", errp); |
1715 | visit_type_str(v, &target, "target", errp); |
1716 | visit_start_optional(v, &has_arg, "arg", errp); |
1717 | if (has_arg) { |
1718 | visit_type_str(v, &arg, "arg", errp); |
1719 | } |
1720 | visit_end_optional(v, errp); |
1721 | qmp_input_visitor_cleanup(mi); |
1722 | |
1723 | if (error_is_set(errp)) { |
1724 | goto out; |
1725 | } |
1726 | qmp_change(device, target, has_arg, arg, errp); |
1727 | |
1728 | out: |
1729 | md = qapi_dealloc_visitor_new(); |
1730 | v = qapi_dealloc_get_visitor(md); |
1731 | visit_type_str(v, &device, "device", errp); |
1732 | visit_type_str(v, &target, "target", errp); |
1733 | visit_start_optional(v, &has_arg, "arg", errp); |
1734 | if (has_arg) { |
1735 | visit_type_str(v, &arg, "arg", errp); |
1736 | } |
1737 | visit_end_optional(v, errp); |
1738 | qapi_dealloc_visitor_cleanup(md); |
1739 | |
1740 | if (local_err) { |
1741 | qerror_report_err(local_err); |
1742 | error_free(local_err); |
1743 | return -1; |
1744 | } |
1745 | return 0; |
1746 | } |
1747 | |
1748 | int qmp_marshal_input_block_set_io_throttle(Monitor *mon, const QDict *qdict, QObject **ret) |
1749 | { |
1750 | Error *local_err = NULL((void*)0); |
1751 | Error **errp = &local_err; |
1752 | QDict *args = (QDict *)qdict; |
1753 | QmpInputVisitor *mi; |
1754 | QapiDeallocVisitor *md; |
1755 | Visitor *v; |
1756 | char * device = NULL((void*)0); |
1757 | int64_t bps; |
1758 | int64_t bps_rd; |
1759 | int64_t bps_wr; |
1760 | int64_t iops; |
1761 | int64_t iops_rd; |
1762 | int64_t iops_wr; |
1763 | |
1764 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
1765 | v = qmp_input_get_visitor(mi); |
1766 | visit_type_str(v, &device, "device", errp); |
1767 | visit_type_int(v, &bps, "bps", errp); |
1768 | visit_type_int(v, &bps_rd, "bps_rd", errp); |
1769 | visit_type_int(v, &bps_wr, "bps_wr", errp); |
1770 | visit_type_int(v, &iops, "iops", errp); |
1771 | visit_type_int(v, &iops_rd, "iops_rd", errp); |
1772 | visit_type_int(v, &iops_wr, "iops_wr", errp); |
1773 | qmp_input_visitor_cleanup(mi); |
1774 | |
1775 | if (error_is_set(errp)) { |
1776 | goto out; |
1777 | } |
1778 | qmp_block_set_io_throttle(device, bps, bps_rd, bps_wr, iops, iops_rd, iops_wr, errp); |
1779 | |
1780 | out: |
1781 | md = qapi_dealloc_visitor_new(); |
1782 | v = qapi_dealloc_get_visitor(md); |
1783 | visit_type_str(v, &device, "device", errp); |
1784 | visit_type_int(v, &bps, "bps", errp); |
1785 | visit_type_int(v, &bps_rd, "bps_rd", errp); |
1786 | visit_type_int(v, &bps_wr, "bps_wr", errp); |
1787 | visit_type_int(v, &iops, "iops", errp); |
1788 | visit_type_int(v, &iops_rd, "iops_rd", errp); |
1789 | visit_type_int(v, &iops_wr, "iops_wr", errp); |
1790 | qapi_dealloc_visitor_cleanup(md); |
1791 | |
1792 | if (local_err) { |
1793 | qerror_report_err(local_err); |
1794 | error_free(local_err); |
1795 | return -1; |
1796 | } |
1797 | return 0; |
1798 | } |
1799 | |
1800 | int qmp_marshal_input_block_stream(Monitor *mon, const QDict *qdict, QObject **ret) |
1801 | { |
1802 | Error *local_err = NULL((void*)0); |
1803 | Error **errp = &local_err; |
1804 | QDict *args = (QDict *)qdict; |
1805 | QmpInputVisitor *mi; |
1806 | QapiDeallocVisitor *md; |
1807 | Visitor *v; |
1808 | char * device = NULL((void*)0); |
1809 | bool_Bool has_base = false0; |
1810 | char * base = NULL((void*)0); |
1811 | bool_Bool has_speed = false0; |
1812 | int64_t speed; |
1813 | |
1814 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
1815 | v = qmp_input_get_visitor(mi); |
1816 | visit_type_str(v, &device, "device", errp); |
1817 | visit_start_optional(v, &has_base, "base", errp); |
1818 | if (has_base) { |
1819 | visit_type_str(v, &base, "base", errp); |
1820 | } |
1821 | visit_end_optional(v, errp); |
1822 | visit_start_optional(v, &has_speed, "speed", errp); |
1823 | if (has_speed) { |
1824 | visit_type_int(v, &speed, "speed", errp); |
1825 | } |
1826 | visit_end_optional(v, errp); |
1827 | qmp_input_visitor_cleanup(mi); |
1828 | |
1829 | if (error_is_set(errp)) { |
1830 | goto out; |
1831 | } |
1832 | qmp_block_stream(device, has_base, base, has_speed, speed, errp); |
1833 | |
1834 | out: |
1835 | md = qapi_dealloc_visitor_new(); |
1836 | v = qapi_dealloc_get_visitor(md); |
1837 | visit_type_str(v, &device, "device", errp); |
1838 | visit_start_optional(v, &has_base, "base", errp); |
1839 | if (has_base) { |
1840 | visit_type_str(v, &base, "base", errp); |
1841 | } |
1842 | visit_end_optional(v, errp); |
1843 | visit_start_optional(v, &has_speed, "speed", errp); |
1844 | if (has_speed) { |
1845 | visit_type_int(v, &speed, "speed", errp); |
1846 | } |
1847 | visit_end_optional(v, errp); |
1848 | qapi_dealloc_visitor_cleanup(md); |
1849 | |
1850 | if (local_err) { |
1851 | qerror_report_err(local_err); |
1852 | error_free(local_err); |
1853 | return -1; |
1854 | } |
1855 | return 0; |
1856 | } |
1857 | |
1858 | int qmp_marshal_input_block_job_set_speed(Monitor *mon, const QDict *qdict, QObject **ret) |
1859 | { |
1860 | Error *local_err = NULL((void*)0); |
1861 | Error **errp = &local_err; |
1862 | QDict *args = (QDict *)qdict; |
1863 | QmpInputVisitor *mi; |
1864 | QapiDeallocVisitor *md; |
1865 | Visitor *v; |
1866 | char * device = NULL((void*)0); |
1867 | int64_t speed; |
1868 | |
1869 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
1870 | v = qmp_input_get_visitor(mi); |
1871 | visit_type_str(v, &device, "device", errp); |
1872 | visit_type_int(v, &speed, "speed", errp); |
1873 | qmp_input_visitor_cleanup(mi); |
1874 | |
1875 | if (error_is_set(errp)) { |
1876 | goto out; |
1877 | } |
1878 | qmp_block_job_set_speed(device, speed, errp); |
1879 | |
1880 | out: |
1881 | md = qapi_dealloc_visitor_new(); |
1882 | v = qapi_dealloc_get_visitor(md); |
1883 | visit_type_str(v, &device, "device", errp); |
1884 | visit_type_int(v, &speed, "speed", errp); |
1885 | qapi_dealloc_visitor_cleanup(md); |
1886 | |
1887 | if (local_err) { |
1888 | qerror_report_err(local_err); |
1889 | error_free(local_err); |
1890 | return -1; |
1891 | } |
1892 | return 0; |
1893 | } |
1894 | |
1895 | int qmp_marshal_input_block_job_cancel(Monitor *mon, const QDict *qdict, QObject **ret) |
1896 | { |
1897 | Error *local_err = NULL((void*)0); |
1898 | Error **errp = &local_err; |
1899 | QDict *args = (QDict *)qdict; |
1900 | QmpInputVisitor *mi; |
1901 | QapiDeallocVisitor *md; |
1902 | Visitor *v; |
1903 | char * device = NULL((void*)0); |
1904 | |
1905 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
1906 | v = qmp_input_get_visitor(mi); |
1907 | visit_type_str(v, &device, "device", errp); |
1908 | qmp_input_visitor_cleanup(mi); |
1909 | |
1910 | if (error_is_set(errp)) { |
1911 | goto out; |
1912 | } |
1913 | qmp_block_job_cancel(device, errp); |
1914 | |
1915 | out: |
1916 | md = qapi_dealloc_visitor_new(); |
1917 | v = qapi_dealloc_get_visitor(md); |
1918 | visit_type_str(v, &device, "device", errp); |
1919 | qapi_dealloc_visitor_cleanup(md); |
1920 | |
1921 | if (local_err) { |
1922 | qerror_report_err(local_err); |
1923 | error_free(local_err); |
1924 | return -1; |
1925 | } |
1926 | return 0; |
1927 | } |
1928 | |
1929 | static void qmp_marshal_output_qom_list_types(ObjectTypeInfoList * ret_in, QObject **ret_out, Error **errp) |
1930 | { |
1931 | QapiDeallocVisitor *md = qapi_dealloc_visitor_new(); |
1932 | QmpOutputVisitor *mo = qmp_output_visitor_new(); |
1933 | Visitor *v; |
1934 | |
1935 | v = qmp_output_get_visitor(mo); |
1936 | visit_type_ObjectTypeInfoList(v, &ret_in, "unused", errp); |
1937 | if (!error_is_set(errp)) { |
1938 | *ret_out = qmp_output_get_qobject(mo); |
1939 | } |
1940 | qmp_output_visitor_cleanup(mo); |
1941 | v = qapi_dealloc_get_visitor(md); |
1942 | visit_type_ObjectTypeInfoList(v, &ret_in, "unused", errp); |
1943 | qapi_dealloc_visitor_cleanup(md); |
1944 | } |
1945 | |
1946 | int qmp_marshal_input_qom_list_types(Monitor *mon, const QDict *qdict, QObject **ret) |
1947 | { |
1948 | Error *local_err = NULL((void*)0); |
1949 | Error **errp = &local_err; |
1950 | QDict *args = (QDict *)qdict; |
1951 | ObjectTypeInfoList * retval = NULL((void*)0); |
1952 | QmpInputVisitor *mi; |
1953 | QapiDeallocVisitor *md; |
1954 | Visitor *v; |
1955 | bool_Bool has_implements = false0; |
1956 | char * implements = NULL((void*)0); |
1957 | bool_Bool has_abstract = false0; |
1958 | bool_Bool abstract; |
1959 | |
1960 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
1961 | v = qmp_input_get_visitor(mi); |
1962 | visit_start_optional(v, &has_implements, "implements", errp); |
1963 | if (has_implements) { |
1964 | visit_type_str(v, &implements, "implements", errp); |
1965 | } |
1966 | visit_end_optional(v, errp); |
1967 | visit_start_optional(v, &has_abstract, "abstract", errp); |
1968 | if (has_abstract) { |
1969 | visit_type_bool(v, &abstract, "abstract", errp); |
1970 | } |
1971 | visit_end_optional(v, errp); |
1972 | qmp_input_visitor_cleanup(mi); |
1973 | |
1974 | if (error_is_set(errp)) { |
1975 | goto out; |
1976 | } |
1977 | retval = qmp_qom_list_types(has_implements, implements, has_abstract, abstract, errp); |
1978 | if (!error_is_set(errp)) { |
1979 | qmp_marshal_output_qom_list_types(retval, ret, errp); |
1980 | } |
1981 | |
1982 | out: |
1983 | md = qapi_dealloc_visitor_new(); |
1984 | v = qapi_dealloc_get_visitor(md); |
1985 | visit_start_optional(v, &has_implements, "implements", errp); |
1986 | if (has_implements) { |
1987 | visit_type_str(v, &implements, "implements", errp); |
1988 | } |
1989 | visit_end_optional(v, errp); |
1990 | visit_start_optional(v, &has_abstract, "abstract", errp); |
1991 | if (has_abstract) { |
1992 | visit_type_bool(v, &abstract, "abstract", errp); |
1993 | } |
1994 | visit_end_optional(v, errp); |
1995 | qapi_dealloc_visitor_cleanup(md); |
1996 | |
1997 | if (local_err) { |
1998 | qerror_report_err(local_err); |
1999 | error_free(local_err); |
2000 | return -1; |
2001 | } |
2002 | return 0; |
2003 | } |
2004 | |
2005 | int qmp_marshal_input_migrate(Monitor *mon, const QDict *qdict, QObject **ret) |
2006 | { |
2007 | Error *local_err = NULL((void*)0); |
2008 | Error **errp = &local_err; |
2009 | QDict *args = (QDict *)qdict; |
2010 | QmpInputVisitor *mi; |
2011 | QapiDeallocVisitor *md; |
2012 | Visitor *v; |
2013 | char * uri = NULL((void*)0); |
2014 | bool_Bool has_blk = false0; |
2015 | bool_Bool blk; |
2016 | bool_Bool has_inc = false0; |
2017 | bool_Bool inc; |
2018 | bool_Bool has_detach = false0; |
2019 | bool_Bool detach; |
2020 | |
2021 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
2022 | v = qmp_input_get_visitor(mi); |
2023 | visit_type_str(v, &uri, "uri", errp); |
2024 | visit_start_optional(v, &has_blk, "blk", errp); |
2025 | if (has_blk) { |
2026 | visit_type_bool(v, &blk, "blk", errp); |
2027 | } |
2028 | visit_end_optional(v, errp); |
2029 | visit_start_optional(v, &has_inc, "inc", errp); |
2030 | if (has_inc) { |
2031 | visit_type_bool(v, &inc, "inc", errp); |
2032 | } |
2033 | visit_end_optional(v, errp); |
2034 | visit_start_optional(v, &has_detach, "detach", errp); |
2035 | if (has_detach) { |
2036 | visit_type_bool(v, &detach, "detach", errp); |
2037 | } |
2038 | visit_end_optional(v, errp); |
2039 | qmp_input_visitor_cleanup(mi); |
2040 | |
2041 | if (error_is_set(errp)) { |
2042 | goto out; |
2043 | } |
2044 | qmp_migrate(uri, has_blk, blk, has_inc, inc, has_detach, detach, errp); |
2045 | |
2046 | out: |
2047 | md = qapi_dealloc_visitor_new(); |
2048 | v = qapi_dealloc_get_visitor(md); |
2049 | visit_type_str(v, &uri, "uri", errp); |
2050 | visit_start_optional(v, &has_blk, "blk", errp); |
2051 | if (has_blk) { |
2052 | visit_type_bool(v, &blk, "blk", errp); |
2053 | } |
2054 | visit_end_optional(v, errp); |
2055 | visit_start_optional(v, &has_inc, "inc", errp); |
2056 | if (has_inc) { |
2057 | visit_type_bool(v, &inc, "inc", errp); |
2058 | } |
2059 | visit_end_optional(v, errp); |
2060 | visit_start_optional(v, &has_detach, "detach", errp); |
2061 | if (has_detach) { |
2062 | visit_type_bool(v, &detach, "detach", errp); |
2063 | } |
2064 | visit_end_optional(v, errp); |
2065 | qapi_dealloc_visitor_cleanup(md); |
2066 | |
2067 | if (local_err) { |
2068 | qerror_report_err(local_err); |
2069 | error_free(local_err); |
2070 | return -1; |
2071 | } |
2072 | return 0; |
2073 | } |
2074 | |
2075 | int qmp_marshal_input_xen_save_devices_state(Monitor *mon, const QDict *qdict, QObject **ret) |
2076 | { |
2077 | Error *local_err = NULL((void*)0); |
2078 | Error **errp = &local_err; |
2079 | QDict *args = (QDict *)qdict; |
2080 | QmpInputVisitor *mi; |
2081 | QapiDeallocVisitor *md; |
2082 | Visitor *v; |
2083 | char * filename = NULL((void*)0); |
2084 | |
2085 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
2086 | v = qmp_input_get_visitor(mi); |
2087 | visit_type_str(v, &filename, "filename", errp); |
2088 | qmp_input_visitor_cleanup(mi); |
2089 | |
2090 | if (error_is_set(errp)) { |
2091 | goto out; |
2092 | } |
2093 | qmp_xen_save_devices_state(filename, errp); |
2094 | |
2095 | out: |
2096 | md = qapi_dealloc_visitor_new(); |
2097 | v = qapi_dealloc_get_visitor(md); |
2098 | visit_type_str(v, &filename, "filename", errp); |
2099 | qapi_dealloc_visitor_cleanup(md); |
2100 | |
2101 | if (local_err) { |
2102 | qerror_report_err(local_err); |
2103 | error_free(local_err); |
2104 | return -1; |
2105 | } |
2106 | return 0; |
2107 | } |
2108 | |
2109 | int qmp_marshal_input_device_del(Monitor *mon, const QDict *qdict, QObject **ret) |
2110 | { |
2111 | Error *local_err = NULL((void*)0); |
2112 | Error **errp = &local_err; |
2113 | QDict *args = (QDict *)qdict; |
2114 | QmpInputVisitor *mi; |
2115 | QapiDeallocVisitor *md; |
2116 | Visitor *v; |
2117 | char * id = NULL((void*)0); |
2118 | |
2119 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
2120 | v = qmp_input_get_visitor(mi); |
2121 | visit_type_str(v, &id, "id", errp); |
2122 | qmp_input_visitor_cleanup(mi); |
2123 | |
2124 | if (error_is_set(errp)) { |
2125 | goto out; |
2126 | } |
2127 | qmp_device_del(id, errp); |
2128 | |
2129 | out: |
2130 | md = qapi_dealloc_visitor_new(); |
2131 | v = qapi_dealloc_get_visitor(md); |
2132 | visit_type_str(v, &id, "id", errp); |
2133 | qapi_dealloc_visitor_cleanup(md); |
2134 | |
2135 | if (local_err) { |
2136 | qerror_report_err(local_err); |
2137 | error_free(local_err); |
2138 | return -1; |
2139 | } |
2140 | return 0; |
2141 | } |
2142 | |
2143 | int qmp_marshal_input_dump_guest_memory(Monitor *mon, const QDict *qdict, QObject **ret) |
2144 | { |
2145 | Error *local_err = NULL((void*)0); |
2146 | Error **errp = &local_err; |
2147 | QDict *args = (QDict *)qdict; |
2148 | QmpInputVisitor *mi; |
2149 | QapiDeallocVisitor *md; |
2150 | Visitor *v; |
2151 | bool_Bool paging; |
2152 | char * protocol = NULL((void*)0); |
2153 | bool_Bool has_begin = false0; |
2154 | int64_t begin; |
2155 | bool_Bool has_length = false0; |
2156 | int64_t length; |
2157 | |
2158 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
2159 | v = qmp_input_get_visitor(mi); |
2160 | visit_type_bool(v, &paging, "paging", errp); |
2161 | visit_type_str(v, &protocol, "protocol", errp); |
2162 | visit_start_optional(v, &has_begin, "begin", errp); |
2163 | if (has_begin) { |
2164 | visit_type_int(v, &begin, "begin", errp); |
2165 | } |
2166 | visit_end_optional(v, errp); |
2167 | visit_start_optional(v, &has_length, "length", errp); |
2168 | if (has_length) { |
2169 | visit_type_int(v, &length, "length", errp); |
2170 | } |
2171 | visit_end_optional(v, errp); |
2172 | qmp_input_visitor_cleanup(mi); |
2173 | |
2174 | if (error_is_set(errp)) { |
2175 | goto out; |
2176 | } |
2177 | qmp_dump_guest_memory(paging, protocol, has_begin, begin, has_length, length, errp); |
2178 | |
2179 | out: |
2180 | md = qapi_dealloc_visitor_new(); |
2181 | v = qapi_dealloc_get_visitor(md); |
2182 | visit_type_bool(v, &paging, "paging", errp); |
2183 | visit_type_str(v, &protocol, "protocol", errp); |
2184 | visit_start_optional(v, &has_begin, "begin", errp); |
2185 | if (has_begin) { |
2186 | visit_type_int(v, &begin, "begin", errp); |
2187 | } |
2188 | visit_end_optional(v, errp); |
2189 | visit_start_optional(v, &has_length, "length", errp); |
2190 | if (has_length) { |
2191 | visit_type_int(v, &length, "length", errp); |
2192 | } |
2193 | visit_end_optional(v, errp); |
2194 | qapi_dealloc_visitor_cleanup(md); |
2195 | |
2196 | if (local_err) { |
2197 | qerror_report_err(local_err); |
2198 | error_free(local_err); |
2199 | return -1; |
2200 | } |
2201 | return 0; |
2202 | } |
2203 | |
2204 | int qmp_marshal_input_netdev_del(Monitor *mon, const QDict *qdict, QObject **ret) |
2205 | { |
2206 | Error *local_err = NULL((void*)0); |
2207 | Error **errp = &local_err; |
2208 | QDict *args = (QDict *)qdict; |
2209 | QmpInputVisitor *mi; |
2210 | QapiDeallocVisitor *md; |
2211 | Visitor *v; |
2212 | char * id = NULL((void*)0); |
2213 | |
2214 | mi = qmp_input_visitor_new_strict(QOBJECT(args)(&(args)->base)); |
2215 | v = qmp_input_get_visitor(mi); |
2216 | visit_type_str(v, &id, "id", errp); |
2217 | qmp_input_visitor_cleanup(mi); |
2218 | |
2219 | if (error_is_set(errp)) { |
2220 | goto out; |
2221 | } |
2222 | qmp_netdev_del(id, errp); |
2223 | |
2224 | out: |
2225 | md = qapi_dealloc_visitor_new(); |
2226 | v = qapi_dealloc_get_visitor(md); |
2227 | visit_type_str(v, &id, "id", errp); |
2228 | qapi_dealloc_visitor_cleanup(md); |
2229 | |
2230 | if (local_err) { |
2231 | qerror_report_err(local_err); |
2232 | error_free(local_err); |
2233 | return -1; |
2234 | } |
2235 | return 0; |
2236 | } |
2237 | |