1910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner/* THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY */
2910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
3910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner/*
4910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner * schema-defined QMP->QAPI command dispatch
5910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner *
6910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner * Copyright IBM, Corp. 2011
7910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner *
8910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner * Authors:
9910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner *  Anthony Liguori   <aliguori@us.ibm.com>
10910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner *
11910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
12910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner * See the COPYING.LIB file in the top-level directory.
13910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner *
14910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner */
15910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
16910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner#include "qemu-common.h"
17910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner#include "qemu/module.h"
18910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner#include "qapi/qmp/qerror.h"
19910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner#include "qapi/qmp/types.h"
20910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner#include "qapi/qmp/dispatch.h"
21910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner#include "qapi/visitor.h"
22910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner#include "qapi/qmp-output-visitor.h"
23910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner#include "qapi/qmp-input-visitor.h"
24910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner#include "qapi/dealloc-visitor.h"
25910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner#include "qapi-types.h"
26910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner#include "qapi-visit.h"
27910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
28910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner#include "qmp-commands.h"
29910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
30910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerint qmp_marshal_input_add_client(Monitor *mon, const QDict *qdict, QObject **ret)
31910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner{
32910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Error *local_err = NULL;
33910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Error **errp = &local_err;
34910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QDict *args = (QDict *)qdict;
35910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QmpInputVisitor *mi;
36910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QapiDeallocVisitor *md;
37910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Visitor *v;
38910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    char * protocol = NULL;
39910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    char * fdname = NULL;
40910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    bool has_skipauth = false;
41910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    bool skipauth;
42910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    bool has_tls = false;
43910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    bool tls;
44910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
45910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    mi = qmp_input_visitor_new_strict(QOBJECT(args));
46910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    v = qmp_input_get_visitor(mi);
47910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_type_str(v, &protocol, "protocol", errp);
48910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_type_str(v, &fdname, "fdname", errp);
49910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_start_optional(v, &has_skipauth, "skipauth", errp);
50910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (has_skipauth) {
51910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        visit_type_bool(v, &skipauth, "skipauth", errp);
52910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
53910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_end_optional(v, errp);
54910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_start_optional(v, &has_tls, "tls", errp);
55910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (has_tls) {
56910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        visit_type_bool(v, &tls, "tls", errp);
57910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
58910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_end_optional(v, errp);
59910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    qmp_input_visitor_cleanup(mi);
60910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
61910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (error_is_set(errp)) {
62910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        goto out;
63910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
64910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    qmp_add_client(protocol, fdname, has_skipauth, skipauth, has_tls, tls, errp);
65910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
66910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerout:
67910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    md = qapi_dealloc_visitor_new();
68910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    v = qapi_dealloc_get_visitor(md);
69910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_type_str(v, &protocol, "protocol", NULL);
70910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_type_str(v, &fdname, "fdname", NULL);
71910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_start_optional(v, &has_skipauth, "skipauth", NULL);
72910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (has_skipauth) {
73910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        visit_type_bool(v, &skipauth, "skipauth", NULL);
74910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
75910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_end_optional(v, NULL);
76910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_start_optional(v, &has_tls, "tls", NULL);
77910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (has_tls) {
78910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        visit_type_bool(v, &tls, "tls", NULL);
79910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
80910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_end_optional(v, NULL);
81910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    qapi_dealloc_visitor_cleanup(md);
82910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
83910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (local_err) {
84910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        qerror_report_err(local_err);
85910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        error_free(local_err);
86910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        return -1;
87910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
88910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    return 0;
89910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner}
90910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
91910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerstatic void qmp_marshal_output_query_name(NameInfo * ret_in, QObject **ret_out, Error **errp)
92910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner{
93910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QapiDeallocVisitor *md = qapi_dealloc_visitor_new();
94910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QmpOutputVisitor *mo = qmp_output_visitor_new();
95910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Visitor *v;
96910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
97910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    v = qmp_output_get_visitor(mo);
98910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_type_NameInfo(v, &ret_in, "unused", errp);
99910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (!error_is_set(errp)) {
100910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        *ret_out = qmp_output_get_qobject(mo);
101910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
102910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    qmp_output_visitor_cleanup(mo);
103910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    v = qapi_dealloc_get_visitor(md);
104910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_type_NameInfo(v, &ret_in, "unused", NULL);
105910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    qapi_dealloc_visitor_cleanup(md);
106910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner}
107910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
108910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerint qmp_marshal_input_query_name(Monitor *mon, const QDict *qdict, QObject **ret)
109910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner{
110910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Error *local_err = NULL;
111910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Error **errp = &local_err;
112910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QDict *args = (QDict *)qdict;
113910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    NameInfo * retval = NULL;
114910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    (void)args;
115910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (error_is_set(errp)) {
116910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        goto out;
117910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
118910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    retval = qmp_query_name(errp);
119910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (!error_is_set(errp)) {
120910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        qmp_marshal_output_query_name(retval, ret, errp);
121910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
122910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
123910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerout:
124910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
125910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
126910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (local_err) {
127910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        qerror_report_err(local_err);
128910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        error_free(local_err);
129910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        return -1;
130910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
131910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    return 0;
132910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner}
133910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
134910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerstatic void qmp_marshal_output_query_version(VersionInfo * ret_in, QObject **ret_out, Error **errp)
135910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner{
136910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QapiDeallocVisitor *md = qapi_dealloc_visitor_new();
137910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QmpOutputVisitor *mo = qmp_output_visitor_new();
138910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Visitor *v;
139910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
140910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    v = qmp_output_get_visitor(mo);
141910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_type_VersionInfo(v, &ret_in, "unused", errp);
142910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (!error_is_set(errp)) {
143910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        *ret_out = qmp_output_get_qobject(mo);
144910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
145910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    qmp_output_visitor_cleanup(mo);
146910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    v = qapi_dealloc_get_visitor(md);
147910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_type_VersionInfo(v, &ret_in, "unused", NULL);
148910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    qapi_dealloc_visitor_cleanup(md);
149910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner}
150910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
151910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerint qmp_marshal_input_query_version(Monitor *mon, const QDict *qdict, QObject **ret)
152910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner{
153910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Error *local_err = NULL;
154910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Error **errp = &local_err;
155910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QDict *args = (QDict *)qdict;
156910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    VersionInfo * retval = NULL;
157910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    (void)args;
158910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (error_is_set(errp)) {
159910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        goto out;
160910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
161910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    retval = qmp_query_version(errp);
162910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (!error_is_set(errp)) {
163910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        qmp_marshal_output_query_version(retval, ret, errp);
164910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
165910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
166910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerout:
167910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
168910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
169910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (local_err) {
170910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        qerror_report_err(local_err);
171910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        error_free(local_err);
172910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        return -1;
173910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
174910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    return 0;
175910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner}
176910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
177910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerstatic void qmp_marshal_output_query_kvm(KvmInfo * ret_in, QObject **ret_out, Error **errp)
178910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner{
179910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QapiDeallocVisitor *md = qapi_dealloc_visitor_new();
180910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QmpOutputVisitor *mo = qmp_output_visitor_new();
181910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Visitor *v;
182910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
183910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    v = qmp_output_get_visitor(mo);
184910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_type_KvmInfo(v, &ret_in, "unused", errp);
185910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (!error_is_set(errp)) {
186910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        *ret_out = qmp_output_get_qobject(mo);
187910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
188910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    qmp_output_visitor_cleanup(mo);
189910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    v = qapi_dealloc_get_visitor(md);
190910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_type_KvmInfo(v, &ret_in, "unused", NULL);
191910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    qapi_dealloc_visitor_cleanup(md);
192910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner}
193910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
194910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerint qmp_marshal_input_query_kvm(Monitor *mon, const QDict *qdict, QObject **ret)
195910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner{
196910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Error *local_err = NULL;
197910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Error **errp = &local_err;
198910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QDict *args = (QDict *)qdict;
199910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    KvmInfo * retval = NULL;
200910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    (void)args;
201910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (error_is_set(errp)) {
202910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        goto out;
203910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
204910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    retval = qmp_query_kvm(errp);
205910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (!error_is_set(errp)) {
206910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        qmp_marshal_output_query_kvm(retval, ret, errp);
207910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
208910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
209910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerout:
210910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
211910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
212910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (local_err) {
213910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        qerror_report_err(local_err);
214910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        error_free(local_err);
215910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        return -1;
216910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
217910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    return 0;
218910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner}
219910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
220910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerstatic void qmp_marshal_output_query_status(StatusInfo * ret_in, QObject **ret_out, Error **errp)
221910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner{
222910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QapiDeallocVisitor *md = qapi_dealloc_visitor_new();
223910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QmpOutputVisitor *mo = qmp_output_visitor_new();
224910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Visitor *v;
225910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
226910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    v = qmp_output_get_visitor(mo);
227910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_type_StatusInfo(v, &ret_in, "unused", errp);
228910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (!error_is_set(errp)) {
229910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        *ret_out = qmp_output_get_qobject(mo);
230910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
231910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    qmp_output_visitor_cleanup(mo);
232910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    v = qapi_dealloc_get_visitor(md);
233910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_type_StatusInfo(v, &ret_in, "unused", NULL);
234910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    qapi_dealloc_visitor_cleanup(md);
235910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner}
236910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
237910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerint qmp_marshal_input_query_status(Monitor *mon, const QDict *qdict, QObject **ret)
238910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner{
239910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Error *local_err = NULL;
240910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Error **errp = &local_err;
241910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QDict *args = (QDict *)qdict;
242910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    StatusInfo * retval = NULL;
243910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    (void)args;
244910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (error_is_set(errp)) {
245910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        goto out;
246910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
247910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    retval = qmp_query_status(errp);
248910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (!error_is_set(errp)) {
249910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        qmp_marshal_output_query_status(retval, ret, errp);
250910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
251910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
252910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerout:
253910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
254910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
255910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (local_err) {
256910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        qerror_report_err(local_err);
257910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        error_free(local_err);
258910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        return -1;
259910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
260910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    return 0;
261910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner}
262910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
263910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerstatic void qmp_marshal_output_query_uuid(UuidInfo * ret_in, QObject **ret_out, Error **errp)
264910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner{
265910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QapiDeallocVisitor *md = qapi_dealloc_visitor_new();
266910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QmpOutputVisitor *mo = qmp_output_visitor_new();
267910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Visitor *v;
268910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
269910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    v = qmp_output_get_visitor(mo);
270910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_type_UuidInfo(v, &ret_in, "unused", errp);
271910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (!error_is_set(errp)) {
272910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        *ret_out = qmp_output_get_qobject(mo);
273910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
274910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    qmp_output_visitor_cleanup(mo);
275910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    v = qapi_dealloc_get_visitor(md);
276910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_type_UuidInfo(v, &ret_in, "unused", NULL);
277910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    qapi_dealloc_visitor_cleanup(md);
278910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner}
279910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
280910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerint qmp_marshal_input_query_uuid(Monitor *mon, const QDict *qdict, QObject **ret)
281910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner{
282910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Error *local_err = NULL;
283910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Error **errp = &local_err;
284910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QDict *args = (QDict *)qdict;
285910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    UuidInfo * retval = NULL;
286910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    (void)args;
287910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (error_is_set(errp)) {
288910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        goto out;
289910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
290910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    retval = qmp_query_uuid(errp);
291910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (!error_is_set(errp)) {
292910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        qmp_marshal_output_query_uuid(retval, ret, errp);
293910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
294910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
295910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerout:
296910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
297910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
298910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (local_err) {
299910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        qerror_report_err(local_err);
300910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        error_free(local_err);
301910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        return -1;
302910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
303910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    return 0;
304910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner}
305910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
306910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerstatic void qmp_marshal_output_query_chardev(ChardevInfoList * ret_in, QObject **ret_out, Error **errp)
307910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner{
308910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QapiDeallocVisitor *md = qapi_dealloc_visitor_new();
309910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QmpOutputVisitor *mo = qmp_output_visitor_new();
310910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Visitor *v;
311910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
312910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    v = qmp_output_get_visitor(mo);
313910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_type_ChardevInfoList(v, &ret_in, "unused", errp);
314910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (!error_is_set(errp)) {
315910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        *ret_out = qmp_output_get_qobject(mo);
316910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
317910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    qmp_output_visitor_cleanup(mo);
318910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    v = qapi_dealloc_get_visitor(md);
319910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_type_ChardevInfoList(v, &ret_in, "unused", NULL);
320910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    qapi_dealloc_visitor_cleanup(md);
321910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner}
322910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
323910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerint qmp_marshal_input_query_chardev(Monitor *mon, const QDict *qdict, QObject **ret)
324910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner{
325910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Error *local_err = NULL;
326910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Error **errp = &local_err;
327910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QDict *args = (QDict *)qdict;
328910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    ChardevInfoList * retval = NULL;
329910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    (void)args;
330910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (error_is_set(errp)) {
331910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        goto out;
332910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
333910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    retval = qmp_query_chardev(errp);
334910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (!error_is_set(errp)) {
335910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        qmp_marshal_output_query_chardev(retval, ret, errp);
336910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
337910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
338910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerout:
339910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
340910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
341910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (local_err) {
342910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        qerror_report_err(local_err);
343910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        error_free(local_err);
344910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        return -1;
345910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
346910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    return 0;
347910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner}
348910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
349910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerint qmp_marshal_input_ringbuf_write(Monitor *mon, const QDict *qdict, QObject **ret)
350910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner{
351910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Error *local_err = NULL;
352910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Error **errp = &local_err;
353910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QDict *args = (QDict *)qdict;
354910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QmpInputVisitor *mi;
355910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QapiDeallocVisitor *md;
356910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Visitor *v;
357910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    char * device = NULL;
358910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    char * data = NULL;
359910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    bool has_format = false;
360910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    DataFormat format;
361910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
362910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    mi = qmp_input_visitor_new_strict(QOBJECT(args));
363910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    v = qmp_input_get_visitor(mi);
364910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_type_str(v, &device, "device", errp);
365910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_type_str(v, &data, "data", errp);
366910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_start_optional(v, &has_format, "format", errp);
367910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (has_format) {
368910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        visit_type_DataFormat(v, &format, "format", errp);
369910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
370910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_end_optional(v, errp);
371910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    qmp_input_visitor_cleanup(mi);
372910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
373910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (error_is_set(errp)) {
374910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        goto out;
375910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
376910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    qmp_ringbuf_write(device, data, has_format, format, errp);
377910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
378910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerout:
379910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    md = qapi_dealloc_visitor_new();
380910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    v = qapi_dealloc_get_visitor(md);
381910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_type_str(v, &device, "device", NULL);
382910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_type_str(v, &data, "data", NULL);
383910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_start_optional(v, &has_format, "format", NULL);
384910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (has_format) {
385910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        visit_type_DataFormat(v, &format, "format", NULL);
386910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
387910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_end_optional(v, NULL);
388910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    qapi_dealloc_visitor_cleanup(md);
389910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
390910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (local_err) {
391910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        qerror_report_err(local_err);
392910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        error_free(local_err);
393910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        return -1;
394910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
395910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    return 0;
396910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner}
397910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
398910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerstatic void qmp_marshal_output_ringbuf_read(char * ret_in, QObject **ret_out, Error **errp)
399910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner{
400910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QapiDeallocVisitor *md = qapi_dealloc_visitor_new();
401910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QmpOutputVisitor *mo = qmp_output_visitor_new();
402910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Visitor *v;
403910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
404910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    v = qmp_output_get_visitor(mo);
405910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_type_str(v, &ret_in, "unused", errp);
406910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (!error_is_set(errp)) {
407910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        *ret_out = qmp_output_get_qobject(mo);
408910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
409910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    qmp_output_visitor_cleanup(mo);
410910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    v = qapi_dealloc_get_visitor(md);
411910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_type_str(v, &ret_in, "unused", NULL);
412910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    qapi_dealloc_visitor_cleanup(md);
413910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner}
414910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
415910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerint qmp_marshal_input_ringbuf_read(Monitor *mon, const QDict *qdict, QObject **ret)
416910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner{
417910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Error *local_err = NULL;
418910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Error **errp = &local_err;
419910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QDict *args = (QDict *)qdict;
420910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    char * retval = NULL;
421910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QmpInputVisitor *mi;
422910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QapiDeallocVisitor *md;
423910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Visitor *v;
424910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    char * device = NULL;
425910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    int64_t size;
426910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    bool has_format = false;
427910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    DataFormat format;
428910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
429910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    mi = qmp_input_visitor_new_strict(QOBJECT(args));
430910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    v = qmp_input_get_visitor(mi);
431910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_type_str(v, &device, "device", errp);
432910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_type_int(v, &size, "size", errp);
433910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_start_optional(v, &has_format, "format", errp);
434910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (has_format) {
435910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        visit_type_DataFormat(v, &format, "format", errp);
436910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
437910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_end_optional(v, errp);
438910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    qmp_input_visitor_cleanup(mi);
439910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
440910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (error_is_set(errp)) {
441910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        goto out;
442910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
443910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    retval = qmp_ringbuf_read(device, size, has_format, format, errp);
444910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (!error_is_set(errp)) {
445910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        qmp_marshal_output_ringbuf_read(retval, ret, errp);
446910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
447910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
448910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerout:
449910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    md = qapi_dealloc_visitor_new();
450910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    v = qapi_dealloc_get_visitor(md);
451910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_type_str(v, &device, "device", NULL);
452910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_type_int(v, &size, "size", NULL);
453910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_start_optional(v, &has_format, "format", NULL);
454910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (has_format) {
455910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        visit_type_DataFormat(v, &format, "format", NULL);
456910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
457910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_end_optional(v, NULL);
458910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    qapi_dealloc_visitor_cleanup(md);
459910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
460910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (local_err) {
461910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        qerror_report_err(local_err);
462910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        error_free(local_err);
463910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        return -1;
464910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
465910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    return 0;
466910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner}
467910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
468910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerstatic void qmp_marshal_output_query_commands(CommandInfoList * ret_in, QObject **ret_out, Error **errp)
469910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner{
470910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QapiDeallocVisitor *md = qapi_dealloc_visitor_new();
471910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QmpOutputVisitor *mo = qmp_output_visitor_new();
472910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Visitor *v;
473910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
474910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    v = qmp_output_get_visitor(mo);
475910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_type_CommandInfoList(v, &ret_in, "unused", errp);
476910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (!error_is_set(errp)) {
477910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        *ret_out = qmp_output_get_qobject(mo);
478910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
479910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    qmp_output_visitor_cleanup(mo);
480910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    v = qapi_dealloc_get_visitor(md);
481910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_type_CommandInfoList(v, &ret_in, "unused", NULL);
482910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    qapi_dealloc_visitor_cleanup(md);
483910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner}
484910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
485910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerint qmp_marshal_input_query_commands(Monitor *mon, const QDict *qdict, QObject **ret)
486910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner{
487910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Error *local_err = NULL;
488910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Error **errp = &local_err;
489910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QDict *args = (QDict *)qdict;
490910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    CommandInfoList * retval = NULL;
491910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    (void)args;
492910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (error_is_set(errp)) {
493910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        goto out;
494910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
495910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    retval = qmp_query_commands(errp);
496910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (!error_is_set(errp)) {
497910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        qmp_marshal_output_query_commands(retval, ret, errp);
498910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
499910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
500910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerout:
501910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
502910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
503910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (local_err) {
504910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        qerror_report_err(local_err);
505910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        error_free(local_err);
506910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        return -1;
507910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
508910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    return 0;
509910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner}
510910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
511910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerstatic void qmp_marshal_output_query_events(EventInfoList * ret_in, QObject **ret_out, Error **errp)
512910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner{
513910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QapiDeallocVisitor *md = qapi_dealloc_visitor_new();
514910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QmpOutputVisitor *mo = qmp_output_visitor_new();
515910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Visitor *v;
516910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
517910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    v = qmp_output_get_visitor(mo);
518910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_type_EventInfoList(v, &ret_in, "unused", errp);
519910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (!error_is_set(errp)) {
520910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        *ret_out = qmp_output_get_qobject(mo);
521910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
522910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    qmp_output_visitor_cleanup(mo);
523910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    v = qapi_dealloc_get_visitor(md);
524910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_type_EventInfoList(v, &ret_in, "unused", NULL);
525910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    qapi_dealloc_visitor_cleanup(md);
526910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner}
527910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
528910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerint qmp_marshal_input_query_events(Monitor *mon, const QDict *qdict, QObject **ret)
529910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner{
530910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Error *local_err = NULL;
531910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Error **errp = &local_err;
532910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QDict *args = (QDict *)qdict;
533910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    EventInfoList * retval = NULL;
534910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    (void)args;
535910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (error_is_set(errp)) {
536910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        goto out;
537910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
538910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    retval = qmp_query_events(errp);
539910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (!error_is_set(errp)) {
540910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        qmp_marshal_output_query_events(retval, ret, errp);
541910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
542910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
543910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerout:
544910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
545910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
546910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (local_err) {
547910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        qerror_report_err(local_err);
548910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        error_free(local_err);
549910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        return -1;
550910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
551910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    return 0;
552910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner}
553910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
554910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerstatic void qmp_marshal_output_query_migrate(MigrationInfo * ret_in, QObject **ret_out, Error **errp)
555910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner{
556910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QapiDeallocVisitor *md = qapi_dealloc_visitor_new();
557910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QmpOutputVisitor *mo = qmp_output_visitor_new();
558910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Visitor *v;
559910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
560910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    v = qmp_output_get_visitor(mo);
561910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_type_MigrationInfo(v, &ret_in, "unused", errp);
562910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (!error_is_set(errp)) {
563910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        *ret_out = qmp_output_get_qobject(mo);
564910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
565910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    qmp_output_visitor_cleanup(mo);
566910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    v = qapi_dealloc_get_visitor(md);
567910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_type_MigrationInfo(v, &ret_in, "unused", NULL);
568910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    qapi_dealloc_visitor_cleanup(md);
569910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner}
570910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
571910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerint qmp_marshal_input_query_migrate(Monitor *mon, const QDict *qdict, QObject **ret)
572910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner{
573910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Error *local_err = NULL;
574910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Error **errp = &local_err;
575910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QDict *args = (QDict *)qdict;
576910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    MigrationInfo * retval = NULL;
577910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    (void)args;
578910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (error_is_set(errp)) {
579910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        goto out;
580910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
581910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    retval = qmp_query_migrate(errp);
582910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (!error_is_set(errp)) {
583910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        qmp_marshal_output_query_migrate(retval, ret, errp);
584910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
585910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
586910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerout:
587910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
588910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
589910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (local_err) {
590910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        qerror_report_err(local_err);
591910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        error_free(local_err);
592910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        return -1;
593910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
594910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    return 0;
595910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner}
596910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
597910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerint qmp_marshal_input_migrate_set_capabilities(Monitor *mon, const QDict *qdict, QObject **ret)
598910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner{
599910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Error *local_err = NULL;
600910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Error **errp = &local_err;
601910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QDict *args = (QDict *)qdict;
602910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QmpInputVisitor *mi;
603910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    QapiDeallocVisitor *md;
604910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    Visitor *v;
605910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    MigrationCapabilityStatusList * capabilities = NULL;
606910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
607910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    mi = qmp_input_visitor_new_strict(QOBJECT(args));
608910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    v = qmp_input_get_visitor(mi);
609910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_type_MigrationCapabilityStatusList(v, &capabilities, "capabilities", errp);
610910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    qmp_input_visitor_cleanup(mi);
611910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
612910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (error_is_set(errp)) {
613910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        goto out;
614910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
615910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    qmp_migrate_set_capabilities(capabilities, errp);
616910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
617910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turnerout:
618910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    md = qapi_dealloc_visitor_new();
619910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    v = qapi_dealloc_get_visitor(md);
620910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    visit_type_MigrationCapabilityStatusList(v, &capabilities, "capabilities", NULL);
621910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    qapi_dealloc_visitor_cleanup(md);
622910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner
623910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    if (local_err) {
624910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        qerror_report_err(local_err);
625910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        error_free(local_err);
626910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner        return -1;
627910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    }
628910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner    return 0;
629910aea96b67d7f0357f586c47f20848ec435aa1bDavid 'Digit' Turner}
630