1/* AUTOMATICALLY GENERATED, DO NOT MODIFY */
2
3/*
4 * Schema-defined QAPI/QMP commands
5 *
6 * Copyright IBM, Corp. 2011
7 * Copyright (C) 2014-2018 Red Hat, Inc.
8 *
9 * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
10 * See the COPYING.LIB file in the top-level directory.
11 */
12
13#include "qemu/osdep.h"
14#include "qapi/visitor.h"
15#include "qapi/qmp/qdict.h"
16#include "qapi/qobject-output-visitor.h"
17#include "qapi/qobject-input-visitor.h"
18#include "qapi/dealloc-visitor.h"
19#include "qapi/error.h"
20#include "qapi-visit-run-state.h"
21#include "qapi-commands-run-state.h"
22
23
24static void qmp_marshal_output_StatusInfo(StatusInfo *ret_in, QObject **ret_out, Error **errp)
25{
26 Error *err = NULL;
27 Visitor *v;
28
29 v = qobject_output_visitor_new(ret_out);
30 visit_type_StatusInfo(v, "unused", &ret_in, &err);
31 if (!err) {
32 visit_complete(v, ret_out);
33 }
34 error_propagate(errp, err);
35 visit_free(v);
36 v = qapi_dealloc_visitor_new();
37 visit_type_StatusInfo(v, "unused", &ret_in, NULL);
38 visit_free(v);
39}
40
41void qmp_marshal_query_status(QDict *args, QObject **ret, Error **errp)
42{
43 Error *err = NULL;
44 StatusInfo *retval;
45 Visitor *v = NULL;
46
47 if (args) {
48 v = qobject_input_visitor_new(QOBJECT(args));
49 visit_start_struct(v, NULL, NULL, 0, &err);
50 if (err) {
51 goto out;
52 }
53
54 if (!err) {
55 visit_check_struct(v, &err);
56 }
57 visit_end_struct(v, NULL);
58 if (err) {
59 goto out;
60 }
61 }
62
63 retval = qmp_query_status(&err);
64 if (err) {
65 goto out;
66 }
67
68 qmp_marshal_output_StatusInfo(retval, ret, &err);
69
70out:
71 error_propagate(errp, err);
72 visit_free(v);
73 if (args) {
74 v = qapi_dealloc_visitor_new();
75 visit_start_struct(v, NULL, NULL, 0, NULL);
76
77 visit_end_struct(v, NULL);
78 visit_free(v);
79 }
80}
81
82void qmp_marshal_watchdog_set_action(QDict *args, QObject **ret, Error **errp)
83{
84 Error *err = NULL;
85 Visitor *v;
86 q_obj_watchdog_set_action_arg arg = {0};
87
88 v = qobject_input_visitor_new(QOBJECT(args));
89 visit_start_struct(v, NULL, NULL, 0, &err);
90 if (err) {
91 goto out;
92 }
93 visit_type_q_obj_watchdog_set_action_arg_members(v, &arg, &err);
94 if (!err) {
95 visit_check_struct(v, &err);
96 }
97 visit_end_struct(v, NULL);
98 if (err) {
99 goto out;
100 }
101
102 qmp_watchdog_set_action(arg.action, &err);
103
104out:
105 error_propagate(errp, err);
106 visit_free(v);
107 v = qapi_dealloc_visitor_new();
108 visit_start_struct(v, NULL, NULL, 0, NULL);
109 visit_type_q_obj_watchdog_set_action_arg_members(v, &arg, NULL);
110 visit_end_struct(v, NULL);
111 visit_free(v);
112}
113
114/* Dummy declaration to prevent empty .o file */
115char qapi_dummy_qapi_commands_run_state_c;
116