root / qapi / qmp-input-visitor.c @ f28359d8
History | View | Annotate | Download (8 kB)
1 | c40cc0a0 | Michael Roth | /*
|
---|---|---|---|
2 | c40cc0a0 | Michael Roth | * Input Visitor
|
3 | c40cc0a0 | Michael Roth | *
|
4 | c40cc0a0 | Michael Roth | * Copyright IBM, Corp. 2011
|
5 | c40cc0a0 | Michael Roth | *
|
6 | c40cc0a0 | Michael Roth | * Authors:
|
7 | c40cc0a0 | Michael Roth | * Anthony Liguori <aliguori@us.ibm.com>
|
8 | c40cc0a0 | Michael Roth | *
|
9 | c40cc0a0 | Michael Roth | * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
|
10 | c40cc0a0 | Michael Roth | * See the COPYING.LIB file in the top-level directory.
|
11 | c40cc0a0 | Michael Roth | *
|
12 | c40cc0a0 | Michael Roth | */
|
13 | c40cc0a0 | Michael Roth | |
14 | c40cc0a0 | Michael Roth | #include "qmp-input-visitor.h" |
15 | 0f71a1e0 | Paolo Bonzini | #include "qapi/qapi-visit-impl.h" |
16 | c40cc0a0 | Michael Roth | #include "qemu-queue.h" |
17 | c40cc0a0 | Michael Roth | #include "qemu-common.h" |
18 | c40cc0a0 | Michael Roth | #include "qemu-objects.h" |
19 | c40cc0a0 | Michael Roth | #include "qerror.h" |
20 | c40cc0a0 | Michael Roth | |
21 | c40cc0a0 | Michael Roth | #define QIV_STACK_SIZE 1024 |
22 | c40cc0a0 | Michael Roth | |
23 | c40cc0a0 | Michael Roth | typedef struct StackObject |
24 | c40cc0a0 | Michael Roth | { |
25 | 4faaec6a | Paolo Bonzini | QObject *obj; |
26 | 4faaec6a | Paolo Bonzini | const QListEntry *entry;
|
27 | e38ac962 | Paolo Bonzini | GHashTable *h; |
28 | c40cc0a0 | Michael Roth | } StackObject; |
29 | c40cc0a0 | Michael Roth | |
30 | c40cc0a0 | Michael Roth | struct QmpInputVisitor
|
31 | c40cc0a0 | Michael Roth | { |
32 | c40cc0a0 | Michael Roth | Visitor visitor; |
33 | c40cc0a0 | Michael Roth | StackObject stack[QIV_STACK_SIZE]; |
34 | c40cc0a0 | Michael Roth | int nb_stack;
|
35 | e38ac962 | Paolo Bonzini | bool strict;
|
36 | c40cc0a0 | Michael Roth | }; |
37 | c40cc0a0 | Michael Roth | |
38 | c40cc0a0 | Michael Roth | static QmpInputVisitor *to_qiv(Visitor *v)
|
39 | c40cc0a0 | Michael Roth | { |
40 | c40cc0a0 | Michael Roth | return container_of(v, QmpInputVisitor, visitor);
|
41 | c40cc0a0 | Michael Roth | } |
42 | c40cc0a0 | Michael Roth | |
43 | 4faaec6a | Paolo Bonzini | static QObject *qmp_input_get_object(QmpInputVisitor *qiv,
|
44 | 4faaec6a | Paolo Bonzini | const char *name) |
45 | c40cc0a0 | Michael Roth | { |
46 | 4faaec6a | Paolo Bonzini | QObject *qobj = qiv->stack[qiv->nb_stack - 1].obj;
|
47 | c40cc0a0 | Michael Roth | |
48 | 47c6d3ec | Paolo Bonzini | if (qobj) {
|
49 | 47c6d3ec | Paolo Bonzini | if (name && qobject_type(qobj) == QTYPE_QDICT) {
|
50 | e38ac962 | Paolo Bonzini | if (qiv->stack[qiv->nb_stack - 1].h) { |
51 | e38ac962 | Paolo Bonzini | g_hash_table_remove(qiv->stack[qiv->nb_stack - 1].h, name);
|
52 | e38ac962 | Paolo Bonzini | } |
53 | 47c6d3ec | Paolo Bonzini | return qdict_get(qobject_to_qdict(qobj), name);
|
54 | 4faaec6a | Paolo Bonzini | } else if (qiv->stack[qiv->nb_stack - 1].entry) { |
55 | 47c6d3ec | Paolo Bonzini | return qlist_entry_obj(qiv->stack[qiv->nb_stack - 1].entry); |
56 | 47c6d3ec | Paolo Bonzini | } |
57 | c40cc0a0 | Michael Roth | } |
58 | c40cc0a0 | Michael Roth | |
59 | c40cc0a0 | Michael Roth | return qobj;
|
60 | c40cc0a0 | Michael Roth | } |
61 | c40cc0a0 | Michael Roth | |
62 | e38ac962 | Paolo Bonzini | static void qdict_add_key(const char *key, QObject *obj, void *opaque) |
63 | e38ac962 | Paolo Bonzini | { |
64 | e38ac962 | Paolo Bonzini | GHashTable *h = opaque; |
65 | e38ac962 | Paolo Bonzini | g_hash_table_insert(h, (gpointer) key, NULL);
|
66 | e38ac962 | Paolo Bonzini | } |
67 | e38ac962 | Paolo Bonzini | |
68 | 4faaec6a | Paolo Bonzini | static void qmp_input_push(QmpInputVisitor *qiv, QObject *obj, Error **errp) |
69 | c40cc0a0 | Michael Roth | { |
70 | e38ac962 | Paolo Bonzini | GHashTable *h; |
71 | c40cc0a0 | Michael Roth | |
72 | c40cc0a0 | Michael Roth | if (qiv->nb_stack >= QIV_STACK_SIZE) {
|
73 | c40cc0a0 | Michael Roth | error_set(errp, QERR_BUFFER_OVERRUN); |
74 | c40cc0a0 | Michael Roth | return;
|
75 | c40cc0a0 | Michael Roth | } |
76 | e38ac962 | Paolo Bonzini | |
77 | e38ac962 | Paolo Bonzini | qiv->stack[qiv->nb_stack].obj = obj; |
78 | e38ac962 | Paolo Bonzini | qiv->stack[qiv->nb_stack].entry = NULL;
|
79 | e38ac962 | Paolo Bonzini | qiv->stack[qiv->nb_stack].h = NULL;
|
80 | e38ac962 | Paolo Bonzini | |
81 | e38ac962 | Paolo Bonzini | if (qiv->strict && qobject_type(obj) == QTYPE_QDICT) {
|
82 | e38ac962 | Paolo Bonzini | h = g_hash_table_new(g_str_hash, g_str_equal); |
83 | e38ac962 | Paolo Bonzini | qdict_iter(qobject_to_qdict(obj), qdict_add_key, h); |
84 | e38ac962 | Paolo Bonzini | qiv->stack[qiv->nb_stack].h = h; |
85 | e38ac962 | Paolo Bonzini | } |
86 | e38ac962 | Paolo Bonzini | |
87 | e38ac962 | Paolo Bonzini | qiv->nb_stack++; |
88 | c40cc0a0 | Michael Roth | } |
89 | c40cc0a0 | Michael Roth | |
90 | 57a33d89 | NODA, Kai | /** Only for qmp_input_pop. */
|
91 | 57a33d89 | NODA, Kai | static gboolean always_true(gpointer key, gpointer val, gpointer user_pkey)
|
92 | 57a33d89 | NODA, Kai | { |
93 | 57a33d89 | NODA, Kai | *(const char **)user_pkey = (const char *)key; |
94 | 57a33d89 | NODA, Kai | return TRUE;
|
95 | 57a33d89 | NODA, Kai | } |
96 | 57a33d89 | NODA, Kai | |
97 | c40cc0a0 | Michael Roth | static void qmp_input_pop(QmpInputVisitor *qiv, Error **errp) |
98 | c40cc0a0 | Michael Roth | { |
99 | 57a33d89 | NODA, Kai | assert(qiv->nb_stack > 0);
|
100 | e38ac962 | Paolo Bonzini | |
101 | 57a33d89 | NODA, Kai | if (qiv->strict) {
|
102 | 57a33d89 | NODA, Kai | GHashTable * const top_ht = qiv->stack[qiv->nb_stack - 1].h; |
103 | 57a33d89 | NODA, Kai | if (top_ht) {
|
104 | 57a33d89 | NODA, Kai | if (g_hash_table_size(top_ht)) {
|
105 | 57a33d89 | NODA, Kai | const char *key; |
106 | 57a33d89 | NODA, Kai | g_hash_table_find(top_ht, always_true, &key); |
107 | 57a33d89 | NODA, Kai | error_set(errp, QERR_QMP_EXTRA_MEMBER, key); |
108 | 57a33d89 | NODA, Kai | } |
109 | 57a33d89 | NODA, Kai | g_hash_table_unref(top_ht); |
110 | e38ac962 | Paolo Bonzini | } |
111 | e38ac962 | Paolo Bonzini | } |
112 | e38ac962 | Paolo Bonzini | |
113 | c40cc0a0 | Michael Roth | qiv->nb_stack--; |
114 | c40cc0a0 | Michael Roth | } |
115 | c40cc0a0 | Michael Roth | |
116 | c40cc0a0 | Michael Roth | static void qmp_input_start_struct(Visitor *v, void **obj, const char *kind, |
117 | c40cc0a0 | Michael Roth | const char *name, size_t size, Error **errp) |
118 | c40cc0a0 | Michael Roth | { |
119 | c40cc0a0 | Michael Roth | QmpInputVisitor *qiv = to_qiv(v); |
120 | 4faaec6a | Paolo Bonzini | QObject *qobj = qmp_input_get_object(qiv, name); |
121 | 8b714d37 | Paolo Bonzini | Error *err = NULL;
|
122 | c40cc0a0 | Michael Roth | |
123 | c40cc0a0 | Michael Roth | if (!qobj || qobject_type(qobj) != QTYPE_QDICT) {
|
124 | c40cc0a0 | Michael Roth | error_set(errp, QERR_INVALID_PARAMETER_TYPE, name ? name : "null",
|
125 | c40cc0a0 | Michael Roth | "QDict");
|
126 | c40cc0a0 | Michael Roth | return;
|
127 | c40cc0a0 | Michael Roth | } |
128 | c40cc0a0 | Michael Roth | |
129 | 8b714d37 | Paolo Bonzini | qmp_input_push(qiv, qobj, &err); |
130 | 8b714d37 | Paolo Bonzini | if (err) {
|
131 | 8b714d37 | Paolo Bonzini | error_propagate(errp, err); |
132 | c40cc0a0 | Michael Roth | return;
|
133 | c40cc0a0 | Michael Roth | } |
134 | c40cc0a0 | Michael Roth | |
135 | c40cc0a0 | Michael Roth | if (obj) {
|
136 | 7267c094 | Anthony Liguori | *obj = g_malloc0(size); |
137 | c40cc0a0 | Michael Roth | } |
138 | c40cc0a0 | Michael Roth | } |
139 | c40cc0a0 | Michael Roth | |
140 | c40cc0a0 | Michael Roth | static void qmp_input_end_struct(Visitor *v, Error **errp) |
141 | c40cc0a0 | Michael Roth | { |
142 | c40cc0a0 | Michael Roth | QmpInputVisitor *qiv = to_qiv(v); |
143 | c40cc0a0 | Michael Roth | |
144 | c40cc0a0 | Michael Roth | qmp_input_pop(qiv, errp); |
145 | c40cc0a0 | Michael Roth | } |
146 | c40cc0a0 | Michael Roth | |
147 | c40cc0a0 | Michael Roth | static void qmp_input_start_list(Visitor *v, const char *name, Error **errp) |
148 | c40cc0a0 | Michael Roth | { |
149 | c40cc0a0 | Michael Roth | QmpInputVisitor *qiv = to_qiv(v); |
150 | 4faaec6a | Paolo Bonzini | QObject *qobj = qmp_input_get_object(qiv, name); |
151 | c40cc0a0 | Michael Roth | |
152 | c40cc0a0 | Michael Roth | if (!qobj || qobject_type(qobj) != QTYPE_QLIST) {
|
153 | c40cc0a0 | Michael Roth | error_set(errp, QERR_INVALID_PARAMETER_TYPE, name ? name : "null",
|
154 | c40cc0a0 | Michael Roth | "list");
|
155 | c40cc0a0 | Michael Roth | return;
|
156 | c40cc0a0 | Michael Roth | } |
157 | c40cc0a0 | Michael Roth | |
158 | c40cc0a0 | Michael Roth | qmp_input_push(qiv, qobj, errp); |
159 | c40cc0a0 | Michael Roth | } |
160 | c40cc0a0 | Michael Roth | |
161 | c40cc0a0 | Michael Roth | static GenericList *qmp_input_next_list(Visitor *v, GenericList **list,
|
162 | c40cc0a0 | Michael Roth | Error **errp) |
163 | c40cc0a0 | Michael Roth | { |
164 | c40cc0a0 | Michael Roth | QmpInputVisitor *qiv = to_qiv(v); |
165 | c40cc0a0 | Michael Roth | GenericList *entry; |
166 | c40cc0a0 | Michael Roth | StackObject *so = &qiv->stack[qiv->nb_stack - 1];
|
167 | 3a86a0fa | Paolo Bonzini | bool first;
|
168 | 3a86a0fa | Paolo Bonzini | |
169 | 3a86a0fa | Paolo Bonzini | if (so->entry == NULL) { |
170 | 3a86a0fa | Paolo Bonzini | so->entry = qlist_first(qobject_to_qlist(so->obj)); |
171 | 3a86a0fa | Paolo Bonzini | first = true;
|
172 | 3a86a0fa | Paolo Bonzini | } else {
|
173 | 3a86a0fa | Paolo Bonzini | so->entry = qlist_next(so->entry); |
174 | 3a86a0fa | Paolo Bonzini | first = false;
|
175 | 3a86a0fa | Paolo Bonzini | } |
176 | c40cc0a0 | Michael Roth | |
177 | c40cc0a0 | Michael Roth | if (so->entry == NULL) { |
178 | c40cc0a0 | Michael Roth | return NULL; |
179 | c40cc0a0 | Michael Roth | } |
180 | c40cc0a0 | Michael Roth | |
181 | 7267c094 | Anthony Liguori | entry = g_malloc0(sizeof(*entry));
|
182 | 3a86a0fa | Paolo Bonzini | if (first) {
|
183 | 3a86a0fa | Paolo Bonzini | *list = entry; |
184 | 3a86a0fa | Paolo Bonzini | } else {
|
185 | c40cc0a0 | Michael Roth | (*list)->next = entry; |
186 | c40cc0a0 | Michael Roth | } |
187 | c40cc0a0 | Michael Roth | |
188 | c40cc0a0 | Michael Roth | return entry;
|
189 | c40cc0a0 | Michael Roth | } |
190 | c40cc0a0 | Michael Roth | |
191 | c40cc0a0 | Michael Roth | static void qmp_input_end_list(Visitor *v, Error **errp) |
192 | c40cc0a0 | Michael Roth | { |
193 | c40cc0a0 | Michael Roth | QmpInputVisitor *qiv = to_qiv(v); |
194 | c40cc0a0 | Michael Roth | |
195 | c40cc0a0 | Michael Roth | qmp_input_pop(qiv, errp); |
196 | c40cc0a0 | Michael Roth | } |
197 | c40cc0a0 | Michael Roth | |
198 | c40cc0a0 | Michael Roth | static void qmp_input_type_int(Visitor *v, int64_t *obj, const char *name, |
199 | c40cc0a0 | Michael Roth | Error **errp) |
200 | c40cc0a0 | Michael Roth | { |
201 | c40cc0a0 | Michael Roth | QmpInputVisitor *qiv = to_qiv(v); |
202 | 4faaec6a | Paolo Bonzini | QObject *qobj = qmp_input_get_object(qiv, name); |
203 | c40cc0a0 | Michael Roth | |
204 | c40cc0a0 | Michael Roth | if (!qobj || qobject_type(qobj) != QTYPE_QINT) {
|
205 | c40cc0a0 | Michael Roth | error_set(errp, QERR_INVALID_PARAMETER_TYPE, name ? name : "null",
|
206 | c40cc0a0 | Michael Roth | "integer");
|
207 | c40cc0a0 | Michael Roth | return;
|
208 | c40cc0a0 | Michael Roth | } |
209 | c40cc0a0 | Michael Roth | |
210 | c40cc0a0 | Michael Roth | *obj = qint_get_int(qobject_to_qint(qobj)); |
211 | c40cc0a0 | Michael Roth | } |
212 | c40cc0a0 | Michael Roth | |
213 | c40cc0a0 | Michael Roth | static void qmp_input_type_bool(Visitor *v, bool *obj, const char *name, |
214 | c40cc0a0 | Michael Roth | Error **errp) |
215 | c40cc0a0 | Michael Roth | { |
216 | c40cc0a0 | Michael Roth | QmpInputVisitor *qiv = to_qiv(v); |
217 | 4faaec6a | Paolo Bonzini | QObject *qobj = qmp_input_get_object(qiv, name); |
218 | c40cc0a0 | Michael Roth | |
219 | c40cc0a0 | Michael Roth | if (!qobj || qobject_type(qobj) != QTYPE_QBOOL) {
|
220 | c40cc0a0 | Michael Roth | error_set(errp, QERR_INVALID_PARAMETER_TYPE, name ? name : "null",
|
221 | c40cc0a0 | Michael Roth | "boolean");
|
222 | c40cc0a0 | Michael Roth | return;
|
223 | c40cc0a0 | Michael Roth | } |
224 | c40cc0a0 | Michael Roth | |
225 | c40cc0a0 | Michael Roth | *obj = qbool_get_int(qobject_to_qbool(qobj)); |
226 | c40cc0a0 | Michael Roth | } |
227 | c40cc0a0 | Michael Roth | |
228 | c40cc0a0 | Michael Roth | static void qmp_input_type_str(Visitor *v, char **obj, const char *name, |
229 | c40cc0a0 | Michael Roth | Error **errp) |
230 | c40cc0a0 | Michael Roth | { |
231 | c40cc0a0 | Michael Roth | QmpInputVisitor *qiv = to_qiv(v); |
232 | 4faaec6a | Paolo Bonzini | QObject *qobj = qmp_input_get_object(qiv, name); |
233 | c40cc0a0 | Michael Roth | |
234 | c40cc0a0 | Michael Roth | if (!qobj || qobject_type(qobj) != QTYPE_QSTRING) {
|
235 | c40cc0a0 | Michael Roth | error_set(errp, QERR_INVALID_PARAMETER_TYPE, name ? name : "null",
|
236 | c40cc0a0 | Michael Roth | "string");
|
237 | c40cc0a0 | Michael Roth | return;
|
238 | c40cc0a0 | Michael Roth | } |
239 | c40cc0a0 | Michael Roth | |
240 | 7267c094 | Anthony Liguori | *obj = g_strdup(qstring_get_str(qobject_to_qstring(qobj))); |
241 | c40cc0a0 | Michael Roth | } |
242 | c40cc0a0 | Michael Roth | |
243 | c40cc0a0 | Michael Roth | static void qmp_input_type_number(Visitor *v, double *obj, const char *name, |
244 | c40cc0a0 | Michael Roth | Error **errp) |
245 | c40cc0a0 | Michael Roth | { |
246 | c40cc0a0 | Michael Roth | QmpInputVisitor *qiv = to_qiv(v); |
247 | 4faaec6a | Paolo Bonzini | QObject *qobj = qmp_input_get_object(qiv, name); |
248 | c40cc0a0 | Michael Roth | |
249 | 1ee51876 | Michael Roth | if (!qobj || (qobject_type(qobj) != QTYPE_QFLOAT &&
|
250 | 1ee51876 | Michael Roth | qobject_type(qobj) != QTYPE_QINT)) { |
251 | c40cc0a0 | Michael Roth | error_set(errp, QERR_INVALID_PARAMETER_TYPE, name ? name : "null",
|
252 | 1ee51876 | Michael Roth | "number");
|
253 | c40cc0a0 | Michael Roth | return;
|
254 | c40cc0a0 | Michael Roth | } |
255 | c40cc0a0 | Michael Roth | |
256 | 1ee51876 | Michael Roth | if (qobject_type(qobj) == QTYPE_QINT) {
|
257 | 1ee51876 | Michael Roth | *obj = qint_get_int(qobject_to_qint(qobj)); |
258 | 1ee51876 | Michael Roth | } else {
|
259 | 1ee51876 | Michael Roth | *obj = qfloat_get_double(qobject_to_qfloat(qobj)); |
260 | 1ee51876 | Michael Roth | } |
261 | c40cc0a0 | Michael Roth | } |
262 | c40cc0a0 | Michael Roth | |
263 | c40cc0a0 | Michael Roth | static void qmp_input_start_optional(Visitor *v, bool *present, |
264 | c40cc0a0 | Michael Roth | const char *name, Error **errp) |
265 | c40cc0a0 | Michael Roth | { |
266 | c40cc0a0 | Michael Roth | QmpInputVisitor *qiv = to_qiv(v); |
267 | 4faaec6a | Paolo Bonzini | QObject *qobj = qmp_input_get_object(qiv, name); |
268 | c40cc0a0 | Michael Roth | |
269 | c40cc0a0 | Michael Roth | if (!qobj) {
|
270 | c40cc0a0 | Michael Roth | *present = false;
|
271 | c40cc0a0 | Michael Roth | return;
|
272 | c40cc0a0 | Michael Roth | } |
273 | c40cc0a0 | Michael Roth | |
274 | c40cc0a0 | Michael Roth | *present = true;
|
275 | c40cc0a0 | Michael Roth | } |
276 | c40cc0a0 | Michael Roth | |
277 | c40cc0a0 | Michael Roth | Visitor *qmp_input_get_visitor(QmpInputVisitor *v) |
278 | c40cc0a0 | Michael Roth | { |
279 | c40cc0a0 | Michael Roth | return &v->visitor;
|
280 | c40cc0a0 | Michael Roth | } |
281 | c40cc0a0 | Michael Roth | |
282 | c40cc0a0 | Michael Roth | void qmp_input_visitor_cleanup(QmpInputVisitor *v)
|
283 | c40cc0a0 | Michael Roth | { |
284 | 4faaec6a | Paolo Bonzini | qobject_decref(v->stack[0].obj);
|
285 | 7267c094 | Anthony Liguori | g_free(v); |
286 | c40cc0a0 | Michael Roth | } |
287 | c40cc0a0 | Michael Roth | |
288 | c40cc0a0 | Michael Roth | QmpInputVisitor *qmp_input_visitor_new(QObject *obj) |
289 | c40cc0a0 | Michael Roth | { |
290 | c40cc0a0 | Michael Roth | QmpInputVisitor *v; |
291 | c40cc0a0 | Michael Roth | |
292 | 7267c094 | Anthony Liguori | v = g_malloc0(sizeof(*v));
|
293 | c40cc0a0 | Michael Roth | |
294 | c40cc0a0 | Michael Roth | v->visitor.start_struct = qmp_input_start_struct; |
295 | c40cc0a0 | Michael Roth | v->visitor.end_struct = qmp_input_end_struct; |
296 | c40cc0a0 | Michael Roth | v->visitor.start_list = qmp_input_start_list; |
297 | c40cc0a0 | Michael Roth | v->visitor.next_list = qmp_input_next_list; |
298 | c40cc0a0 | Michael Roth | v->visitor.end_list = qmp_input_end_list; |
299 | 0f71a1e0 | Paolo Bonzini | v->visitor.type_enum = input_type_enum; |
300 | c40cc0a0 | Michael Roth | v->visitor.type_int = qmp_input_type_int; |
301 | c40cc0a0 | Michael Roth | v->visitor.type_bool = qmp_input_type_bool; |
302 | c40cc0a0 | Michael Roth | v->visitor.type_str = qmp_input_type_str; |
303 | c40cc0a0 | Michael Roth | v->visitor.type_number = qmp_input_type_number; |
304 | c40cc0a0 | Michael Roth | v->visitor.start_optional = qmp_input_start_optional; |
305 | c40cc0a0 | Michael Roth | |
306 | 4faaec6a | Paolo Bonzini | qmp_input_push(v, obj, NULL);
|
307 | 4faaec6a | Paolo Bonzini | qobject_incref(obj); |
308 | c40cc0a0 | Michael Roth | |
309 | c40cc0a0 | Michael Roth | return v;
|
310 | c40cc0a0 | Michael Roth | } |
311 | e38ac962 | Paolo Bonzini | |
312 | e38ac962 | Paolo Bonzini | QmpInputVisitor *qmp_input_visitor_new_strict(QObject *obj) |
313 | e38ac962 | Paolo Bonzini | { |
314 | e38ac962 | Paolo Bonzini | QmpInputVisitor *v; |
315 | e38ac962 | Paolo Bonzini | |
316 | e38ac962 | Paolo Bonzini | v = qmp_input_visitor_new(obj); |
317 | e38ac962 | Paolo Bonzini | v->strict = true;
|
318 | e38ac962 | Paolo Bonzini | |
319 | e38ac962 | Paolo Bonzini | return v;
|
320 | e38ac962 | Paolo Bonzini | } |