qapi-visit.c revision 910aea96b67d7f0357f586c47f20848ec435aa1b
1/* THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY */
2
3/*
4 * schema-defined QAPI visitor functions
5 *
6 * Copyright IBM, Corp. 2011
7 *
8 * Authors:
9 *  Anthony Liguori   <aliguori@us.ibm.com>
10 *
11 * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
12 * See the COPYING.LIB file in the top-level directory.
13 *
14 */
15
16#include "qemu-common.h"
17#include "qapi-visit.h"
18
19#ifndef QAPI_VISIT_BUILTIN_VISITOR_DEF_H
20#define QAPI_VISIT_BUILTIN_VISITOR_DEF_H
21
22
23void visit_type_strList(Visitor *m, strList ** obj, const char *name, Error **errp)
24{
25    GenericList *i, **prev = (GenericList **)obj;
26    Error *err = NULL;
27
28    if (!error_is_set(errp)) {
29        visit_start_list(m, name, &err);
30        if (!err) {
31            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
32                strList *native_i = (strList *)i;
33                visit_type_str(m, &native_i->value, NULL, &err);
34            }
35            error_propagate(errp, err);
36            err = NULL;
37
38            /* Always call end_list if start_list succeeded.  */
39            visit_end_list(m, &err);
40        }
41        error_propagate(errp, err);
42    }
43}
44
45void visit_type_intList(Visitor *m, intList ** obj, const char *name, Error **errp)
46{
47    GenericList *i, **prev = (GenericList **)obj;
48    Error *err = NULL;
49
50    if (!error_is_set(errp)) {
51        visit_start_list(m, name, &err);
52        if (!err) {
53            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
54                intList *native_i = (intList *)i;
55                visit_type_int(m, &native_i->value, NULL, &err);
56            }
57            error_propagate(errp, err);
58            err = NULL;
59
60            /* Always call end_list if start_list succeeded.  */
61            visit_end_list(m, &err);
62        }
63        error_propagate(errp, err);
64    }
65}
66
67void visit_type_numberList(Visitor *m, numberList ** obj, const char *name, Error **errp)
68{
69    GenericList *i, **prev = (GenericList **)obj;
70    Error *err = NULL;
71
72    if (!error_is_set(errp)) {
73        visit_start_list(m, name, &err);
74        if (!err) {
75            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
76                numberList *native_i = (numberList *)i;
77                visit_type_number(m, &native_i->value, NULL, &err);
78            }
79            error_propagate(errp, err);
80            err = NULL;
81
82            /* Always call end_list if start_list succeeded.  */
83            visit_end_list(m, &err);
84        }
85        error_propagate(errp, err);
86    }
87}
88
89void visit_type_boolList(Visitor *m, boolList ** obj, const char *name, Error **errp)
90{
91    GenericList *i, **prev = (GenericList **)obj;
92    Error *err = NULL;
93
94    if (!error_is_set(errp)) {
95        visit_start_list(m, name, &err);
96        if (!err) {
97            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
98                boolList *native_i = (boolList *)i;
99                visit_type_bool(m, &native_i->value, NULL, &err);
100            }
101            error_propagate(errp, err);
102            err = NULL;
103
104            /* Always call end_list if start_list succeeded.  */
105            visit_end_list(m, &err);
106        }
107        error_propagate(errp, err);
108    }
109}
110
111void visit_type_int8List(Visitor *m, int8List ** obj, const char *name, Error **errp)
112{
113    GenericList *i, **prev = (GenericList **)obj;
114    Error *err = NULL;
115
116    if (!error_is_set(errp)) {
117        visit_start_list(m, name, &err);
118        if (!err) {
119            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
120                int8List *native_i = (int8List *)i;
121                visit_type_int8(m, &native_i->value, NULL, &err);
122            }
123            error_propagate(errp, err);
124            err = NULL;
125
126            /* Always call end_list if start_list succeeded.  */
127            visit_end_list(m, &err);
128        }
129        error_propagate(errp, err);
130    }
131}
132
133void visit_type_int16List(Visitor *m, int16List ** obj, const char *name, Error **errp)
134{
135    GenericList *i, **prev = (GenericList **)obj;
136    Error *err = NULL;
137
138    if (!error_is_set(errp)) {
139        visit_start_list(m, name, &err);
140        if (!err) {
141            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
142                int16List *native_i = (int16List *)i;
143                visit_type_int16(m, &native_i->value, NULL, &err);
144            }
145            error_propagate(errp, err);
146            err = NULL;
147
148            /* Always call end_list if start_list succeeded.  */
149            visit_end_list(m, &err);
150        }
151        error_propagate(errp, err);
152    }
153}
154
155void visit_type_int32List(Visitor *m, int32List ** obj, const char *name, Error **errp)
156{
157    GenericList *i, **prev = (GenericList **)obj;
158    Error *err = NULL;
159
160    if (!error_is_set(errp)) {
161        visit_start_list(m, name, &err);
162        if (!err) {
163            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
164                int32List *native_i = (int32List *)i;
165                visit_type_int32(m, &native_i->value, NULL, &err);
166            }
167            error_propagate(errp, err);
168            err = NULL;
169
170            /* Always call end_list if start_list succeeded.  */
171            visit_end_list(m, &err);
172        }
173        error_propagate(errp, err);
174    }
175}
176
177void visit_type_int64List(Visitor *m, int64List ** obj, const char *name, Error **errp)
178{
179    GenericList *i, **prev = (GenericList **)obj;
180    Error *err = NULL;
181
182    if (!error_is_set(errp)) {
183        visit_start_list(m, name, &err);
184        if (!err) {
185            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
186                int64List *native_i = (int64List *)i;
187                visit_type_int64(m, &native_i->value, NULL, &err);
188            }
189            error_propagate(errp, err);
190            err = NULL;
191
192            /* Always call end_list if start_list succeeded.  */
193            visit_end_list(m, &err);
194        }
195        error_propagate(errp, err);
196    }
197}
198
199void visit_type_uint8List(Visitor *m, uint8List ** obj, const char *name, Error **errp)
200{
201    GenericList *i, **prev = (GenericList **)obj;
202    Error *err = NULL;
203
204    if (!error_is_set(errp)) {
205        visit_start_list(m, name, &err);
206        if (!err) {
207            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
208                uint8List *native_i = (uint8List *)i;
209                visit_type_uint8(m, &native_i->value, NULL, &err);
210            }
211            error_propagate(errp, err);
212            err = NULL;
213
214            /* Always call end_list if start_list succeeded.  */
215            visit_end_list(m, &err);
216        }
217        error_propagate(errp, err);
218    }
219}
220
221void visit_type_uint16List(Visitor *m, uint16List ** obj, const char *name, Error **errp)
222{
223    GenericList *i, **prev = (GenericList **)obj;
224    Error *err = NULL;
225
226    if (!error_is_set(errp)) {
227        visit_start_list(m, name, &err);
228        if (!err) {
229            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
230                uint16List *native_i = (uint16List *)i;
231                visit_type_uint16(m, &native_i->value, NULL, &err);
232            }
233            error_propagate(errp, err);
234            err = NULL;
235
236            /* Always call end_list if start_list succeeded.  */
237            visit_end_list(m, &err);
238        }
239        error_propagate(errp, err);
240    }
241}
242
243void visit_type_uint32List(Visitor *m, uint32List ** obj, const char *name, Error **errp)
244{
245    GenericList *i, **prev = (GenericList **)obj;
246    Error *err = NULL;
247
248    if (!error_is_set(errp)) {
249        visit_start_list(m, name, &err);
250        if (!err) {
251            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
252                uint32List *native_i = (uint32List *)i;
253                visit_type_uint32(m, &native_i->value, NULL, &err);
254            }
255            error_propagate(errp, err);
256            err = NULL;
257
258            /* Always call end_list if start_list succeeded.  */
259            visit_end_list(m, &err);
260        }
261        error_propagate(errp, err);
262    }
263}
264
265void visit_type_uint64List(Visitor *m, uint64List ** obj, const char *name, Error **errp)
266{
267    GenericList *i, **prev = (GenericList **)obj;
268    Error *err = NULL;
269
270    if (!error_is_set(errp)) {
271        visit_start_list(m, name, &err);
272        if (!err) {
273            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
274                uint64List *native_i = (uint64List *)i;
275                visit_type_uint64(m, &native_i->value, NULL, &err);
276            }
277            error_propagate(errp, err);
278            err = NULL;
279
280            /* Always call end_list if start_list succeeded.  */
281            visit_end_list(m, &err);
282        }
283        error_propagate(errp, err);
284    }
285}
286
287#endif /* QAPI_VISIT_BUILTIN_VISITOR_DEF_H */
288
289
290void visit_type_ErrorClassList(Visitor *m, ErrorClassList ** obj, const char *name, Error **errp)
291{
292    GenericList *i, **prev = (GenericList **)obj;
293    Error *err = NULL;
294
295    if (!error_is_set(errp)) {
296        visit_start_list(m, name, &err);
297        if (!err) {
298            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
299                ErrorClassList *native_i = (ErrorClassList *)i;
300                visit_type_ErrorClass(m, &native_i->value, NULL, &err);
301            }
302            error_propagate(errp, err);
303            err = NULL;
304
305            /* Always call end_list if start_list succeeded.  */
306            visit_end_list(m, &err);
307        }
308        error_propagate(errp, err);
309    }
310}
311
312void visit_type_ErrorClass(Visitor *m, ErrorClass * obj, const char *name, Error **errp)
313{
314    visit_type_enum(m, (int *)obj, ErrorClass_lookup, "ErrorClass", name, errp);
315}
316
317static void visit_type_NameInfo_fields(Visitor *m, NameInfo ** obj, Error **errp)
318{
319    Error *err = NULL;
320    visit_start_optional(m, obj ? &(*obj)->has_name : NULL, "name", &err);
321    if (obj && (*obj)->has_name) {
322        visit_type_str(m, obj ? &(*obj)->name : NULL, "name", &err);
323    }
324    visit_end_optional(m, &err);
325
326    error_propagate(errp, err);
327}
328
329void visit_type_NameInfo(Visitor *m, NameInfo ** obj, const char *name, Error **errp)
330{
331    if (!error_is_set(errp)) {
332        Error *err = NULL;
333        visit_start_struct(m, (void **)obj, "NameInfo", name, sizeof(NameInfo), &err);
334        if (!err) {
335            if (!obj || *obj) {
336                visit_type_NameInfo_fields(m, obj, &err);
337                error_propagate(errp, err);
338                err = NULL;
339            }
340            /* Always call end_struct if start_struct succeeded.  */
341            visit_end_struct(m, &err);
342        }
343        error_propagate(errp, err);
344    }
345}
346
347void visit_type_NameInfoList(Visitor *m, NameInfoList ** obj, const char *name, Error **errp)
348{
349    GenericList *i, **prev = (GenericList **)obj;
350    Error *err = NULL;
351
352    if (!error_is_set(errp)) {
353        visit_start_list(m, name, &err);
354        if (!err) {
355            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
356                NameInfoList *native_i = (NameInfoList *)i;
357                visit_type_NameInfo(m, &native_i->value, NULL, &err);
358            }
359            error_propagate(errp, err);
360            err = NULL;
361
362            /* Always call end_list if start_list succeeded.  */
363            visit_end_list(m, &err);
364        }
365        error_propagate(errp, err);
366    }
367}
368
369static void visit_type_VersionInfo_qemu_fields(Visitor *m, VersionInfo ** obj, Error **errp)
370{
371    Error *err = NULL;
372    visit_type_int(m, obj ? &(*obj)->qemu.major : NULL, "major", &err);
373    visit_type_int(m, obj ? &(*obj)->qemu.minor : NULL, "minor", &err);
374    visit_type_int(m, obj ? &(*obj)->qemu.micro : NULL, "micro", &err);
375
376    error_propagate(errp, err);
377}
378
379static void visit_type_VersionInfo_fields(Visitor *m, VersionInfo ** obj, Error **errp)
380{
381    Error *err = NULL;
382    if (!error_is_set(errp)) {
383        Error **errp = &err; /* from outer scope */
384        Error *err = NULL;
385        visit_start_struct(m, NULL, "", "qemu", 0, &err);
386        if (!err) {
387            if (!obj || *obj) {
388                visit_type_VersionInfo_qemu_fields(m, obj, &err);
389                error_propagate(errp, err);
390                err = NULL;
391            }
392            /* Always call end_struct if start_struct succeeded.  */
393            visit_end_struct(m, &err);
394        }
395        error_propagate(errp, err);
396    }
397    visit_type_str(m, obj ? &(*obj)->package : NULL, "package", &err);
398
399    error_propagate(errp, err);
400}
401
402void visit_type_VersionInfo(Visitor *m, VersionInfo ** obj, const char *name, Error **errp)
403{
404    if (!error_is_set(errp)) {
405        Error *err = NULL;
406        visit_start_struct(m, (void **)obj, "VersionInfo", name, sizeof(VersionInfo), &err);
407        if (!err) {
408            if (!obj || *obj) {
409                visit_type_VersionInfo_fields(m, obj, &err);
410                error_propagate(errp, err);
411                err = NULL;
412            }
413            /* Always call end_struct if start_struct succeeded.  */
414            visit_end_struct(m, &err);
415        }
416        error_propagate(errp, err);
417    }
418}
419
420void visit_type_VersionInfoList(Visitor *m, VersionInfoList ** obj, const char *name, Error **errp)
421{
422    GenericList *i, **prev = (GenericList **)obj;
423    Error *err = NULL;
424
425    if (!error_is_set(errp)) {
426        visit_start_list(m, name, &err);
427        if (!err) {
428            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
429                VersionInfoList *native_i = (VersionInfoList *)i;
430                visit_type_VersionInfo(m, &native_i->value, NULL, &err);
431            }
432            error_propagate(errp, err);
433            err = NULL;
434
435            /* Always call end_list if start_list succeeded.  */
436            visit_end_list(m, &err);
437        }
438        error_propagate(errp, err);
439    }
440}
441
442static void visit_type_KvmInfo_fields(Visitor *m, KvmInfo ** obj, Error **errp)
443{
444    Error *err = NULL;
445    visit_type_bool(m, obj ? &(*obj)->enabled : NULL, "enabled", &err);
446    visit_type_bool(m, obj ? &(*obj)->present : NULL, "present", &err);
447
448    error_propagate(errp, err);
449}
450
451void visit_type_KvmInfo(Visitor *m, KvmInfo ** obj, const char *name, Error **errp)
452{
453    if (!error_is_set(errp)) {
454        Error *err = NULL;
455        visit_start_struct(m, (void **)obj, "KvmInfo", name, sizeof(KvmInfo), &err);
456        if (!err) {
457            if (!obj || *obj) {
458                visit_type_KvmInfo_fields(m, obj, &err);
459                error_propagate(errp, err);
460                err = NULL;
461            }
462            /* Always call end_struct if start_struct succeeded.  */
463            visit_end_struct(m, &err);
464        }
465        error_propagate(errp, err);
466    }
467}
468
469void visit_type_KvmInfoList(Visitor *m, KvmInfoList ** obj, const char *name, Error **errp)
470{
471    GenericList *i, **prev = (GenericList **)obj;
472    Error *err = NULL;
473
474    if (!error_is_set(errp)) {
475        visit_start_list(m, name, &err);
476        if (!err) {
477            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
478                KvmInfoList *native_i = (KvmInfoList *)i;
479                visit_type_KvmInfo(m, &native_i->value, NULL, &err);
480            }
481            error_propagate(errp, err);
482            err = NULL;
483
484            /* Always call end_list if start_list succeeded.  */
485            visit_end_list(m, &err);
486        }
487        error_propagate(errp, err);
488    }
489}
490
491void visit_type_RunStateList(Visitor *m, RunStateList ** obj, const char *name, Error **errp)
492{
493    GenericList *i, **prev = (GenericList **)obj;
494    Error *err = NULL;
495
496    if (!error_is_set(errp)) {
497        visit_start_list(m, name, &err);
498        if (!err) {
499            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
500                RunStateList *native_i = (RunStateList *)i;
501                visit_type_RunState(m, &native_i->value, NULL, &err);
502            }
503            error_propagate(errp, err);
504            err = NULL;
505
506            /* Always call end_list if start_list succeeded.  */
507            visit_end_list(m, &err);
508        }
509        error_propagate(errp, err);
510    }
511}
512
513void visit_type_RunState(Visitor *m, RunState * obj, const char *name, Error **errp)
514{
515    visit_type_enum(m, (int *)obj, RunState_lookup, "RunState", name, errp);
516}
517
518static void visit_type_SnapshotInfo_fields(Visitor *m, SnapshotInfo ** obj, Error **errp)
519{
520    Error *err = NULL;
521    visit_type_str(m, obj ? &(*obj)->id : NULL, "id", &err);
522    visit_type_str(m, obj ? &(*obj)->name : NULL, "name", &err);
523    visit_type_int(m, obj ? &(*obj)->vm_state_size : NULL, "vm-state-size", &err);
524    visit_type_int(m, obj ? &(*obj)->date_sec : NULL, "date-sec", &err);
525    visit_type_int(m, obj ? &(*obj)->date_nsec : NULL, "date-nsec", &err);
526    visit_type_int(m, obj ? &(*obj)->vm_clock_sec : NULL, "vm-clock-sec", &err);
527    visit_type_int(m, obj ? &(*obj)->vm_clock_nsec : NULL, "vm-clock-nsec", &err);
528
529    error_propagate(errp, err);
530}
531
532void visit_type_SnapshotInfo(Visitor *m, SnapshotInfo ** obj, const char *name, Error **errp)
533{
534    if (!error_is_set(errp)) {
535        Error *err = NULL;
536        visit_start_struct(m, (void **)obj, "SnapshotInfo", name, sizeof(SnapshotInfo), &err);
537        if (!err) {
538            if (!obj || *obj) {
539                visit_type_SnapshotInfo_fields(m, obj, &err);
540                error_propagate(errp, err);
541                err = NULL;
542            }
543            /* Always call end_struct if start_struct succeeded.  */
544            visit_end_struct(m, &err);
545        }
546        error_propagate(errp, err);
547    }
548}
549
550void visit_type_SnapshotInfoList(Visitor *m, SnapshotInfoList ** obj, const char *name, Error **errp)
551{
552    GenericList *i, **prev = (GenericList **)obj;
553    Error *err = NULL;
554
555    if (!error_is_set(errp)) {
556        visit_start_list(m, name, &err);
557        if (!err) {
558            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
559                SnapshotInfoList *native_i = (SnapshotInfoList *)i;
560                visit_type_SnapshotInfo(m, &native_i->value, NULL, &err);
561            }
562            error_propagate(errp, err);
563            err = NULL;
564
565            /* Always call end_list if start_list succeeded.  */
566            visit_end_list(m, &err);
567        }
568        error_propagate(errp, err);
569    }
570}
571
572static void visit_type_ImageInfoSpecificQCow2_fields(Visitor *m, ImageInfoSpecificQCow2 ** obj, Error **errp)
573{
574    Error *err = NULL;
575    visit_type_str(m, obj ? &(*obj)->compat : NULL, "compat", &err);
576    visit_start_optional(m, obj ? &(*obj)->has_lazy_refcounts : NULL, "lazy-refcounts", &err);
577    if (obj && (*obj)->has_lazy_refcounts) {
578        visit_type_bool(m, obj ? &(*obj)->lazy_refcounts : NULL, "lazy-refcounts", &err);
579    }
580    visit_end_optional(m, &err);
581
582    error_propagate(errp, err);
583}
584
585void visit_type_ImageInfoSpecificQCow2(Visitor *m, ImageInfoSpecificQCow2 ** obj, const char *name, Error **errp)
586{
587    if (!error_is_set(errp)) {
588        Error *err = NULL;
589        visit_start_struct(m, (void **)obj, "ImageInfoSpecificQCow2", name, sizeof(ImageInfoSpecificQCow2), &err);
590        if (!err) {
591            if (!obj || *obj) {
592                visit_type_ImageInfoSpecificQCow2_fields(m, obj, &err);
593                error_propagate(errp, err);
594                err = NULL;
595            }
596            /* Always call end_struct if start_struct succeeded.  */
597            visit_end_struct(m, &err);
598        }
599        error_propagate(errp, err);
600    }
601}
602
603void visit_type_ImageInfoSpecificQCow2List(Visitor *m, ImageInfoSpecificQCow2List ** obj, const char *name, Error **errp)
604{
605    GenericList *i, **prev = (GenericList **)obj;
606    Error *err = NULL;
607
608    if (!error_is_set(errp)) {
609        visit_start_list(m, name, &err);
610        if (!err) {
611            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
612                ImageInfoSpecificQCow2List *native_i = (ImageInfoSpecificQCow2List *)i;
613                visit_type_ImageInfoSpecificQCow2(m, &native_i->value, NULL, &err);
614            }
615            error_propagate(errp, err);
616            err = NULL;
617
618            /* Always call end_list if start_list succeeded.  */
619            visit_end_list(m, &err);
620        }
621        error_propagate(errp, err);
622    }
623}
624
625static void visit_type_ImageInfoSpecificVmdk_fields(Visitor *m, ImageInfoSpecificVmdk ** obj, Error **errp)
626{
627    Error *err = NULL;
628    visit_type_str(m, obj ? &(*obj)->create_type : NULL, "create-type", &err);
629    visit_type_int(m, obj ? &(*obj)->cid : NULL, "cid", &err);
630    visit_type_int(m, obj ? &(*obj)->parent_cid : NULL, "parent-cid", &err);
631    visit_type_ImageInfoList(m, obj ? &(*obj)->extents : NULL, "extents", &err);
632
633    error_propagate(errp, err);
634}
635
636void visit_type_ImageInfoSpecificVmdk(Visitor *m, ImageInfoSpecificVmdk ** obj, const char *name, Error **errp)
637{
638    if (!error_is_set(errp)) {
639        Error *err = NULL;
640        visit_start_struct(m, (void **)obj, "ImageInfoSpecificVmdk", name, sizeof(ImageInfoSpecificVmdk), &err);
641        if (!err) {
642            if (!obj || *obj) {
643                visit_type_ImageInfoSpecificVmdk_fields(m, obj, &err);
644                error_propagate(errp, err);
645                err = NULL;
646            }
647            /* Always call end_struct if start_struct succeeded.  */
648            visit_end_struct(m, &err);
649        }
650        error_propagate(errp, err);
651    }
652}
653
654void visit_type_ImageInfoSpecificVmdkList(Visitor *m, ImageInfoSpecificVmdkList ** obj, const char *name, Error **errp)
655{
656    GenericList *i, **prev = (GenericList **)obj;
657    Error *err = NULL;
658
659    if (!error_is_set(errp)) {
660        visit_start_list(m, name, &err);
661        if (!err) {
662            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
663                ImageInfoSpecificVmdkList *native_i = (ImageInfoSpecificVmdkList *)i;
664                visit_type_ImageInfoSpecificVmdk(m, &native_i->value, NULL, &err);
665            }
666            error_propagate(errp, err);
667            err = NULL;
668
669            /* Always call end_list if start_list succeeded.  */
670            visit_end_list(m, &err);
671        }
672        error_propagate(errp, err);
673    }
674}
675
676void visit_type_ImageInfoSpecificKind(Visitor *m, ImageInfoSpecificKind * obj, const char *name, Error **errp)
677{
678    visit_type_enum(m, (int *)obj, ImageInfoSpecificKind_lookup, "ImageInfoSpecificKind", name, errp);
679}
680
681void visit_type_ImageInfoSpecific(Visitor *m, ImageInfoSpecific ** obj, const char *name, Error **errp)
682{
683    Error *err = NULL;
684
685    if (!error_is_set(errp)) {
686        visit_start_struct(m, (void **)obj, "ImageInfoSpecific", name, sizeof(ImageInfoSpecific), &err);
687        if (!err) {
688            if (obj && *obj) {
689                visit_type_ImageInfoSpecificKind(m, &(*obj)->kind, "type", &err);
690                if (!err) {
691                    switch ((*obj)->kind) {
692                    case IMAGE_INFO_SPECIFIC_KIND_QCOW2:
693                        visit_type_ImageInfoSpecificQCow2(m, &(*obj)->qcow2, "data", &err);
694                        break;
695                    case IMAGE_INFO_SPECIFIC_KIND_VMDK:
696                        visit_type_ImageInfoSpecificVmdk(m, &(*obj)->vmdk, "data", &err);
697                        break;
698                    default:
699                        abort();
700                    }
701                }
702                error_propagate(errp, err);
703                err = NULL;
704            }
705            /* Always call end_struct if start_struct succeeded.  */
706            visit_end_struct(m, &err);
707        }
708        error_propagate(errp, err);
709    }
710}
711
712void visit_type_ImageInfoSpecificList(Visitor *m, ImageInfoSpecificList ** obj, const char *name, Error **errp)
713{
714    GenericList *i, **prev = (GenericList **)obj;
715    Error *err = NULL;
716
717    if (!error_is_set(errp)) {
718        visit_start_list(m, name, &err);
719        if (!err) {
720            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
721                ImageInfoSpecificList *native_i = (ImageInfoSpecificList *)i;
722                visit_type_ImageInfoSpecific(m, &native_i->value, NULL, &err);
723            }
724            error_propagate(errp, err);
725            err = NULL;
726
727            /* Always call end_list if start_list succeeded.  */
728            visit_end_list(m, &err);
729        }
730        error_propagate(errp, err);
731    }
732}
733
734static void visit_type_ImageInfo_fields(Visitor *m, ImageInfo ** obj, Error **errp)
735{
736    Error *err = NULL;
737    visit_type_str(m, obj ? &(*obj)->filename : NULL, "filename", &err);
738    visit_type_str(m, obj ? &(*obj)->format : NULL, "format", &err);
739    visit_start_optional(m, obj ? &(*obj)->has_dirty_flag : NULL, "dirty-flag", &err);
740    if (obj && (*obj)->has_dirty_flag) {
741        visit_type_bool(m, obj ? &(*obj)->dirty_flag : NULL, "dirty-flag", &err);
742    }
743    visit_end_optional(m, &err);
744    visit_start_optional(m, obj ? &(*obj)->has_actual_size : NULL, "actual-size", &err);
745    if (obj && (*obj)->has_actual_size) {
746        visit_type_int(m, obj ? &(*obj)->actual_size : NULL, "actual-size", &err);
747    }
748    visit_end_optional(m, &err);
749    visit_type_int(m, obj ? &(*obj)->virtual_size : NULL, "virtual-size", &err);
750    visit_start_optional(m, obj ? &(*obj)->has_cluster_size : NULL, "cluster-size", &err);
751    if (obj && (*obj)->has_cluster_size) {
752        visit_type_int(m, obj ? &(*obj)->cluster_size : NULL, "cluster-size", &err);
753    }
754    visit_end_optional(m, &err);
755    visit_start_optional(m, obj ? &(*obj)->has_encrypted : NULL, "encrypted", &err);
756    if (obj && (*obj)->has_encrypted) {
757        visit_type_bool(m, obj ? &(*obj)->encrypted : NULL, "encrypted", &err);
758    }
759    visit_end_optional(m, &err);
760    visit_start_optional(m, obj ? &(*obj)->has_compressed : NULL, "compressed", &err);
761    if (obj && (*obj)->has_compressed) {
762        visit_type_bool(m, obj ? &(*obj)->compressed : NULL, "compressed", &err);
763    }
764    visit_end_optional(m, &err);
765    visit_start_optional(m, obj ? &(*obj)->has_backing_filename : NULL, "backing-filename", &err);
766    if (obj && (*obj)->has_backing_filename) {
767        visit_type_str(m, obj ? &(*obj)->backing_filename : NULL, "backing-filename", &err);
768    }
769    visit_end_optional(m, &err);
770    visit_start_optional(m, obj ? &(*obj)->has_full_backing_filename : NULL, "full-backing-filename", &err);
771    if (obj && (*obj)->has_full_backing_filename) {
772        visit_type_str(m, obj ? &(*obj)->full_backing_filename : NULL, "full-backing-filename", &err);
773    }
774    visit_end_optional(m, &err);
775    visit_start_optional(m, obj ? &(*obj)->has_backing_filename_format : NULL, "backing-filename-format", &err);
776    if (obj && (*obj)->has_backing_filename_format) {
777        visit_type_str(m, obj ? &(*obj)->backing_filename_format : NULL, "backing-filename-format", &err);
778    }
779    visit_end_optional(m, &err);
780    visit_start_optional(m, obj ? &(*obj)->has_snapshots : NULL, "snapshots", &err);
781    if (obj && (*obj)->has_snapshots) {
782        visit_type_SnapshotInfoList(m, obj ? &(*obj)->snapshots : NULL, "snapshots", &err);
783    }
784    visit_end_optional(m, &err);
785    visit_start_optional(m, obj ? &(*obj)->has_backing_image : NULL, "backing-image", &err);
786    if (obj && (*obj)->has_backing_image) {
787        visit_type_ImageInfo(m, obj ? &(*obj)->backing_image : NULL, "backing-image", &err);
788    }
789    visit_end_optional(m, &err);
790    visit_start_optional(m, obj ? &(*obj)->has_format_specific : NULL, "format-specific", &err);
791    if (obj && (*obj)->has_format_specific) {
792        visit_type_ImageInfoSpecific(m, obj ? &(*obj)->format_specific : NULL, "format-specific", &err);
793    }
794    visit_end_optional(m, &err);
795
796    error_propagate(errp, err);
797}
798
799void visit_type_ImageInfo(Visitor *m, ImageInfo ** obj, const char *name, Error **errp)
800{
801    if (!error_is_set(errp)) {
802        Error *err = NULL;
803        visit_start_struct(m, (void **)obj, "ImageInfo", name, sizeof(ImageInfo), &err);
804        if (!err) {
805            if (!obj || *obj) {
806                visit_type_ImageInfo_fields(m, obj, &err);
807                error_propagate(errp, err);
808                err = NULL;
809            }
810            /* Always call end_struct if start_struct succeeded.  */
811            visit_end_struct(m, &err);
812        }
813        error_propagate(errp, err);
814    }
815}
816
817void visit_type_ImageInfoList(Visitor *m, ImageInfoList ** obj, const char *name, Error **errp)
818{
819    GenericList *i, **prev = (GenericList **)obj;
820    Error *err = NULL;
821
822    if (!error_is_set(errp)) {
823        visit_start_list(m, name, &err);
824        if (!err) {
825            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
826                ImageInfoList *native_i = (ImageInfoList *)i;
827                visit_type_ImageInfo(m, &native_i->value, NULL, &err);
828            }
829            error_propagate(errp, err);
830            err = NULL;
831
832            /* Always call end_list if start_list succeeded.  */
833            visit_end_list(m, &err);
834        }
835        error_propagate(errp, err);
836    }
837}
838
839static void visit_type_ImageCheck_fields(Visitor *m, ImageCheck ** obj, Error **errp)
840{
841    Error *err = NULL;
842    visit_type_str(m, obj ? &(*obj)->filename : NULL, "filename", &err);
843    visit_type_str(m, obj ? &(*obj)->format : NULL, "format", &err);
844    visit_type_int(m, obj ? &(*obj)->check_errors : NULL, "check-errors", &err);
845    visit_start_optional(m, obj ? &(*obj)->has_image_end_offset : NULL, "image-end-offset", &err);
846    if (obj && (*obj)->has_image_end_offset) {
847        visit_type_int(m, obj ? &(*obj)->image_end_offset : NULL, "image-end-offset", &err);
848    }
849    visit_end_optional(m, &err);
850    visit_start_optional(m, obj ? &(*obj)->has_corruptions : NULL, "corruptions", &err);
851    if (obj && (*obj)->has_corruptions) {
852        visit_type_int(m, obj ? &(*obj)->corruptions : NULL, "corruptions", &err);
853    }
854    visit_end_optional(m, &err);
855    visit_start_optional(m, obj ? &(*obj)->has_leaks : NULL, "leaks", &err);
856    if (obj && (*obj)->has_leaks) {
857        visit_type_int(m, obj ? &(*obj)->leaks : NULL, "leaks", &err);
858    }
859    visit_end_optional(m, &err);
860    visit_start_optional(m, obj ? &(*obj)->has_corruptions_fixed : NULL, "corruptions-fixed", &err);
861    if (obj && (*obj)->has_corruptions_fixed) {
862        visit_type_int(m, obj ? &(*obj)->corruptions_fixed : NULL, "corruptions-fixed", &err);
863    }
864    visit_end_optional(m, &err);
865    visit_start_optional(m, obj ? &(*obj)->has_leaks_fixed : NULL, "leaks-fixed", &err);
866    if (obj && (*obj)->has_leaks_fixed) {
867        visit_type_int(m, obj ? &(*obj)->leaks_fixed : NULL, "leaks-fixed", &err);
868    }
869    visit_end_optional(m, &err);
870    visit_start_optional(m, obj ? &(*obj)->has_total_clusters : NULL, "total-clusters", &err);
871    if (obj && (*obj)->has_total_clusters) {
872        visit_type_int(m, obj ? &(*obj)->total_clusters : NULL, "total-clusters", &err);
873    }
874    visit_end_optional(m, &err);
875    visit_start_optional(m, obj ? &(*obj)->has_allocated_clusters : NULL, "allocated-clusters", &err);
876    if (obj && (*obj)->has_allocated_clusters) {
877        visit_type_int(m, obj ? &(*obj)->allocated_clusters : NULL, "allocated-clusters", &err);
878    }
879    visit_end_optional(m, &err);
880    visit_start_optional(m, obj ? &(*obj)->has_fragmented_clusters : NULL, "fragmented-clusters", &err);
881    if (obj && (*obj)->has_fragmented_clusters) {
882        visit_type_int(m, obj ? &(*obj)->fragmented_clusters : NULL, "fragmented-clusters", &err);
883    }
884    visit_end_optional(m, &err);
885    visit_start_optional(m, obj ? &(*obj)->has_compressed_clusters : NULL, "compressed-clusters", &err);
886    if (obj && (*obj)->has_compressed_clusters) {
887        visit_type_int(m, obj ? &(*obj)->compressed_clusters : NULL, "compressed-clusters", &err);
888    }
889    visit_end_optional(m, &err);
890
891    error_propagate(errp, err);
892}
893
894void visit_type_ImageCheck(Visitor *m, ImageCheck ** obj, const char *name, Error **errp)
895{
896    if (!error_is_set(errp)) {
897        Error *err = NULL;
898        visit_start_struct(m, (void **)obj, "ImageCheck", name, sizeof(ImageCheck), &err);
899        if (!err) {
900            if (!obj || *obj) {
901                visit_type_ImageCheck_fields(m, obj, &err);
902                error_propagate(errp, err);
903                err = NULL;
904            }
905            /* Always call end_struct if start_struct succeeded.  */
906            visit_end_struct(m, &err);
907        }
908        error_propagate(errp, err);
909    }
910}
911
912void visit_type_ImageCheckList(Visitor *m, ImageCheckList ** obj, const char *name, Error **errp)
913{
914    GenericList *i, **prev = (GenericList **)obj;
915    Error *err = NULL;
916
917    if (!error_is_set(errp)) {
918        visit_start_list(m, name, &err);
919        if (!err) {
920            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
921                ImageCheckList *native_i = (ImageCheckList *)i;
922                visit_type_ImageCheck(m, &native_i->value, NULL, &err);
923            }
924            error_propagate(errp, err);
925            err = NULL;
926
927            /* Always call end_list if start_list succeeded.  */
928            visit_end_list(m, &err);
929        }
930        error_propagate(errp, err);
931    }
932}
933
934static void visit_type_StatusInfo_fields(Visitor *m, StatusInfo ** obj, Error **errp)
935{
936    Error *err = NULL;
937    visit_type_bool(m, obj ? &(*obj)->running : NULL, "running", &err);
938    visit_type_bool(m, obj ? &(*obj)->singlestep : NULL, "singlestep", &err);
939    visit_type_RunState(m, obj ? &(*obj)->status : NULL, "status", &err);
940
941    error_propagate(errp, err);
942}
943
944void visit_type_StatusInfo(Visitor *m, StatusInfo ** obj, const char *name, Error **errp)
945{
946    if (!error_is_set(errp)) {
947        Error *err = NULL;
948        visit_start_struct(m, (void **)obj, "StatusInfo", name, sizeof(StatusInfo), &err);
949        if (!err) {
950            if (!obj || *obj) {
951                visit_type_StatusInfo_fields(m, obj, &err);
952                error_propagate(errp, err);
953                err = NULL;
954            }
955            /* Always call end_struct if start_struct succeeded.  */
956            visit_end_struct(m, &err);
957        }
958        error_propagate(errp, err);
959    }
960}
961
962void visit_type_StatusInfoList(Visitor *m, StatusInfoList ** obj, const char *name, Error **errp)
963{
964    GenericList *i, **prev = (GenericList **)obj;
965    Error *err = NULL;
966
967    if (!error_is_set(errp)) {
968        visit_start_list(m, name, &err);
969        if (!err) {
970            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
971                StatusInfoList *native_i = (StatusInfoList *)i;
972                visit_type_StatusInfo(m, &native_i->value, NULL, &err);
973            }
974            error_propagate(errp, err);
975            err = NULL;
976
977            /* Always call end_list if start_list succeeded.  */
978            visit_end_list(m, &err);
979        }
980        error_propagate(errp, err);
981    }
982}
983
984static void visit_type_UuidInfo_fields(Visitor *m, UuidInfo ** obj, Error **errp)
985{
986    Error *err = NULL;
987    visit_type_str(m, obj ? &(*obj)->UUID : NULL, "UUID", &err);
988
989    error_propagate(errp, err);
990}
991
992void visit_type_UuidInfo(Visitor *m, UuidInfo ** obj, const char *name, Error **errp)
993{
994    if (!error_is_set(errp)) {
995        Error *err = NULL;
996        visit_start_struct(m, (void **)obj, "UuidInfo", name, sizeof(UuidInfo), &err);
997        if (!err) {
998            if (!obj || *obj) {
999                visit_type_UuidInfo_fields(m, obj, &err);
1000                error_propagate(errp, err);
1001                err = NULL;
1002            }
1003            /* Always call end_struct if start_struct succeeded.  */
1004            visit_end_struct(m, &err);
1005        }
1006        error_propagate(errp, err);
1007    }
1008}
1009
1010void visit_type_UuidInfoList(Visitor *m, UuidInfoList ** obj, const char *name, Error **errp)
1011{
1012    GenericList *i, **prev = (GenericList **)obj;
1013    Error *err = NULL;
1014
1015    if (!error_is_set(errp)) {
1016        visit_start_list(m, name, &err);
1017        if (!err) {
1018            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
1019                UuidInfoList *native_i = (UuidInfoList *)i;
1020                visit_type_UuidInfo(m, &native_i->value, NULL, &err);
1021            }
1022            error_propagate(errp, err);
1023            err = NULL;
1024
1025            /* Always call end_list if start_list succeeded.  */
1026            visit_end_list(m, &err);
1027        }
1028        error_propagate(errp, err);
1029    }
1030}
1031
1032static void visit_type_ChardevInfo_fields(Visitor *m, ChardevInfo ** obj, Error **errp)
1033{
1034    Error *err = NULL;
1035    visit_type_str(m, obj ? &(*obj)->label : NULL, "label", &err);
1036    visit_type_str(m, obj ? &(*obj)->filename : NULL, "filename", &err);
1037
1038    error_propagate(errp, err);
1039}
1040
1041void visit_type_ChardevInfo(Visitor *m, ChardevInfo ** obj, const char *name, Error **errp)
1042{
1043    if (!error_is_set(errp)) {
1044        Error *err = NULL;
1045        visit_start_struct(m, (void **)obj, "ChardevInfo", name, sizeof(ChardevInfo), &err);
1046        if (!err) {
1047            if (!obj || *obj) {
1048                visit_type_ChardevInfo_fields(m, obj, &err);
1049                error_propagate(errp, err);
1050                err = NULL;
1051            }
1052            /* Always call end_struct if start_struct succeeded.  */
1053            visit_end_struct(m, &err);
1054        }
1055        error_propagate(errp, err);
1056    }
1057}
1058
1059void visit_type_ChardevInfoList(Visitor *m, ChardevInfoList ** obj, const char *name, Error **errp)
1060{
1061    GenericList *i, **prev = (GenericList **)obj;
1062    Error *err = NULL;
1063
1064    if (!error_is_set(errp)) {
1065        visit_start_list(m, name, &err);
1066        if (!err) {
1067            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
1068                ChardevInfoList *native_i = (ChardevInfoList *)i;
1069                visit_type_ChardevInfo(m, &native_i->value, NULL, &err);
1070            }
1071            error_propagate(errp, err);
1072            err = NULL;
1073
1074            /* Always call end_list if start_list succeeded.  */
1075            visit_end_list(m, &err);
1076        }
1077        error_propagate(errp, err);
1078    }
1079}
1080
1081void visit_type_DataFormatList(Visitor *m, DataFormatList ** obj, const char *name, Error **errp)
1082{
1083    GenericList *i, **prev = (GenericList **)obj;
1084    Error *err = NULL;
1085
1086    if (!error_is_set(errp)) {
1087        visit_start_list(m, name, &err);
1088        if (!err) {
1089            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
1090                DataFormatList *native_i = (DataFormatList *)i;
1091                visit_type_DataFormat(m, &native_i->value, NULL, &err);
1092            }
1093            error_propagate(errp, err);
1094            err = NULL;
1095
1096            /* Always call end_list if start_list succeeded.  */
1097            visit_end_list(m, &err);
1098        }
1099        error_propagate(errp, err);
1100    }
1101}
1102
1103void visit_type_DataFormat(Visitor *m, DataFormat * obj, const char *name, Error **errp)
1104{
1105    visit_type_enum(m, (int *)obj, DataFormat_lookup, "DataFormat", name, errp);
1106}
1107
1108static void visit_type_CommandInfo_fields(Visitor *m, CommandInfo ** obj, Error **errp)
1109{
1110    Error *err = NULL;
1111    visit_type_str(m, obj ? &(*obj)->name : NULL, "name", &err);
1112
1113    error_propagate(errp, err);
1114}
1115
1116void visit_type_CommandInfo(Visitor *m, CommandInfo ** obj, const char *name, Error **errp)
1117{
1118    if (!error_is_set(errp)) {
1119        Error *err = NULL;
1120        visit_start_struct(m, (void **)obj, "CommandInfo", name, sizeof(CommandInfo), &err);
1121        if (!err) {
1122            if (!obj || *obj) {
1123                visit_type_CommandInfo_fields(m, obj, &err);
1124                error_propagate(errp, err);
1125                err = NULL;
1126            }
1127            /* Always call end_struct if start_struct succeeded.  */
1128            visit_end_struct(m, &err);
1129        }
1130        error_propagate(errp, err);
1131    }
1132}
1133
1134void visit_type_CommandInfoList(Visitor *m, CommandInfoList ** obj, const char *name, Error **errp)
1135{
1136    GenericList *i, **prev = (GenericList **)obj;
1137    Error *err = NULL;
1138
1139    if (!error_is_set(errp)) {
1140        visit_start_list(m, name, &err);
1141        if (!err) {
1142            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
1143                CommandInfoList *native_i = (CommandInfoList *)i;
1144                visit_type_CommandInfo(m, &native_i->value, NULL, &err);
1145            }
1146            error_propagate(errp, err);
1147            err = NULL;
1148
1149            /* Always call end_list if start_list succeeded.  */
1150            visit_end_list(m, &err);
1151        }
1152        error_propagate(errp, err);
1153    }
1154}
1155
1156static void visit_type_EventInfo_fields(Visitor *m, EventInfo ** obj, Error **errp)
1157{
1158    Error *err = NULL;
1159    visit_type_str(m, obj ? &(*obj)->name : NULL, "name", &err);
1160
1161    error_propagate(errp, err);
1162}
1163
1164void visit_type_EventInfo(Visitor *m, EventInfo ** obj, const char *name, Error **errp)
1165{
1166    if (!error_is_set(errp)) {
1167        Error *err = NULL;
1168        visit_start_struct(m, (void **)obj, "EventInfo", name, sizeof(EventInfo), &err);
1169        if (!err) {
1170            if (!obj || *obj) {
1171                visit_type_EventInfo_fields(m, obj, &err);
1172                error_propagate(errp, err);
1173                err = NULL;
1174            }
1175            /* Always call end_struct if start_struct succeeded.  */
1176            visit_end_struct(m, &err);
1177        }
1178        error_propagate(errp, err);
1179    }
1180}
1181
1182void visit_type_EventInfoList(Visitor *m, EventInfoList ** obj, const char *name, Error **errp)
1183{
1184    GenericList *i, **prev = (GenericList **)obj;
1185    Error *err = NULL;
1186
1187    if (!error_is_set(errp)) {
1188        visit_start_list(m, name, &err);
1189        if (!err) {
1190            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
1191                EventInfoList *native_i = (EventInfoList *)i;
1192                visit_type_EventInfo(m, &native_i->value, NULL, &err);
1193            }
1194            error_propagate(errp, err);
1195            err = NULL;
1196
1197            /* Always call end_list if start_list succeeded.  */
1198            visit_end_list(m, &err);
1199        }
1200        error_propagate(errp, err);
1201    }
1202}
1203
1204static void visit_type_MigrationStats_fields(Visitor *m, MigrationStats ** obj, Error **errp)
1205{
1206    Error *err = NULL;
1207    visit_type_int(m, obj ? &(*obj)->transferred : NULL, "transferred", &err);
1208    visit_type_int(m, obj ? &(*obj)->remaining : NULL, "remaining", &err);
1209    visit_type_int(m, obj ? &(*obj)->total : NULL, "total", &err);
1210    visit_type_int(m, obj ? &(*obj)->duplicate : NULL, "duplicate", &err);
1211    visit_type_int(m, obj ? &(*obj)->skipped : NULL, "skipped", &err);
1212    visit_type_int(m, obj ? &(*obj)->normal : NULL, "normal", &err);
1213    visit_type_int(m, obj ? &(*obj)->normal_bytes : NULL, "normal-bytes", &err);
1214    visit_type_int(m, obj ? &(*obj)->dirty_pages_rate : NULL, "dirty-pages-rate", &err);
1215    visit_type_number(m, obj ? &(*obj)->mbps : NULL, "mbps", &err);
1216
1217    error_propagate(errp, err);
1218}
1219
1220void visit_type_MigrationStats(Visitor *m, MigrationStats ** obj, const char *name, Error **errp)
1221{
1222    if (!error_is_set(errp)) {
1223        Error *err = NULL;
1224        visit_start_struct(m, (void **)obj, "MigrationStats", name, sizeof(MigrationStats), &err);
1225        if (!err) {
1226            if (!obj || *obj) {
1227                visit_type_MigrationStats_fields(m, obj, &err);
1228                error_propagate(errp, err);
1229                err = NULL;
1230            }
1231            /* Always call end_struct if start_struct succeeded.  */
1232            visit_end_struct(m, &err);
1233        }
1234        error_propagate(errp, err);
1235    }
1236}
1237
1238void visit_type_MigrationStatsList(Visitor *m, MigrationStatsList ** obj, const char *name, Error **errp)
1239{
1240    GenericList *i, **prev = (GenericList **)obj;
1241    Error *err = NULL;
1242
1243    if (!error_is_set(errp)) {
1244        visit_start_list(m, name, &err);
1245        if (!err) {
1246            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
1247                MigrationStatsList *native_i = (MigrationStatsList *)i;
1248                visit_type_MigrationStats(m, &native_i->value, NULL, &err);
1249            }
1250            error_propagate(errp, err);
1251            err = NULL;
1252
1253            /* Always call end_list if start_list succeeded.  */
1254            visit_end_list(m, &err);
1255        }
1256        error_propagate(errp, err);
1257    }
1258}
1259
1260static void visit_type_XBZRLECacheStats_fields(Visitor *m, XBZRLECacheStats ** obj, Error **errp)
1261{
1262    Error *err = NULL;
1263    visit_type_int(m, obj ? &(*obj)->cache_size : NULL, "cache-size", &err);
1264    visit_type_int(m, obj ? &(*obj)->bytes : NULL, "bytes", &err);
1265    visit_type_int(m, obj ? &(*obj)->pages : NULL, "pages", &err);
1266    visit_type_int(m, obj ? &(*obj)->cache_miss : NULL, "cache-miss", &err);
1267    visit_type_int(m, obj ? &(*obj)->overflow : NULL, "overflow", &err);
1268
1269    error_propagate(errp, err);
1270}
1271
1272void visit_type_XBZRLECacheStats(Visitor *m, XBZRLECacheStats ** obj, const char *name, Error **errp)
1273{
1274    if (!error_is_set(errp)) {
1275        Error *err = NULL;
1276        visit_start_struct(m, (void **)obj, "XBZRLECacheStats", name, sizeof(XBZRLECacheStats), &err);
1277        if (!err) {
1278            if (!obj || *obj) {
1279                visit_type_XBZRLECacheStats_fields(m, obj, &err);
1280                error_propagate(errp, err);
1281                err = NULL;
1282            }
1283            /* Always call end_struct if start_struct succeeded.  */
1284            visit_end_struct(m, &err);
1285        }
1286        error_propagate(errp, err);
1287    }
1288}
1289
1290void visit_type_XBZRLECacheStatsList(Visitor *m, XBZRLECacheStatsList ** obj, const char *name, Error **errp)
1291{
1292    GenericList *i, **prev = (GenericList **)obj;
1293    Error *err = NULL;
1294
1295    if (!error_is_set(errp)) {
1296        visit_start_list(m, name, &err);
1297        if (!err) {
1298            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
1299                XBZRLECacheStatsList *native_i = (XBZRLECacheStatsList *)i;
1300                visit_type_XBZRLECacheStats(m, &native_i->value, NULL, &err);
1301            }
1302            error_propagate(errp, err);
1303            err = NULL;
1304
1305            /* Always call end_list if start_list succeeded.  */
1306            visit_end_list(m, &err);
1307        }
1308        error_propagate(errp, err);
1309    }
1310}
1311
1312static void visit_type_MigrationInfo_fields(Visitor *m, MigrationInfo ** obj, Error **errp)
1313{
1314    Error *err = NULL;
1315    visit_start_optional(m, obj ? &(*obj)->has_status : NULL, "status", &err);
1316    if (obj && (*obj)->has_status) {
1317        visit_type_str(m, obj ? &(*obj)->status : NULL, "status", &err);
1318    }
1319    visit_end_optional(m, &err);
1320    visit_start_optional(m, obj ? &(*obj)->has_ram : NULL, "ram", &err);
1321    if (obj && (*obj)->has_ram) {
1322        visit_type_MigrationStats(m, obj ? &(*obj)->ram : NULL, "ram", &err);
1323    }
1324    visit_end_optional(m, &err);
1325    visit_start_optional(m, obj ? &(*obj)->has_disk : NULL, "disk", &err);
1326    if (obj && (*obj)->has_disk) {
1327        visit_type_MigrationStats(m, obj ? &(*obj)->disk : NULL, "disk", &err);
1328    }
1329    visit_end_optional(m, &err);
1330    visit_start_optional(m, obj ? &(*obj)->has_xbzrle_cache : NULL, "xbzrle-cache", &err);
1331    if (obj && (*obj)->has_xbzrle_cache) {
1332        visit_type_XBZRLECacheStats(m, obj ? &(*obj)->xbzrle_cache : NULL, "xbzrle-cache", &err);
1333    }
1334    visit_end_optional(m, &err);
1335    visit_start_optional(m, obj ? &(*obj)->has_total_time : NULL, "total-time", &err);
1336    if (obj && (*obj)->has_total_time) {
1337        visit_type_int(m, obj ? &(*obj)->total_time : NULL, "total-time", &err);
1338    }
1339    visit_end_optional(m, &err);
1340    visit_start_optional(m, obj ? &(*obj)->has_expected_downtime : NULL, "expected-downtime", &err);
1341    if (obj && (*obj)->has_expected_downtime) {
1342        visit_type_int(m, obj ? &(*obj)->expected_downtime : NULL, "expected-downtime", &err);
1343    }
1344    visit_end_optional(m, &err);
1345    visit_start_optional(m, obj ? &(*obj)->has_downtime : NULL, "downtime", &err);
1346    if (obj && (*obj)->has_downtime) {
1347        visit_type_int(m, obj ? &(*obj)->downtime : NULL, "downtime", &err);
1348    }
1349    visit_end_optional(m, &err);
1350    visit_start_optional(m, obj ? &(*obj)->has_setup_time : NULL, "setup-time", &err);
1351    if (obj && (*obj)->has_setup_time) {
1352        visit_type_int(m, obj ? &(*obj)->setup_time : NULL, "setup-time", &err);
1353    }
1354    visit_end_optional(m, &err);
1355
1356    error_propagate(errp, err);
1357}
1358
1359void visit_type_MigrationInfo(Visitor *m, MigrationInfo ** obj, const char *name, Error **errp)
1360{
1361    if (!error_is_set(errp)) {
1362        Error *err = NULL;
1363        visit_start_struct(m, (void **)obj, "MigrationInfo", name, sizeof(MigrationInfo), &err);
1364        if (!err) {
1365            if (!obj || *obj) {
1366                visit_type_MigrationInfo_fields(m, obj, &err);
1367                error_propagate(errp, err);
1368                err = NULL;
1369            }
1370            /* Always call end_struct if start_struct succeeded.  */
1371            visit_end_struct(m, &err);
1372        }
1373        error_propagate(errp, err);
1374    }
1375}
1376
1377void visit_type_MigrationInfoList(Visitor *m, MigrationInfoList ** obj, const char *name, Error **errp)
1378{
1379    GenericList *i, **prev = (GenericList **)obj;
1380    Error *err = NULL;
1381
1382    if (!error_is_set(errp)) {
1383        visit_start_list(m, name, &err);
1384        if (!err) {
1385            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
1386                MigrationInfoList *native_i = (MigrationInfoList *)i;
1387                visit_type_MigrationInfo(m, &native_i->value, NULL, &err);
1388            }
1389            error_propagate(errp, err);
1390            err = NULL;
1391
1392            /* Always call end_list if start_list succeeded.  */
1393            visit_end_list(m, &err);
1394        }
1395        error_propagate(errp, err);
1396    }
1397}
1398
1399void visit_type_MigrationCapabilityList(Visitor *m, MigrationCapabilityList ** obj, const char *name, Error **errp)
1400{
1401    GenericList *i, **prev = (GenericList **)obj;
1402    Error *err = NULL;
1403
1404    if (!error_is_set(errp)) {
1405        visit_start_list(m, name, &err);
1406        if (!err) {
1407            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
1408                MigrationCapabilityList *native_i = (MigrationCapabilityList *)i;
1409                visit_type_MigrationCapability(m, &native_i->value, NULL, &err);
1410            }
1411            error_propagate(errp, err);
1412            err = NULL;
1413
1414            /* Always call end_list if start_list succeeded.  */
1415            visit_end_list(m, &err);
1416        }
1417        error_propagate(errp, err);
1418    }
1419}
1420
1421void visit_type_MigrationCapability(Visitor *m, MigrationCapability * obj, const char *name, Error **errp)
1422{
1423    visit_type_enum(m, (int *)obj, MigrationCapability_lookup, "MigrationCapability", name, errp);
1424}
1425
1426static void visit_type_MigrationCapabilityStatus_fields(Visitor *m, MigrationCapabilityStatus ** obj, Error **errp)
1427{
1428    Error *err = NULL;
1429    visit_type_MigrationCapability(m, obj ? &(*obj)->capability : NULL, "capability", &err);
1430    visit_type_bool(m, obj ? &(*obj)->state : NULL, "state", &err);
1431
1432    error_propagate(errp, err);
1433}
1434
1435void visit_type_MigrationCapabilityStatus(Visitor *m, MigrationCapabilityStatus ** obj, const char *name, Error **errp)
1436{
1437    if (!error_is_set(errp)) {
1438        Error *err = NULL;
1439        visit_start_struct(m, (void **)obj, "MigrationCapabilityStatus", name, sizeof(MigrationCapabilityStatus), &err);
1440        if (!err) {
1441            if (!obj || *obj) {
1442                visit_type_MigrationCapabilityStatus_fields(m, obj, &err);
1443                error_propagate(errp, err);
1444                err = NULL;
1445            }
1446            /* Always call end_struct if start_struct succeeded.  */
1447            visit_end_struct(m, &err);
1448        }
1449        error_propagate(errp, err);
1450    }
1451}
1452
1453void visit_type_MigrationCapabilityStatusList(Visitor *m, MigrationCapabilityStatusList ** obj, const char *name, Error **errp)
1454{
1455    GenericList *i, **prev = (GenericList **)obj;
1456    Error *err = NULL;
1457
1458    if (!error_is_set(errp)) {
1459        visit_start_list(m, name, &err);
1460        if (!err) {
1461            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
1462                MigrationCapabilityStatusList *native_i = (MigrationCapabilityStatusList *)i;
1463                visit_type_MigrationCapabilityStatus(m, &native_i->value, NULL, &err);
1464            }
1465            error_propagate(errp, err);
1466            err = NULL;
1467
1468            /* Always call end_list if start_list succeeded.  */
1469            visit_end_list(m, &err);
1470        }
1471        error_propagate(errp, err);
1472    }
1473}
1474
1475static void visit_type_MouseInfo_fields(Visitor *m, MouseInfo ** obj, Error **errp)
1476{
1477    Error *err = NULL;
1478    visit_type_str(m, obj ? &(*obj)->name : NULL, "name", &err);
1479    visit_type_int(m, obj ? &(*obj)->index : NULL, "index", &err);
1480    visit_type_bool(m, obj ? &(*obj)->current : NULL, "current", &err);
1481    visit_type_bool(m, obj ? &(*obj)->absolute : NULL, "absolute", &err);
1482
1483    error_propagate(errp, err);
1484}
1485
1486void visit_type_MouseInfo(Visitor *m, MouseInfo ** obj, const char *name, Error **errp)
1487{
1488    if (!error_is_set(errp)) {
1489        Error *err = NULL;
1490        visit_start_struct(m, (void **)obj, "MouseInfo", name, sizeof(MouseInfo), &err);
1491        if (!err) {
1492            if (!obj || *obj) {
1493                visit_type_MouseInfo_fields(m, obj, &err);
1494                error_propagate(errp, err);
1495                err = NULL;
1496            }
1497            /* Always call end_struct if start_struct succeeded.  */
1498            visit_end_struct(m, &err);
1499        }
1500        error_propagate(errp, err);
1501    }
1502}
1503
1504void visit_type_MouseInfoList(Visitor *m, MouseInfoList ** obj, const char *name, Error **errp)
1505{
1506    GenericList *i, **prev = (GenericList **)obj;
1507    Error *err = NULL;
1508
1509    if (!error_is_set(errp)) {
1510        visit_start_list(m, name, &err);
1511        if (!err) {
1512            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
1513                MouseInfoList *native_i = (MouseInfoList *)i;
1514                visit_type_MouseInfo(m, &native_i->value, NULL, &err);
1515            }
1516            error_propagate(errp, err);
1517            err = NULL;
1518
1519            /* Always call end_list if start_list succeeded.  */
1520            visit_end_list(m, &err);
1521        }
1522        error_propagate(errp, err);
1523    }
1524}
1525
1526static void visit_type_CpuInfo_fields(Visitor *m, CpuInfo ** obj, Error **errp)
1527{
1528    Error *err = NULL;
1529    visit_type_int(m, obj ? &(*obj)->CPU : NULL, "CPU", &err);
1530    visit_type_bool(m, obj ? &(*obj)->current : NULL, "current", &err);
1531    visit_type_bool(m, obj ? &(*obj)->halted : NULL, "halted", &err);
1532    visit_start_optional(m, obj ? &(*obj)->has_pc : NULL, "pc", &err);
1533    if (obj && (*obj)->has_pc) {
1534        visit_type_int(m, obj ? &(*obj)->pc : NULL, "pc", &err);
1535    }
1536    visit_end_optional(m, &err);
1537    visit_start_optional(m, obj ? &(*obj)->has_nip : NULL, "nip", &err);
1538    if (obj && (*obj)->has_nip) {
1539        visit_type_int(m, obj ? &(*obj)->nip : NULL, "nip", &err);
1540    }
1541    visit_end_optional(m, &err);
1542    visit_start_optional(m, obj ? &(*obj)->has_npc : NULL, "npc", &err);
1543    if (obj && (*obj)->has_npc) {
1544        visit_type_int(m, obj ? &(*obj)->npc : NULL, "npc", &err);
1545    }
1546    visit_end_optional(m, &err);
1547    visit_start_optional(m, obj ? &(*obj)->has_PC : NULL, "PC", &err);
1548    if (obj && (*obj)->has_PC) {
1549        visit_type_int(m, obj ? &(*obj)->PC : NULL, "PC", &err);
1550    }
1551    visit_end_optional(m, &err);
1552    visit_type_int(m, obj ? &(*obj)->thread_id : NULL, "thread_id", &err);
1553
1554    error_propagate(errp, err);
1555}
1556
1557void visit_type_CpuInfo(Visitor *m, CpuInfo ** obj, const char *name, Error **errp)
1558{
1559    if (!error_is_set(errp)) {
1560        Error *err = NULL;
1561        visit_start_struct(m, (void **)obj, "CpuInfo", name, sizeof(CpuInfo), &err);
1562        if (!err) {
1563            if (!obj || *obj) {
1564                visit_type_CpuInfo_fields(m, obj, &err);
1565                error_propagate(errp, err);
1566                err = NULL;
1567            }
1568            /* Always call end_struct if start_struct succeeded.  */
1569            visit_end_struct(m, &err);
1570        }
1571        error_propagate(errp, err);
1572    }
1573}
1574
1575void visit_type_CpuInfoList(Visitor *m, CpuInfoList ** obj, const char *name, Error **errp)
1576{
1577    GenericList *i, **prev = (GenericList **)obj;
1578    Error *err = NULL;
1579
1580    if (!error_is_set(errp)) {
1581        visit_start_list(m, name, &err);
1582        if (!err) {
1583            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
1584                CpuInfoList *native_i = (CpuInfoList *)i;
1585                visit_type_CpuInfo(m, &native_i->value, NULL, &err);
1586            }
1587            error_propagate(errp, err);
1588            err = NULL;
1589
1590            /* Always call end_list if start_list succeeded.  */
1591            visit_end_list(m, &err);
1592        }
1593        error_propagate(errp, err);
1594    }
1595}
1596
1597static void visit_type_BlockDeviceInfo_fields(Visitor *m, BlockDeviceInfo ** obj, Error **errp)
1598{
1599    Error *err = NULL;
1600    visit_type_str(m, obj ? &(*obj)->file : NULL, "file", &err);
1601    visit_type_bool(m, obj ? &(*obj)->ro : NULL, "ro", &err);
1602    visit_type_str(m, obj ? &(*obj)->drv : NULL, "drv", &err);
1603    visit_start_optional(m, obj ? &(*obj)->has_backing_file : NULL, "backing_file", &err);
1604    if (obj && (*obj)->has_backing_file) {
1605        visit_type_str(m, obj ? &(*obj)->backing_file : NULL, "backing_file", &err);
1606    }
1607    visit_end_optional(m, &err);
1608    visit_type_int(m, obj ? &(*obj)->backing_file_depth : NULL, "backing_file_depth", &err);
1609    visit_type_bool(m, obj ? &(*obj)->encrypted : NULL, "encrypted", &err);
1610    visit_type_bool(m, obj ? &(*obj)->encryption_key_missing : NULL, "encryption_key_missing", &err);
1611    visit_type_int(m, obj ? &(*obj)->bps : NULL, "bps", &err);
1612    visit_type_int(m, obj ? &(*obj)->bps_rd : NULL, "bps_rd", &err);
1613    visit_type_int(m, obj ? &(*obj)->bps_wr : NULL, "bps_wr", &err);
1614    visit_type_int(m, obj ? &(*obj)->iops : NULL, "iops", &err);
1615    visit_type_int(m, obj ? &(*obj)->iops_rd : NULL, "iops_rd", &err);
1616    visit_type_int(m, obj ? &(*obj)->iops_wr : NULL, "iops_wr", &err);
1617    visit_type_ImageInfo(m, obj ? &(*obj)->image : NULL, "image", &err);
1618    visit_start_optional(m, obj ? &(*obj)->has_bps_max : NULL, "bps_max", &err);
1619    if (obj && (*obj)->has_bps_max) {
1620        visit_type_int(m, obj ? &(*obj)->bps_max : NULL, "bps_max", &err);
1621    }
1622    visit_end_optional(m, &err);
1623    visit_start_optional(m, obj ? &(*obj)->has_bps_rd_max : NULL, "bps_rd_max", &err);
1624    if (obj && (*obj)->has_bps_rd_max) {
1625        visit_type_int(m, obj ? &(*obj)->bps_rd_max : NULL, "bps_rd_max", &err);
1626    }
1627    visit_end_optional(m, &err);
1628    visit_start_optional(m, obj ? &(*obj)->has_bps_wr_max : NULL, "bps_wr_max", &err);
1629    if (obj && (*obj)->has_bps_wr_max) {
1630        visit_type_int(m, obj ? &(*obj)->bps_wr_max : NULL, "bps_wr_max", &err);
1631    }
1632    visit_end_optional(m, &err);
1633    visit_start_optional(m, obj ? &(*obj)->has_iops_max : NULL, "iops_max", &err);
1634    if (obj && (*obj)->has_iops_max) {
1635        visit_type_int(m, obj ? &(*obj)->iops_max : NULL, "iops_max", &err);
1636    }
1637    visit_end_optional(m, &err);
1638    visit_start_optional(m, obj ? &(*obj)->has_iops_rd_max : NULL, "iops_rd_max", &err);
1639    if (obj && (*obj)->has_iops_rd_max) {
1640        visit_type_int(m, obj ? &(*obj)->iops_rd_max : NULL, "iops_rd_max", &err);
1641    }
1642    visit_end_optional(m, &err);
1643    visit_start_optional(m, obj ? &(*obj)->has_iops_wr_max : NULL, "iops_wr_max", &err);
1644    if (obj && (*obj)->has_iops_wr_max) {
1645        visit_type_int(m, obj ? &(*obj)->iops_wr_max : NULL, "iops_wr_max", &err);
1646    }
1647    visit_end_optional(m, &err);
1648    visit_start_optional(m, obj ? &(*obj)->has_iops_size : NULL, "iops_size", &err);
1649    if (obj && (*obj)->has_iops_size) {
1650        visit_type_int(m, obj ? &(*obj)->iops_size : NULL, "iops_size", &err);
1651    }
1652    visit_end_optional(m, &err);
1653
1654    error_propagate(errp, err);
1655}
1656
1657void visit_type_BlockDeviceInfo(Visitor *m, BlockDeviceInfo ** obj, const char *name, Error **errp)
1658{
1659    if (!error_is_set(errp)) {
1660        Error *err = NULL;
1661        visit_start_struct(m, (void **)obj, "BlockDeviceInfo", name, sizeof(BlockDeviceInfo), &err);
1662        if (!err) {
1663            if (!obj || *obj) {
1664                visit_type_BlockDeviceInfo_fields(m, obj, &err);
1665                error_propagate(errp, err);
1666                err = NULL;
1667            }
1668            /* Always call end_struct if start_struct succeeded.  */
1669            visit_end_struct(m, &err);
1670        }
1671        error_propagate(errp, err);
1672    }
1673}
1674
1675void visit_type_BlockDeviceInfoList(Visitor *m, BlockDeviceInfoList ** obj, const char *name, Error **errp)
1676{
1677    GenericList *i, **prev = (GenericList **)obj;
1678    Error *err = NULL;
1679
1680    if (!error_is_set(errp)) {
1681        visit_start_list(m, name, &err);
1682        if (!err) {
1683            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
1684                BlockDeviceInfoList *native_i = (BlockDeviceInfoList *)i;
1685                visit_type_BlockDeviceInfo(m, &native_i->value, NULL, &err);
1686            }
1687            error_propagate(errp, err);
1688            err = NULL;
1689
1690            /* Always call end_list if start_list succeeded.  */
1691            visit_end_list(m, &err);
1692        }
1693        error_propagate(errp, err);
1694    }
1695}
1696
1697void visit_type_BlockDeviceIoStatusList(Visitor *m, BlockDeviceIoStatusList ** obj, const char *name, Error **errp)
1698{
1699    GenericList *i, **prev = (GenericList **)obj;
1700    Error *err = NULL;
1701
1702    if (!error_is_set(errp)) {
1703        visit_start_list(m, name, &err);
1704        if (!err) {
1705            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
1706                BlockDeviceIoStatusList *native_i = (BlockDeviceIoStatusList *)i;
1707                visit_type_BlockDeviceIoStatus(m, &native_i->value, NULL, &err);
1708            }
1709            error_propagate(errp, err);
1710            err = NULL;
1711
1712            /* Always call end_list if start_list succeeded.  */
1713            visit_end_list(m, &err);
1714        }
1715        error_propagate(errp, err);
1716    }
1717}
1718
1719void visit_type_BlockDeviceIoStatus(Visitor *m, BlockDeviceIoStatus * obj, const char *name, Error **errp)
1720{
1721    visit_type_enum(m, (int *)obj, BlockDeviceIoStatus_lookup, "BlockDeviceIoStatus", name, errp);
1722}
1723
1724static void visit_type_BlockDeviceMapEntry_fields(Visitor *m, BlockDeviceMapEntry ** obj, Error **errp)
1725{
1726    Error *err = NULL;
1727    visit_type_int(m, obj ? &(*obj)->start : NULL, "start", &err);
1728    visit_type_int(m, obj ? &(*obj)->length : NULL, "length", &err);
1729    visit_type_int(m, obj ? &(*obj)->depth : NULL, "depth", &err);
1730    visit_type_bool(m, obj ? &(*obj)->zero : NULL, "zero", &err);
1731    visit_type_bool(m, obj ? &(*obj)->data : NULL, "data", &err);
1732    visit_start_optional(m, obj ? &(*obj)->has_offset : NULL, "offset", &err);
1733    if (obj && (*obj)->has_offset) {
1734        visit_type_int(m, obj ? &(*obj)->offset : NULL, "offset", &err);
1735    }
1736    visit_end_optional(m, &err);
1737
1738    error_propagate(errp, err);
1739}
1740
1741void visit_type_BlockDeviceMapEntry(Visitor *m, BlockDeviceMapEntry ** obj, const char *name, Error **errp)
1742{
1743    if (!error_is_set(errp)) {
1744        Error *err = NULL;
1745        visit_start_struct(m, (void **)obj, "BlockDeviceMapEntry", name, sizeof(BlockDeviceMapEntry), &err);
1746        if (!err) {
1747            if (!obj || *obj) {
1748                visit_type_BlockDeviceMapEntry_fields(m, obj, &err);
1749                error_propagate(errp, err);
1750                err = NULL;
1751            }
1752            /* Always call end_struct if start_struct succeeded.  */
1753            visit_end_struct(m, &err);
1754        }
1755        error_propagate(errp, err);
1756    }
1757}
1758
1759void visit_type_BlockDeviceMapEntryList(Visitor *m, BlockDeviceMapEntryList ** obj, const char *name, Error **errp)
1760{
1761    GenericList *i, **prev = (GenericList **)obj;
1762    Error *err = NULL;
1763
1764    if (!error_is_set(errp)) {
1765        visit_start_list(m, name, &err);
1766        if (!err) {
1767            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
1768                BlockDeviceMapEntryList *native_i = (BlockDeviceMapEntryList *)i;
1769                visit_type_BlockDeviceMapEntry(m, &native_i->value, NULL, &err);
1770            }
1771            error_propagate(errp, err);
1772            err = NULL;
1773
1774            /* Always call end_list if start_list succeeded.  */
1775            visit_end_list(m, &err);
1776        }
1777        error_propagate(errp, err);
1778    }
1779}
1780
1781static void visit_type_BlockDirtyInfo_fields(Visitor *m, BlockDirtyInfo ** obj, Error **errp)
1782{
1783    Error *err = NULL;
1784    visit_type_int(m, obj ? &(*obj)->count : NULL, "count", &err);
1785    visit_type_int(m, obj ? &(*obj)->granularity : NULL, "granularity", &err);
1786
1787    error_propagate(errp, err);
1788}
1789
1790void visit_type_BlockDirtyInfo(Visitor *m, BlockDirtyInfo ** obj, const char *name, Error **errp)
1791{
1792    if (!error_is_set(errp)) {
1793        Error *err = NULL;
1794        visit_start_struct(m, (void **)obj, "BlockDirtyInfo", name, sizeof(BlockDirtyInfo), &err);
1795        if (!err) {
1796            if (!obj || *obj) {
1797                visit_type_BlockDirtyInfo_fields(m, obj, &err);
1798                error_propagate(errp, err);
1799                err = NULL;
1800            }
1801            /* Always call end_struct if start_struct succeeded.  */
1802            visit_end_struct(m, &err);
1803        }
1804        error_propagate(errp, err);
1805    }
1806}
1807
1808void visit_type_BlockDirtyInfoList(Visitor *m, BlockDirtyInfoList ** obj, const char *name, Error **errp)
1809{
1810    GenericList *i, **prev = (GenericList **)obj;
1811    Error *err = NULL;
1812
1813    if (!error_is_set(errp)) {
1814        visit_start_list(m, name, &err);
1815        if (!err) {
1816            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
1817                BlockDirtyInfoList *native_i = (BlockDirtyInfoList *)i;
1818                visit_type_BlockDirtyInfo(m, &native_i->value, NULL, &err);
1819            }
1820            error_propagate(errp, err);
1821            err = NULL;
1822
1823            /* Always call end_list if start_list succeeded.  */
1824            visit_end_list(m, &err);
1825        }
1826        error_propagate(errp, err);
1827    }
1828}
1829
1830static void visit_type_BlockInfo_fields(Visitor *m, BlockInfo ** obj, Error **errp)
1831{
1832    Error *err = NULL;
1833    visit_type_str(m, obj ? &(*obj)->device : NULL, "device", &err);
1834    visit_type_str(m, obj ? &(*obj)->type : NULL, "type", &err);
1835    visit_type_bool(m, obj ? &(*obj)->removable : NULL, "removable", &err);
1836    visit_type_bool(m, obj ? &(*obj)->locked : NULL, "locked", &err);
1837    visit_start_optional(m, obj ? &(*obj)->has_inserted : NULL, "inserted", &err);
1838    if (obj && (*obj)->has_inserted) {
1839        visit_type_BlockDeviceInfo(m, obj ? &(*obj)->inserted : NULL, "inserted", &err);
1840    }
1841    visit_end_optional(m, &err);
1842    visit_start_optional(m, obj ? &(*obj)->has_tray_open : NULL, "tray_open", &err);
1843    if (obj && (*obj)->has_tray_open) {
1844        visit_type_bool(m, obj ? &(*obj)->tray_open : NULL, "tray_open", &err);
1845    }
1846    visit_end_optional(m, &err);
1847    visit_start_optional(m, obj ? &(*obj)->has_io_status : NULL, "io-status", &err);
1848    if (obj && (*obj)->has_io_status) {
1849        visit_type_BlockDeviceIoStatus(m, obj ? &(*obj)->io_status : NULL, "io-status", &err);
1850    }
1851    visit_end_optional(m, &err);
1852    visit_start_optional(m, obj ? &(*obj)->has_dirty_bitmaps : NULL, "dirty-bitmaps", &err);
1853    if (obj && (*obj)->has_dirty_bitmaps) {
1854        visit_type_BlockDirtyInfoList(m, obj ? &(*obj)->dirty_bitmaps : NULL, "dirty-bitmaps", &err);
1855    }
1856    visit_end_optional(m, &err);
1857
1858    error_propagate(errp, err);
1859}
1860
1861void visit_type_BlockInfo(Visitor *m, BlockInfo ** obj, const char *name, Error **errp)
1862{
1863    if (!error_is_set(errp)) {
1864        Error *err = NULL;
1865        visit_start_struct(m, (void **)obj, "BlockInfo", name, sizeof(BlockInfo), &err);
1866        if (!err) {
1867            if (!obj || *obj) {
1868                visit_type_BlockInfo_fields(m, obj, &err);
1869                error_propagate(errp, err);
1870                err = NULL;
1871            }
1872            /* Always call end_struct if start_struct succeeded.  */
1873            visit_end_struct(m, &err);
1874        }
1875        error_propagate(errp, err);
1876    }
1877}
1878
1879void visit_type_BlockInfoList(Visitor *m, BlockInfoList ** obj, const char *name, Error **errp)
1880{
1881    GenericList *i, **prev = (GenericList **)obj;
1882    Error *err = NULL;
1883
1884    if (!error_is_set(errp)) {
1885        visit_start_list(m, name, &err);
1886        if (!err) {
1887            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
1888                BlockInfoList *native_i = (BlockInfoList *)i;
1889                visit_type_BlockInfo(m, &native_i->value, NULL, &err);
1890            }
1891            error_propagate(errp, err);
1892            err = NULL;
1893
1894            /* Always call end_list if start_list succeeded.  */
1895            visit_end_list(m, &err);
1896        }
1897        error_propagate(errp, err);
1898    }
1899}
1900
1901static void visit_type_BlockDeviceStats_fields(Visitor *m, BlockDeviceStats ** obj, Error **errp)
1902{
1903    Error *err = NULL;
1904    visit_type_int(m, obj ? &(*obj)->rd_bytes : NULL, "rd_bytes", &err);
1905    visit_type_int(m, obj ? &(*obj)->wr_bytes : NULL, "wr_bytes", &err);
1906    visit_type_int(m, obj ? &(*obj)->rd_operations : NULL, "rd_operations", &err);
1907    visit_type_int(m, obj ? &(*obj)->wr_operations : NULL, "wr_operations", &err);
1908    visit_type_int(m, obj ? &(*obj)->flush_operations : NULL, "flush_operations", &err);
1909    visit_type_int(m, obj ? &(*obj)->flush_total_time_ns : NULL, "flush_total_time_ns", &err);
1910    visit_type_int(m, obj ? &(*obj)->wr_total_time_ns : NULL, "wr_total_time_ns", &err);
1911    visit_type_int(m, obj ? &(*obj)->rd_total_time_ns : NULL, "rd_total_time_ns", &err);
1912    visit_type_int(m, obj ? &(*obj)->wr_highest_offset : NULL, "wr_highest_offset", &err);
1913
1914    error_propagate(errp, err);
1915}
1916
1917void visit_type_BlockDeviceStats(Visitor *m, BlockDeviceStats ** obj, const char *name, Error **errp)
1918{
1919    if (!error_is_set(errp)) {
1920        Error *err = NULL;
1921        visit_start_struct(m, (void **)obj, "BlockDeviceStats", name, sizeof(BlockDeviceStats), &err);
1922        if (!err) {
1923            if (!obj || *obj) {
1924                visit_type_BlockDeviceStats_fields(m, obj, &err);
1925                error_propagate(errp, err);
1926                err = NULL;
1927            }
1928            /* Always call end_struct if start_struct succeeded.  */
1929            visit_end_struct(m, &err);
1930        }
1931        error_propagate(errp, err);
1932    }
1933}
1934
1935void visit_type_BlockDeviceStatsList(Visitor *m, BlockDeviceStatsList ** obj, const char *name, Error **errp)
1936{
1937    GenericList *i, **prev = (GenericList **)obj;
1938    Error *err = NULL;
1939
1940    if (!error_is_set(errp)) {
1941        visit_start_list(m, name, &err);
1942        if (!err) {
1943            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
1944                BlockDeviceStatsList *native_i = (BlockDeviceStatsList *)i;
1945                visit_type_BlockDeviceStats(m, &native_i->value, NULL, &err);
1946            }
1947            error_propagate(errp, err);
1948            err = NULL;
1949
1950            /* Always call end_list if start_list succeeded.  */
1951            visit_end_list(m, &err);
1952        }
1953        error_propagate(errp, err);
1954    }
1955}
1956
1957static void visit_type_BlockStats_fields(Visitor *m, BlockStats ** obj, Error **errp)
1958{
1959    Error *err = NULL;
1960    visit_start_optional(m, obj ? &(*obj)->has_device : NULL, "device", &err);
1961    if (obj && (*obj)->has_device) {
1962        visit_type_str(m, obj ? &(*obj)->device : NULL, "device", &err);
1963    }
1964    visit_end_optional(m, &err);
1965    visit_type_BlockDeviceStats(m, obj ? &(*obj)->stats : NULL, "stats", &err);
1966    visit_start_optional(m, obj ? &(*obj)->has_parent : NULL, "parent", &err);
1967    if (obj && (*obj)->has_parent) {
1968        visit_type_BlockStats(m, obj ? &(*obj)->parent : NULL, "parent", &err);
1969    }
1970    visit_end_optional(m, &err);
1971
1972    error_propagate(errp, err);
1973}
1974
1975void visit_type_BlockStats(Visitor *m, BlockStats ** obj, const char *name, Error **errp)
1976{
1977    if (!error_is_set(errp)) {
1978        Error *err = NULL;
1979        visit_start_struct(m, (void **)obj, "BlockStats", name, sizeof(BlockStats), &err);
1980        if (!err) {
1981            if (!obj || *obj) {
1982                visit_type_BlockStats_fields(m, obj, &err);
1983                error_propagate(errp, err);
1984                err = NULL;
1985            }
1986            /* Always call end_struct if start_struct succeeded.  */
1987            visit_end_struct(m, &err);
1988        }
1989        error_propagate(errp, err);
1990    }
1991}
1992
1993void visit_type_BlockStatsList(Visitor *m, BlockStatsList ** obj, const char *name, Error **errp)
1994{
1995    GenericList *i, **prev = (GenericList **)obj;
1996    Error *err = NULL;
1997
1998    if (!error_is_set(errp)) {
1999        visit_start_list(m, name, &err);
2000        if (!err) {
2001            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
2002                BlockStatsList *native_i = (BlockStatsList *)i;
2003                visit_type_BlockStats(m, &native_i->value, NULL, &err);
2004            }
2005            error_propagate(errp, err);
2006            err = NULL;
2007
2008            /* Always call end_list if start_list succeeded.  */
2009            visit_end_list(m, &err);
2010        }
2011        error_propagate(errp, err);
2012    }
2013}
2014
2015static void visit_type_VncClientInfo_fields(Visitor *m, VncClientInfo ** obj, Error **errp)
2016{
2017    Error *err = NULL;
2018    visit_type_str(m, obj ? &(*obj)->host : NULL, "host", &err);
2019    visit_type_str(m, obj ? &(*obj)->family : NULL, "family", &err);
2020    visit_type_str(m, obj ? &(*obj)->service : NULL, "service", &err);
2021    visit_start_optional(m, obj ? &(*obj)->has_x509_dname : NULL, "x509_dname", &err);
2022    if (obj && (*obj)->has_x509_dname) {
2023        visit_type_str(m, obj ? &(*obj)->x509_dname : NULL, "x509_dname", &err);
2024    }
2025    visit_end_optional(m, &err);
2026    visit_start_optional(m, obj ? &(*obj)->has_sasl_username : NULL, "sasl_username", &err);
2027    if (obj && (*obj)->has_sasl_username) {
2028        visit_type_str(m, obj ? &(*obj)->sasl_username : NULL, "sasl_username", &err);
2029    }
2030    visit_end_optional(m, &err);
2031
2032    error_propagate(errp, err);
2033}
2034
2035void visit_type_VncClientInfo(Visitor *m, VncClientInfo ** obj, const char *name, Error **errp)
2036{
2037    if (!error_is_set(errp)) {
2038        Error *err = NULL;
2039        visit_start_struct(m, (void **)obj, "VncClientInfo", name, sizeof(VncClientInfo), &err);
2040        if (!err) {
2041            if (!obj || *obj) {
2042                visit_type_VncClientInfo_fields(m, obj, &err);
2043                error_propagate(errp, err);
2044                err = NULL;
2045            }
2046            /* Always call end_struct if start_struct succeeded.  */
2047            visit_end_struct(m, &err);
2048        }
2049        error_propagate(errp, err);
2050    }
2051}
2052
2053void visit_type_VncClientInfoList(Visitor *m, VncClientInfoList ** obj, const char *name, Error **errp)
2054{
2055    GenericList *i, **prev = (GenericList **)obj;
2056    Error *err = NULL;
2057
2058    if (!error_is_set(errp)) {
2059        visit_start_list(m, name, &err);
2060        if (!err) {
2061            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
2062                VncClientInfoList *native_i = (VncClientInfoList *)i;
2063                visit_type_VncClientInfo(m, &native_i->value, NULL, &err);
2064            }
2065            error_propagate(errp, err);
2066            err = NULL;
2067
2068            /* Always call end_list if start_list succeeded.  */
2069            visit_end_list(m, &err);
2070        }
2071        error_propagate(errp, err);
2072    }
2073}
2074
2075static void visit_type_VncInfo_fields(Visitor *m, VncInfo ** obj, Error **errp)
2076{
2077    Error *err = NULL;
2078    visit_type_bool(m, obj ? &(*obj)->enabled : NULL, "enabled", &err);
2079    visit_start_optional(m, obj ? &(*obj)->has_host : NULL, "host", &err);
2080    if (obj && (*obj)->has_host) {
2081        visit_type_str(m, obj ? &(*obj)->host : NULL, "host", &err);
2082    }
2083    visit_end_optional(m, &err);
2084    visit_start_optional(m, obj ? &(*obj)->has_family : NULL, "family", &err);
2085    if (obj && (*obj)->has_family) {
2086        visit_type_str(m, obj ? &(*obj)->family : NULL, "family", &err);
2087    }
2088    visit_end_optional(m, &err);
2089    visit_start_optional(m, obj ? &(*obj)->has_service : NULL, "service", &err);
2090    if (obj && (*obj)->has_service) {
2091        visit_type_str(m, obj ? &(*obj)->service : NULL, "service", &err);
2092    }
2093    visit_end_optional(m, &err);
2094    visit_start_optional(m, obj ? &(*obj)->has_auth : NULL, "auth", &err);
2095    if (obj && (*obj)->has_auth) {
2096        visit_type_str(m, obj ? &(*obj)->auth : NULL, "auth", &err);
2097    }
2098    visit_end_optional(m, &err);
2099    visit_start_optional(m, obj ? &(*obj)->has_clients : NULL, "clients", &err);
2100    if (obj && (*obj)->has_clients) {
2101        visit_type_VncClientInfoList(m, obj ? &(*obj)->clients : NULL, "clients", &err);
2102    }
2103    visit_end_optional(m, &err);
2104
2105    error_propagate(errp, err);
2106}
2107
2108void visit_type_VncInfo(Visitor *m, VncInfo ** obj, const char *name, Error **errp)
2109{
2110    if (!error_is_set(errp)) {
2111        Error *err = NULL;
2112        visit_start_struct(m, (void **)obj, "VncInfo", name, sizeof(VncInfo), &err);
2113        if (!err) {
2114            if (!obj || *obj) {
2115                visit_type_VncInfo_fields(m, obj, &err);
2116                error_propagate(errp, err);
2117                err = NULL;
2118            }
2119            /* Always call end_struct if start_struct succeeded.  */
2120            visit_end_struct(m, &err);
2121        }
2122        error_propagate(errp, err);
2123    }
2124}
2125
2126void visit_type_VncInfoList(Visitor *m, VncInfoList ** obj, const char *name, Error **errp)
2127{
2128    GenericList *i, **prev = (GenericList **)obj;
2129    Error *err = NULL;
2130
2131    if (!error_is_set(errp)) {
2132        visit_start_list(m, name, &err);
2133        if (!err) {
2134            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
2135                VncInfoList *native_i = (VncInfoList *)i;
2136                visit_type_VncInfo(m, &native_i->value, NULL, &err);
2137            }
2138            error_propagate(errp, err);
2139            err = NULL;
2140
2141            /* Always call end_list if start_list succeeded.  */
2142            visit_end_list(m, &err);
2143        }
2144        error_propagate(errp, err);
2145    }
2146}
2147
2148static void visit_type_SpiceChannel_fields(Visitor *m, SpiceChannel ** obj, Error **errp)
2149{
2150    Error *err = NULL;
2151    visit_type_str(m, obj ? &(*obj)->host : NULL, "host", &err);
2152    visit_type_str(m, obj ? &(*obj)->family : NULL, "family", &err);
2153    visit_type_str(m, obj ? &(*obj)->port : NULL, "port", &err);
2154    visit_type_int(m, obj ? &(*obj)->connection_id : NULL, "connection-id", &err);
2155    visit_type_int(m, obj ? &(*obj)->channel_type : NULL, "channel-type", &err);
2156    visit_type_int(m, obj ? &(*obj)->channel_id : NULL, "channel-id", &err);
2157    visit_type_bool(m, obj ? &(*obj)->tls : NULL, "tls", &err);
2158
2159    error_propagate(errp, err);
2160}
2161
2162void visit_type_SpiceChannel(Visitor *m, SpiceChannel ** obj, const char *name, Error **errp)
2163{
2164    if (!error_is_set(errp)) {
2165        Error *err = NULL;
2166        visit_start_struct(m, (void **)obj, "SpiceChannel", name, sizeof(SpiceChannel), &err);
2167        if (!err) {
2168            if (!obj || *obj) {
2169                visit_type_SpiceChannel_fields(m, obj, &err);
2170                error_propagate(errp, err);
2171                err = NULL;
2172            }
2173            /* Always call end_struct if start_struct succeeded.  */
2174            visit_end_struct(m, &err);
2175        }
2176        error_propagate(errp, err);
2177    }
2178}
2179
2180void visit_type_SpiceChannelList(Visitor *m, SpiceChannelList ** obj, const char *name, Error **errp)
2181{
2182    GenericList *i, **prev = (GenericList **)obj;
2183    Error *err = NULL;
2184
2185    if (!error_is_set(errp)) {
2186        visit_start_list(m, name, &err);
2187        if (!err) {
2188            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
2189                SpiceChannelList *native_i = (SpiceChannelList *)i;
2190                visit_type_SpiceChannel(m, &native_i->value, NULL, &err);
2191            }
2192            error_propagate(errp, err);
2193            err = NULL;
2194
2195            /* Always call end_list if start_list succeeded.  */
2196            visit_end_list(m, &err);
2197        }
2198        error_propagate(errp, err);
2199    }
2200}
2201
2202void visit_type_SpiceQueryMouseModeList(Visitor *m, SpiceQueryMouseModeList ** obj, const char *name, Error **errp)
2203{
2204    GenericList *i, **prev = (GenericList **)obj;
2205    Error *err = NULL;
2206
2207    if (!error_is_set(errp)) {
2208        visit_start_list(m, name, &err);
2209        if (!err) {
2210            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
2211                SpiceQueryMouseModeList *native_i = (SpiceQueryMouseModeList *)i;
2212                visit_type_SpiceQueryMouseMode(m, &native_i->value, NULL, &err);
2213            }
2214            error_propagate(errp, err);
2215            err = NULL;
2216
2217            /* Always call end_list if start_list succeeded.  */
2218            visit_end_list(m, &err);
2219        }
2220        error_propagate(errp, err);
2221    }
2222}
2223
2224void visit_type_SpiceQueryMouseMode(Visitor *m, SpiceQueryMouseMode * obj, const char *name, Error **errp)
2225{
2226    visit_type_enum(m, (int *)obj, SpiceQueryMouseMode_lookup, "SpiceQueryMouseMode", name, errp);
2227}
2228
2229static void visit_type_SpiceInfo_fields(Visitor *m, SpiceInfo ** obj, Error **errp)
2230{
2231    Error *err = NULL;
2232    visit_type_bool(m, obj ? &(*obj)->enabled : NULL, "enabled", &err);
2233    visit_type_bool(m, obj ? &(*obj)->migrated : NULL, "migrated", &err);
2234    visit_start_optional(m, obj ? &(*obj)->has_host : NULL, "host", &err);
2235    if (obj && (*obj)->has_host) {
2236        visit_type_str(m, obj ? &(*obj)->host : NULL, "host", &err);
2237    }
2238    visit_end_optional(m, &err);
2239    visit_start_optional(m, obj ? &(*obj)->has_port : NULL, "port", &err);
2240    if (obj && (*obj)->has_port) {
2241        visit_type_int(m, obj ? &(*obj)->port : NULL, "port", &err);
2242    }
2243    visit_end_optional(m, &err);
2244    visit_start_optional(m, obj ? &(*obj)->has_tls_port : NULL, "tls-port", &err);
2245    if (obj && (*obj)->has_tls_port) {
2246        visit_type_int(m, obj ? &(*obj)->tls_port : NULL, "tls-port", &err);
2247    }
2248    visit_end_optional(m, &err);
2249    visit_start_optional(m, obj ? &(*obj)->has_auth : NULL, "auth", &err);
2250    if (obj && (*obj)->has_auth) {
2251        visit_type_str(m, obj ? &(*obj)->auth : NULL, "auth", &err);
2252    }
2253    visit_end_optional(m, &err);
2254    visit_start_optional(m, obj ? &(*obj)->has_compiled_version : NULL, "compiled-version", &err);
2255    if (obj && (*obj)->has_compiled_version) {
2256        visit_type_str(m, obj ? &(*obj)->compiled_version : NULL, "compiled-version", &err);
2257    }
2258    visit_end_optional(m, &err);
2259    visit_type_SpiceQueryMouseMode(m, obj ? &(*obj)->mouse_mode : NULL, "mouse-mode", &err);
2260    visit_start_optional(m, obj ? &(*obj)->has_channels : NULL, "channels", &err);
2261    if (obj && (*obj)->has_channels) {
2262        visit_type_SpiceChannelList(m, obj ? &(*obj)->channels : NULL, "channels", &err);
2263    }
2264    visit_end_optional(m, &err);
2265
2266    error_propagate(errp, err);
2267}
2268
2269void visit_type_SpiceInfo(Visitor *m, SpiceInfo ** obj, const char *name, Error **errp)
2270{
2271    if (!error_is_set(errp)) {
2272        Error *err = NULL;
2273        visit_start_struct(m, (void **)obj, "SpiceInfo", name, sizeof(SpiceInfo), &err);
2274        if (!err) {
2275            if (!obj || *obj) {
2276                visit_type_SpiceInfo_fields(m, obj, &err);
2277                error_propagate(errp, err);
2278                err = NULL;
2279            }
2280            /* Always call end_struct if start_struct succeeded.  */
2281            visit_end_struct(m, &err);
2282        }
2283        error_propagate(errp, err);
2284    }
2285}
2286
2287void visit_type_SpiceInfoList(Visitor *m, SpiceInfoList ** obj, const char *name, Error **errp)
2288{
2289    GenericList *i, **prev = (GenericList **)obj;
2290    Error *err = NULL;
2291
2292    if (!error_is_set(errp)) {
2293        visit_start_list(m, name, &err);
2294        if (!err) {
2295            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
2296                SpiceInfoList *native_i = (SpiceInfoList *)i;
2297                visit_type_SpiceInfo(m, &native_i->value, NULL, &err);
2298            }
2299            error_propagate(errp, err);
2300            err = NULL;
2301
2302            /* Always call end_list if start_list succeeded.  */
2303            visit_end_list(m, &err);
2304        }
2305        error_propagate(errp, err);
2306    }
2307}
2308
2309static void visit_type_BalloonInfo_fields(Visitor *m, BalloonInfo ** obj, Error **errp)
2310{
2311    Error *err = NULL;
2312    visit_type_int(m, obj ? &(*obj)->actual : NULL, "actual", &err);
2313
2314    error_propagate(errp, err);
2315}
2316
2317void visit_type_BalloonInfo(Visitor *m, BalloonInfo ** obj, const char *name, Error **errp)
2318{
2319    if (!error_is_set(errp)) {
2320        Error *err = NULL;
2321        visit_start_struct(m, (void **)obj, "BalloonInfo", name, sizeof(BalloonInfo), &err);
2322        if (!err) {
2323            if (!obj || *obj) {
2324                visit_type_BalloonInfo_fields(m, obj, &err);
2325                error_propagate(errp, err);
2326                err = NULL;
2327            }
2328            /* Always call end_struct if start_struct succeeded.  */
2329            visit_end_struct(m, &err);
2330        }
2331        error_propagate(errp, err);
2332    }
2333}
2334
2335void visit_type_BalloonInfoList(Visitor *m, BalloonInfoList ** obj, const char *name, Error **errp)
2336{
2337    GenericList *i, **prev = (GenericList **)obj;
2338    Error *err = NULL;
2339
2340    if (!error_is_set(errp)) {
2341        visit_start_list(m, name, &err);
2342        if (!err) {
2343            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
2344                BalloonInfoList *native_i = (BalloonInfoList *)i;
2345                visit_type_BalloonInfo(m, &native_i->value, NULL, &err);
2346            }
2347            error_propagate(errp, err);
2348            err = NULL;
2349
2350            /* Always call end_list if start_list succeeded.  */
2351            visit_end_list(m, &err);
2352        }
2353        error_propagate(errp, err);
2354    }
2355}
2356
2357static void visit_type_PciMemoryRange_fields(Visitor *m, PciMemoryRange ** obj, Error **errp)
2358{
2359    Error *err = NULL;
2360    visit_type_int(m, obj ? &(*obj)->base : NULL, "base", &err);
2361    visit_type_int(m, obj ? &(*obj)->limit : NULL, "limit", &err);
2362
2363    error_propagate(errp, err);
2364}
2365
2366void visit_type_PciMemoryRange(Visitor *m, PciMemoryRange ** obj, const char *name, Error **errp)
2367{
2368    if (!error_is_set(errp)) {
2369        Error *err = NULL;
2370        visit_start_struct(m, (void **)obj, "PciMemoryRange", name, sizeof(PciMemoryRange), &err);
2371        if (!err) {
2372            if (!obj || *obj) {
2373                visit_type_PciMemoryRange_fields(m, obj, &err);
2374                error_propagate(errp, err);
2375                err = NULL;
2376            }
2377            /* Always call end_struct if start_struct succeeded.  */
2378            visit_end_struct(m, &err);
2379        }
2380        error_propagate(errp, err);
2381    }
2382}
2383
2384void visit_type_PciMemoryRangeList(Visitor *m, PciMemoryRangeList ** obj, const char *name, Error **errp)
2385{
2386    GenericList *i, **prev = (GenericList **)obj;
2387    Error *err = NULL;
2388
2389    if (!error_is_set(errp)) {
2390        visit_start_list(m, name, &err);
2391        if (!err) {
2392            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
2393                PciMemoryRangeList *native_i = (PciMemoryRangeList *)i;
2394                visit_type_PciMemoryRange(m, &native_i->value, NULL, &err);
2395            }
2396            error_propagate(errp, err);
2397            err = NULL;
2398
2399            /* Always call end_list if start_list succeeded.  */
2400            visit_end_list(m, &err);
2401        }
2402        error_propagate(errp, err);
2403    }
2404}
2405
2406static void visit_type_PciMemoryRegion_fields(Visitor *m, PciMemoryRegion ** obj, Error **errp)
2407{
2408    Error *err = NULL;
2409    visit_type_int(m, obj ? &(*obj)->bar : NULL, "bar", &err);
2410    visit_type_str(m, obj ? &(*obj)->type : NULL, "type", &err);
2411    visit_type_int(m, obj ? &(*obj)->address : NULL, "address", &err);
2412    visit_type_int(m, obj ? &(*obj)->size : NULL, "size", &err);
2413    visit_start_optional(m, obj ? &(*obj)->has_prefetch : NULL, "prefetch", &err);
2414    if (obj && (*obj)->has_prefetch) {
2415        visit_type_bool(m, obj ? &(*obj)->prefetch : NULL, "prefetch", &err);
2416    }
2417    visit_end_optional(m, &err);
2418    visit_start_optional(m, obj ? &(*obj)->has_mem_type_64 : NULL, "mem_type_64", &err);
2419    if (obj && (*obj)->has_mem_type_64) {
2420        visit_type_bool(m, obj ? &(*obj)->mem_type_64 : NULL, "mem_type_64", &err);
2421    }
2422    visit_end_optional(m, &err);
2423
2424    error_propagate(errp, err);
2425}
2426
2427void visit_type_PciMemoryRegion(Visitor *m, PciMemoryRegion ** obj, const char *name, Error **errp)
2428{
2429    if (!error_is_set(errp)) {
2430        Error *err = NULL;
2431        visit_start_struct(m, (void **)obj, "PciMemoryRegion", name, sizeof(PciMemoryRegion), &err);
2432        if (!err) {
2433            if (!obj || *obj) {
2434                visit_type_PciMemoryRegion_fields(m, obj, &err);
2435                error_propagate(errp, err);
2436                err = NULL;
2437            }
2438            /* Always call end_struct if start_struct succeeded.  */
2439            visit_end_struct(m, &err);
2440        }
2441        error_propagate(errp, err);
2442    }
2443}
2444
2445void visit_type_PciMemoryRegionList(Visitor *m, PciMemoryRegionList ** obj, const char *name, Error **errp)
2446{
2447    GenericList *i, **prev = (GenericList **)obj;
2448    Error *err = NULL;
2449
2450    if (!error_is_set(errp)) {
2451        visit_start_list(m, name, &err);
2452        if (!err) {
2453            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
2454                PciMemoryRegionList *native_i = (PciMemoryRegionList *)i;
2455                visit_type_PciMemoryRegion(m, &native_i->value, NULL, &err);
2456            }
2457            error_propagate(errp, err);
2458            err = NULL;
2459
2460            /* Always call end_list if start_list succeeded.  */
2461            visit_end_list(m, &err);
2462        }
2463        error_propagate(errp, err);
2464    }
2465}
2466
2467static void visit_type_PciBridgeInfo_bus_fields(Visitor *m, PciBridgeInfo ** obj, Error **errp)
2468{
2469    Error *err = NULL;
2470    visit_type_int(m, obj ? &(*obj)->bus.number : NULL, "number", &err);
2471    visit_type_int(m, obj ? &(*obj)->bus.secondary : NULL, "secondary", &err);
2472    visit_type_int(m, obj ? &(*obj)->bus.subordinate : NULL, "subordinate", &err);
2473    visit_type_PciMemoryRange(m, obj ? &(*obj)->bus.io_range : NULL, "io_range", &err);
2474    visit_type_PciMemoryRange(m, obj ? &(*obj)->bus.memory_range : NULL, "memory_range", &err);
2475    visit_type_PciMemoryRange(m, obj ? &(*obj)->bus.prefetchable_range : NULL, "prefetchable_range", &err);
2476
2477    error_propagate(errp, err);
2478}
2479
2480static void visit_type_PciBridgeInfo_fields(Visitor *m, PciBridgeInfo ** obj, Error **errp)
2481{
2482    Error *err = NULL;
2483    if (!error_is_set(errp)) {
2484        Error **errp = &err; /* from outer scope */
2485        Error *err = NULL;
2486        visit_start_struct(m, NULL, "", "bus", 0, &err);
2487        if (!err) {
2488            if (!obj || *obj) {
2489                visit_type_PciBridgeInfo_bus_fields(m, obj, &err);
2490                error_propagate(errp, err);
2491                err = NULL;
2492            }
2493            /* Always call end_struct if start_struct succeeded.  */
2494            visit_end_struct(m, &err);
2495        }
2496        error_propagate(errp, err);
2497    }
2498    visit_start_optional(m, obj ? &(*obj)->has_devices : NULL, "devices", &err);
2499    if (obj && (*obj)->has_devices) {
2500        visit_type_PciDeviceInfoList(m, obj ? &(*obj)->devices : NULL, "devices", &err);
2501    }
2502    visit_end_optional(m, &err);
2503
2504    error_propagate(errp, err);
2505}
2506
2507void visit_type_PciBridgeInfo(Visitor *m, PciBridgeInfo ** obj, const char *name, Error **errp)
2508{
2509    if (!error_is_set(errp)) {
2510        Error *err = NULL;
2511        visit_start_struct(m, (void **)obj, "PciBridgeInfo", name, sizeof(PciBridgeInfo), &err);
2512        if (!err) {
2513            if (!obj || *obj) {
2514                visit_type_PciBridgeInfo_fields(m, obj, &err);
2515                error_propagate(errp, err);
2516                err = NULL;
2517            }
2518            /* Always call end_struct if start_struct succeeded.  */
2519            visit_end_struct(m, &err);
2520        }
2521        error_propagate(errp, err);
2522    }
2523}
2524
2525void visit_type_PciBridgeInfoList(Visitor *m, PciBridgeInfoList ** obj, const char *name, Error **errp)
2526{
2527    GenericList *i, **prev = (GenericList **)obj;
2528    Error *err = NULL;
2529
2530    if (!error_is_set(errp)) {
2531        visit_start_list(m, name, &err);
2532        if (!err) {
2533            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
2534                PciBridgeInfoList *native_i = (PciBridgeInfoList *)i;
2535                visit_type_PciBridgeInfo(m, &native_i->value, NULL, &err);
2536            }
2537            error_propagate(errp, err);
2538            err = NULL;
2539
2540            /* Always call end_list if start_list succeeded.  */
2541            visit_end_list(m, &err);
2542        }
2543        error_propagate(errp, err);
2544    }
2545}
2546
2547static void visit_type_PciDeviceInfo_class_info_fields(Visitor *m, PciDeviceInfo ** obj, Error **errp)
2548{
2549    Error *err = NULL;
2550    visit_start_optional(m, obj ? &(*obj)->class_info.has_desc : NULL, "desc", &err);
2551    if (obj && (*obj)->class_info.has_desc) {
2552        visit_type_str(m, obj ? &(*obj)->class_info.desc : NULL, "desc", &err);
2553    }
2554    visit_end_optional(m, &err);
2555    visit_type_int(m, obj ? &(*obj)->class_info.q_class : NULL, "class", &err);
2556
2557    error_propagate(errp, err);
2558}
2559
2560static void visit_type_PciDeviceInfo_id_fields(Visitor *m, PciDeviceInfo ** obj, Error **errp)
2561{
2562    Error *err = NULL;
2563    visit_type_int(m, obj ? &(*obj)->id.device : NULL, "device", &err);
2564    visit_type_int(m, obj ? &(*obj)->id.vendor : NULL, "vendor", &err);
2565
2566    error_propagate(errp, err);
2567}
2568
2569static void visit_type_PciDeviceInfo_fields(Visitor *m, PciDeviceInfo ** obj, Error **errp)
2570{
2571    Error *err = NULL;
2572    visit_type_int(m, obj ? &(*obj)->bus : NULL, "bus", &err);
2573    visit_type_int(m, obj ? &(*obj)->slot : NULL, "slot", &err);
2574    visit_type_int(m, obj ? &(*obj)->function : NULL, "function", &err);
2575    if (!error_is_set(errp)) {
2576        Error **errp = &err; /* from outer scope */
2577        Error *err = NULL;
2578        visit_start_struct(m, NULL, "", "class_info", 0, &err);
2579        if (!err) {
2580            if (!obj || *obj) {
2581                visit_type_PciDeviceInfo_class_info_fields(m, obj, &err);
2582                error_propagate(errp, err);
2583                err = NULL;
2584            }
2585            /* Always call end_struct if start_struct succeeded.  */
2586            visit_end_struct(m, &err);
2587        }
2588        error_propagate(errp, err);
2589    }
2590    if (!error_is_set(errp)) {
2591        Error **errp = &err; /* from outer scope */
2592        Error *err = NULL;
2593        visit_start_struct(m, NULL, "", "id", 0, &err);
2594        if (!err) {
2595            if (!obj || *obj) {
2596                visit_type_PciDeviceInfo_id_fields(m, obj, &err);
2597                error_propagate(errp, err);
2598                err = NULL;
2599            }
2600            /* Always call end_struct if start_struct succeeded.  */
2601            visit_end_struct(m, &err);
2602        }
2603        error_propagate(errp, err);
2604    }
2605    visit_start_optional(m, obj ? &(*obj)->has_irq : NULL, "irq", &err);
2606    if (obj && (*obj)->has_irq) {
2607        visit_type_int(m, obj ? &(*obj)->irq : NULL, "irq", &err);
2608    }
2609    visit_end_optional(m, &err);
2610    visit_type_str(m, obj ? &(*obj)->qdev_id : NULL, "qdev_id", &err);
2611    visit_start_optional(m, obj ? &(*obj)->has_pci_bridge : NULL, "pci_bridge", &err);
2612    if (obj && (*obj)->has_pci_bridge) {
2613        visit_type_PciBridgeInfo(m, obj ? &(*obj)->pci_bridge : NULL, "pci_bridge", &err);
2614    }
2615    visit_end_optional(m, &err);
2616    visit_type_PciMemoryRegionList(m, obj ? &(*obj)->regions : NULL, "regions", &err);
2617
2618    error_propagate(errp, err);
2619}
2620
2621void visit_type_PciDeviceInfo(Visitor *m, PciDeviceInfo ** obj, const char *name, Error **errp)
2622{
2623    if (!error_is_set(errp)) {
2624        Error *err = NULL;
2625        visit_start_struct(m, (void **)obj, "PciDeviceInfo", name, sizeof(PciDeviceInfo), &err);
2626        if (!err) {
2627            if (!obj || *obj) {
2628                visit_type_PciDeviceInfo_fields(m, obj, &err);
2629                error_propagate(errp, err);
2630                err = NULL;
2631            }
2632            /* Always call end_struct if start_struct succeeded.  */
2633            visit_end_struct(m, &err);
2634        }
2635        error_propagate(errp, err);
2636    }
2637}
2638
2639void visit_type_PciDeviceInfoList(Visitor *m, PciDeviceInfoList ** obj, const char *name, Error **errp)
2640{
2641    GenericList *i, **prev = (GenericList **)obj;
2642    Error *err = NULL;
2643
2644    if (!error_is_set(errp)) {
2645        visit_start_list(m, name, &err);
2646        if (!err) {
2647            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
2648                PciDeviceInfoList *native_i = (PciDeviceInfoList *)i;
2649                visit_type_PciDeviceInfo(m, &native_i->value, NULL, &err);
2650            }
2651            error_propagate(errp, err);
2652            err = NULL;
2653
2654            /* Always call end_list if start_list succeeded.  */
2655            visit_end_list(m, &err);
2656        }
2657        error_propagate(errp, err);
2658    }
2659}
2660
2661static void visit_type_PciInfo_fields(Visitor *m, PciInfo ** obj, Error **errp)
2662{
2663    Error *err = NULL;
2664    visit_type_int(m, obj ? &(*obj)->bus : NULL, "bus", &err);
2665    visit_type_PciDeviceInfoList(m, obj ? &(*obj)->devices : NULL, "devices", &err);
2666
2667    error_propagate(errp, err);
2668}
2669
2670void visit_type_PciInfo(Visitor *m, PciInfo ** obj, const char *name, Error **errp)
2671{
2672    if (!error_is_set(errp)) {
2673        Error *err = NULL;
2674        visit_start_struct(m, (void **)obj, "PciInfo", name, sizeof(PciInfo), &err);
2675        if (!err) {
2676            if (!obj || *obj) {
2677                visit_type_PciInfo_fields(m, obj, &err);
2678                error_propagate(errp, err);
2679                err = NULL;
2680            }
2681            /* Always call end_struct if start_struct succeeded.  */
2682            visit_end_struct(m, &err);
2683        }
2684        error_propagate(errp, err);
2685    }
2686}
2687
2688void visit_type_PciInfoList(Visitor *m, PciInfoList ** obj, const char *name, Error **errp)
2689{
2690    GenericList *i, **prev = (GenericList **)obj;
2691    Error *err = NULL;
2692
2693    if (!error_is_set(errp)) {
2694        visit_start_list(m, name, &err);
2695        if (!err) {
2696            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
2697                PciInfoList *native_i = (PciInfoList *)i;
2698                visit_type_PciInfo(m, &native_i->value, NULL, &err);
2699            }
2700            error_propagate(errp, err);
2701            err = NULL;
2702
2703            /* Always call end_list if start_list succeeded.  */
2704            visit_end_list(m, &err);
2705        }
2706        error_propagate(errp, err);
2707    }
2708}
2709
2710void visit_type_BlockdevOnErrorList(Visitor *m, BlockdevOnErrorList ** obj, const char *name, Error **errp)
2711{
2712    GenericList *i, **prev = (GenericList **)obj;
2713    Error *err = NULL;
2714
2715    if (!error_is_set(errp)) {
2716        visit_start_list(m, name, &err);
2717        if (!err) {
2718            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
2719                BlockdevOnErrorList *native_i = (BlockdevOnErrorList *)i;
2720                visit_type_BlockdevOnError(m, &native_i->value, NULL, &err);
2721            }
2722            error_propagate(errp, err);
2723            err = NULL;
2724
2725            /* Always call end_list if start_list succeeded.  */
2726            visit_end_list(m, &err);
2727        }
2728        error_propagate(errp, err);
2729    }
2730}
2731
2732void visit_type_BlockdevOnError(Visitor *m, BlockdevOnError * obj, const char *name, Error **errp)
2733{
2734    visit_type_enum(m, (int *)obj, BlockdevOnError_lookup, "BlockdevOnError", name, errp);
2735}
2736
2737void visit_type_MirrorSyncModeList(Visitor *m, MirrorSyncModeList ** obj, const char *name, Error **errp)
2738{
2739    GenericList *i, **prev = (GenericList **)obj;
2740    Error *err = NULL;
2741
2742    if (!error_is_set(errp)) {
2743        visit_start_list(m, name, &err);
2744        if (!err) {
2745            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
2746                MirrorSyncModeList *native_i = (MirrorSyncModeList *)i;
2747                visit_type_MirrorSyncMode(m, &native_i->value, NULL, &err);
2748            }
2749            error_propagate(errp, err);
2750            err = NULL;
2751
2752            /* Always call end_list if start_list succeeded.  */
2753            visit_end_list(m, &err);
2754        }
2755        error_propagate(errp, err);
2756    }
2757}
2758
2759void visit_type_MirrorSyncMode(Visitor *m, MirrorSyncMode * obj, const char *name, Error **errp)
2760{
2761    visit_type_enum(m, (int *)obj, MirrorSyncMode_lookup, "MirrorSyncMode", name, errp);
2762}
2763
2764void visit_type_BlockJobTypeList(Visitor *m, BlockJobTypeList ** obj, const char *name, Error **errp)
2765{
2766    GenericList *i, **prev = (GenericList **)obj;
2767    Error *err = NULL;
2768
2769    if (!error_is_set(errp)) {
2770        visit_start_list(m, name, &err);
2771        if (!err) {
2772            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
2773                BlockJobTypeList *native_i = (BlockJobTypeList *)i;
2774                visit_type_BlockJobType(m, &native_i->value, NULL, &err);
2775            }
2776            error_propagate(errp, err);
2777            err = NULL;
2778
2779            /* Always call end_list if start_list succeeded.  */
2780            visit_end_list(m, &err);
2781        }
2782        error_propagate(errp, err);
2783    }
2784}
2785
2786void visit_type_BlockJobType(Visitor *m, BlockJobType * obj, const char *name, Error **errp)
2787{
2788    visit_type_enum(m, (int *)obj, BlockJobType_lookup, "BlockJobType", name, errp);
2789}
2790
2791static void visit_type_BlockJobInfo_fields(Visitor *m, BlockJobInfo ** obj, Error **errp)
2792{
2793    Error *err = NULL;
2794    visit_type_str(m, obj ? &(*obj)->type : NULL, "type", &err);
2795    visit_type_str(m, obj ? &(*obj)->device : NULL, "device", &err);
2796    visit_type_int(m, obj ? &(*obj)->len : NULL, "len", &err);
2797    visit_type_int(m, obj ? &(*obj)->offset : NULL, "offset", &err);
2798    visit_type_bool(m, obj ? &(*obj)->busy : NULL, "busy", &err);
2799    visit_type_bool(m, obj ? &(*obj)->paused : NULL, "paused", &err);
2800    visit_type_int(m, obj ? &(*obj)->speed : NULL, "speed", &err);
2801    visit_type_BlockDeviceIoStatus(m, obj ? &(*obj)->io_status : NULL, "io-status", &err);
2802
2803    error_propagate(errp, err);
2804}
2805
2806void visit_type_BlockJobInfo(Visitor *m, BlockJobInfo ** obj, const char *name, Error **errp)
2807{
2808    if (!error_is_set(errp)) {
2809        Error *err = NULL;
2810        visit_start_struct(m, (void **)obj, "BlockJobInfo", name, sizeof(BlockJobInfo), &err);
2811        if (!err) {
2812            if (!obj || *obj) {
2813                visit_type_BlockJobInfo_fields(m, obj, &err);
2814                error_propagate(errp, err);
2815                err = NULL;
2816            }
2817            /* Always call end_struct if start_struct succeeded.  */
2818            visit_end_struct(m, &err);
2819        }
2820        error_propagate(errp, err);
2821    }
2822}
2823
2824void visit_type_BlockJobInfoList(Visitor *m, BlockJobInfoList ** obj, const char *name, Error **errp)
2825{
2826    GenericList *i, **prev = (GenericList **)obj;
2827    Error *err = NULL;
2828
2829    if (!error_is_set(errp)) {
2830        visit_start_list(m, name, &err);
2831        if (!err) {
2832            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
2833                BlockJobInfoList *native_i = (BlockJobInfoList *)i;
2834                visit_type_BlockJobInfo(m, &native_i->value, NULL, &err);
2835            }
2836            error_propagate(errp, err);
2837            err = NULL;
2838
2839            /* Always call end_list if start_list succeeded.  */
2840            visit_end_list(m, &err);
2841        }
2842        error_propagate(errp, err);
2843    }
2844}
2845
2846void visit_type_NewImageModeList(Visitor *m, NewImageModeList ** obj, const char *name, Error **errp)
2847{
2848    GenericList *i, **prev = (GenericList **)obj;
2849    Error *err = NULL;
2850
2851    if (!error_is_set(errp)) {
2852        visit_start_list(m, name, &err);
2853        if (!err) {
2854            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
2855                NewImageModeList *native_i = (NewImageModeList *)i;
2856                visit_type_NewImageMode(m, &native_i->value, NULL, &err);
2857            }
2858            error_propagate(errp, err);
2859            err = NULL;
2860
2861            /* Always call end_list if start_list succeeded.  */
2862            visit_end_list(m, &err);
2863        }
2864        error_propagate(errp, err);
2865    }
2866}
2867
2868void visit_type_NewImageMode(Visitor *m, NewImageMode * obj, const char *name, Error **errp)
2869{
2870    visit_type_enum(m, (int *)obj, NewImageMode_lookup, "NewImageMode", name, errp);
2871}
2872
2873static void visit_type_BlockdevSnapshot_fields(Visitor *m, BlockdevSnapshot ** obj, Error **errp)
2874{
2875    Error *err = NULL;
2876    visit_type_str(m, obj ? &(*obj)->device : NULL, "device", &err);
2877    visit_type_str(m, obj ? &(*obj)->snapshot_file : NULL, "snapshot-file", &err);
2878    visit_start_optional(m, obj ? &(*obj)->has_format : NULL, "format", &err);
2879    if (obj && (*obj)->has_format) {
2880        visit_type_str(m, obj ? &(*obj)->format : NULL, "format", &err);
2881    }
2882    visit_end_optional(m, &err);
2883    visit_start_optional(m, obj ? &(*obj)->has_mode : NULL, "mode", &err);
2884    if (obj && (*obj)->has_mode) {
2885        visit_type_NewImageMode(m, obj ? &(*obj)->mode : NULL, "mode", &err);
2886    }
2887    visit_end_optional(m, &err);
2888
2889    error_propagate(errp, err);
2890}
2891
2892void visit_type_BlockdevSnapshot(Visitor *m, BlockdevSnapshot ** obj, const char *name, Error **errp)
2893{
2894    if (!error_is_set(errp)) {
2895        Error *err = NULL;
2896        visit_start_struct(m, (void **)obj, "BlockdevSnapshot", name, sizeof(BlockdevSnapshot), &err);
2897        if (!err) {
2898            if (!obj || *obj) {
2899                visit_type_BlockdevSnapshot_fields(m, obj, &err);
2900                error_propagate(errp, err);
2901                err = NULL;
2902            }
2903            /* Always call end_struct if start_struct succeeded.  */
2904            visit_end_struct(m, &err);
2905        }
2906        error_propagate(errp, err);
2907    }
2908}
2909
2910void visit_type_BlockdevSnapshotList(Visitor *m, BlockdevSnapshotList ** obj, const char *name, Error **errp)
2911{
2912    GenericList *i, **prev = (GenericList **)obj;
2913    Error *err = NULL;
2914
2915    if (!error_is_set(errp)) {
2916        visit_start_list(m, name, &err);
2917        if (!err) {
2918            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
2919                BlockdevSnapshotList *native_i = (BlockdevSnapshotList *)i;
2920                visit_type_BlockdevSnapshot(m, &native_i->value, NULL, &err);
2921            }
2922            error_propagate(errp, err);
2923            err = NULL;
2924
2925            /* Always call end_list if start_list succeeded.  */
2926            visit_end_list(m, &err);
2927        }
2928        error_propagate(errp, err);
2929    }
2930}
2931
2932static void visit_type_BlockdevSnapshotInternal_fields(Visitor *m, BlockdevSnapshotInternal ** obj, Error **errp)
2933{
2934    Error *err = NULL;
2935    visit_type_str(m, obj ? &(*obj)->device : NULL, "device", &err);
2936    visit_type_str(m, obj ? &(*obj)->name : NULL, "name", &err);
2937
2938    error_propagate(errp, err);
2939}
2940
2941void visit_type_BlockdevSnapshotInternal(Visitor *m, BlockdevSnapshotInternal ** obj, const char *name, Error **errp)
2942{
2943    if (!error_is_set(errp)) {
2944        Error *err = NULL;
2945        visit_start_struct(m, (void **)obj, "BlockdevSnapshotInternal", name, sizeof(BlockdevSnapshotInternal), &err);
2946        if (!err) {
2947            if (!obj || *obj) {
2948                visit_type_BlockdevSnapshotInternal_fields(m, obj, &err);
2949                error_propagate(errp, err);
2950                err = NULL;
2951            }
2952            /* Always call end_struct if start_struct succeeded.  */
2953            visit_end_struct(m, &err);
2954        }
2955        error_propagate(errp, err);
2956    }
2957}
2958
2959void visit_type_BlockdevSnapshotInternalList(Visitor *m, BlockdevSnapshotInternalList ** obj, const char *name, Error **errp)
2960{
2961    GenericList *i, **prev = (GenericList **)obj;
2962    Error *err = NULL;
2963
2964    if (!error_is_set(errp)) {
2965        visit_start_list(m, name, &err);
2966        if (!err) {
2967            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
2968                BlockdevSnapshotInternalList *native_i = (BlockdevSnapshotInternalList *)i;
2969                visit_type_BlockdevSnapshotInternal(m, &native_i->value, NULL, &err);
2970            }
2971            error_propagate(errp, err);
2972            err = NULL;
2973
2974            /* Always call end_list if start_list succeeded.  */
2975            visit_end_list(m, &err);
2976        }
2977        error_propagate(errp, err);
2978    }
2979}
2980
2981static void visit_type_DriveBackup_fields(Visitor *m, DriveBackup ** obj, Error **errp)
2982{
2983    Error *err = NULL;
2984    visit_type_str(m, obj ? &(*obj)->device : NULL, "device", &err);
2985    visit_type_str(m, obj ? &(*obj)->target : NULL, "target", &err);
2986    visit_start_optional(m, obj ? &(*obj)->has_format : NULL, "format", &err);
2987    if (obj && (*obj)->has_format) {
2988        visit_type_str(m, obj ? &(*obj)->format : NULL, "format", &err);
2989    }
2990    visit_end_optional(m, &err);
2991    visit_type_MirrorSyncMode(m, obj ? &(*obj)->sync : NULL, "sync", &err);
2992    visit_start_optional(m, obj ? &(*obj)->has_mode : NULL, "mode", &err);
2993    if (obj && (*obj)->has_mode) {
2994        visit_type_NewImageMode(m, obj ? &(*obj)->mode : NULL, "mode", &err);
2995    }
2996    visit_end_optional(m, &err);
2997    visit_start_optional(m, obj ? &(*obj)->has_speed : NULL, "speed", &err);
2998    if (obj && (*obj)->has_speed) {
2999        visit_type_int(m, obj ? &(*obj)->speed : NULL, "speed", &err);
3000    }
3001    visit_end_optional(m, &err);
3002    visit_start_optional(m, obj ? &(*obj)->has_on_source_error : NULL, "on-source-error", &err);
3003    if (obj && (*obj)->has_on_source_error) {
3004        visit_type_BlockdevOnError(m, obj ? &(*obj)->on_source_error : NULL, "on-source-error", &err);
3005    }
3006    visit_end_optional(m, &err);
3007    visit_start_optional(m, obj ? &(*obj)->has_on_target_error : NULL, "on-target-error", &err);
3008    if (obj && (*obj)->has_on_target_error) {
3009        visit_type_BlockdevOnError(m, obj ? &(*obj)->on_target_error : NULL, "on-target-error", &err);
3010    }
3011    visit_end_optional(m, &err);
3012
3013    error_propagate(errp, err);
3014}
3015
3016void visit_type_DriveBackup(Visitor *m, DriveBackup ** obj, const char *name, Error **errp)
3017{
3018    if (!error_is_set(errp)) {
3019        Error *err = NULL;
3020        visit_start_struct(m, (void **)obj, "DriveBackup", name, sizeof(DriveBackup), &err);
3021        if (!err) {
3022            if (!obj || *obj) {
3023                visit_type_DriveBackup_fields(m, obj, &err);
3024                error_propagate(errp, err);
3025                err = NULL;
3026            }
3027            /* Always call end_struct if start_struct succeeded.  */
3028            visit_end_struct(m, &err);
3029        }
3030        error_propagate(errp, err);
3031    }
3032}
3033
3034void visit_type_DriveBackupList(Visitor *m, DriveBackupList ** obj, const char *name, Error **errp)
3035{
3036    GenericList *i, **prev = (GenericList **)obj;
3037    Error *err = NULL;
3038
3039    if (!error_is_set(errp)) {
3040        visit_start_list(m, name, &err);
3041        if (!err) {
3042            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
3043                DriveBackupList *native_i = (DriveBackupList *)i;
3044                visit_type_DriveBackup(m, &native_i->value, NULL, &err);
3045            }
3046            error_propagate(errp, err);
3047            err = NULL;
3048
3049            /* Always call end_list if start_list succeeded.  */
3050            visit_end_list(m, &err);
3051        }
3052        error_propagate(errp, err);
3053    }
3054}
3055
3056static void visit_type_Abort_fields(Visitor *m, Abort ** obj, Error **errp)
3057{
3058    Error *err = NULL;
3059
3060    error_propagate(errp, err);
3061}
3062
3063void visit_type_Abort(Visitor *m, Abort ** obj, const char *name, Error **errp)
3064{
3065    if (!error_is_set(errp)) {
3066        Error *err = NULL;
3067        visit_start_struct(m, (void **)obj, "Abort", name, sizeof(Abort), &err);
3068        if (!err) {
3069            if (!obj || *obj) {
3070                visit_type_Abort_fields(m, obj, &err);
3071                error_propagate(errp, err);
3072                err = NULL;
3073            }
3074            /* Always call end_struct if start_struct succeeded.  */
3075            visit_end_struct(m, &err);
3076        }
3077        error_propagate(errp, err);
3078    }
3079}
3080
3081void visit_type_AbortList(Visitor *m, AbortList ** obj, const char *name, Error **errp)
3082{
3083    GenericList *i, **prev = (GenericList **)obj;
3084    Error *err = NULL;
3085
3086    if (!error_is_set(errp)) {
3087        visit_start_list(m, name, &err);
3088        if (!err) {
3089            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
3090                AbortList *native_i = (AbortList *)i;
3091                visit_type_Abort(m, &native_i->value, NULL, &err);
3092            }
3093            error_propagate(errp, err);
3094            err = NULL;
3095
3096            /* Always call end_list if start_list succeeded.  */
3097            visit_end_list(m, &err);
3098        }
3099        error_propagate(errp, err);
3100    }
3101}
3102
3103void visit_type_TransactionActionKind(Visitor *m, TransactionActionKind * obj, const char *name, Error **errp)
3104{
3105    visit_type_enum(m, (int *)obj, TransactionActionKind_lookup, "TransactionActionKind", name, errp);
3106}
3107
3108void visit_type_TransactionAction(Visitor *m, TransactionAction ** obj, const char *name, Error **errp)
3109{
3110    Error *err = NULL;
3111
3112    if (!error_is_set(errp)) {
3113        visit_start_struct(m, (void **)obj, "TransactionAction", name, sizeof(TransactionAction), &err);
3114        if (!err) {
3115            if (obj && *obj) {
3116                visit_type_TransactionActionKind(m, &(*obj)->kind, "type", &err);
3117                if (!err) {
3118                    switch ((*obj)->kind) {
3119                    case TRANSACTION_ACTION_KIND_BLOCKDEV_SNAPSHOT_SYNC:
3120                        visit_type_BlockdevSnapshot(m, &(*obj)->blockdev_snapshot_sync, "data", &err);
3121                        break;
3122                    case TRANSACTION_ACTION_KIND_DRIVE_BACKUP:
3123                        visit_type_DriveBackup(m, &(*obj)->drive_backup, "data", &err);
3124                        break;
3125                    case TRANSACTION_ACTION_KIND_ABORT:
3126                        visit_type_Abort(m, &(*obj)->abort, "data", &err);
3127                        break;
3128                    case TRANSACTION_ACTION_KIND_BLOCKDEV_SNAPSHOT_INTERNAL_SYNC:
3129                        visit_type_BlockdevSnapshotInternal(m, &(*obj)->blockdev_snapshot_internal_sync, "data", &err);
3130                        break;
3131                    default:
3132                        abort();
3133                    }
3134                }
3135                error_propagate(errp, err);
3136                err = NULL;
3137            }
3138            /* Always call end_struct if start_struct succeeded.  */
3139            visit_end_struct(m, &err);
3140        }
3141        error_propagate(errp, err);
3142    }
3143}
3144
3145void visit_type_TransactionActionList(Visitor *m, TransactionActionList ** obj, const char *name, Error **errp)
3146{
3147    GenericList *i, **prev = (GenericList **)obj;
3148    Error *err = NULL;
3149
3150    if (!error_is_set(errp)) {
3151        visit_start_list(m, name, &err);
3152        if (!err) {
3153            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
3154                TransactionActionList *native_i = (TransactionActionList *)i;
3155                visit_type_TransactionAction(m, &native_i->value, NULL, &err);
3156            }
3157            error_propagate(errp, err);
3158            err = NULL;
3159
3160            /* Always call end_list if start_list succeeded.  */
3161            visit_end_list(m, &err);
3162        }
3163        error_propagate(errp, err);
3164    }
3165}
3166
3167static void visit_type_ObjectPropertyInfo_fields(Visitor *m, ObjectPropertyInfo ** obj, Error **errp)
3168{
3169    Error *err = NULL;
3170    visit_type_str(m, obj ? &(*obj)->name : NULL, "name", &err);
3171    visit_type_str(m, obj ? &(*obj)->type : NULL, "type", &err);
3172
3173    error_propagate(errp, err);
3174}
3175
3176void visit_type_ObjectPropertyInfo(Visitor *m, ObjectPropertyInfo ** obj, const char *name, Error **errp)
3177{
3178    if (!error_is_set(errp)) {
3179        Error *err = NULL;
3180        visit_start_struct(m, (void **)obj, "ObjectPropertyInfo", name, sizeof(ObjectPropertyInfo), &err);
3181        if (!err) {
3182            if (!obj || *obj) {
3183                visit_type_ObjectPropertyInfo_fields(m, obj, &err);
3184                error_propagate(errp, err);
3185                err = NULL;
3186            }
3187            /* Always call end_struct if start_struct succeeded.  */
3188            visit_end_struct(m, &err);
3189        }
3190        error_propagate(errp, err);
3191    }
3192}
3193
3194void visit_type_ObjectPropertyInfoList(Visitor *m, ObjectPropertyInfoList ** obj, const char *name, Error **errp)
3195{
3196    GenericList *i, **prev = (GenericList **)obj;
3197    Error *err = NULL;
3198
3199    if (!error_is_set(errp)) {
3200        visit_start_list(m, name, &err);
3201        if (!err) {
3202            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
3203                ObjectPropertyInfoList *native_i = (ObjectPropertyInfoList *)i;
3204                visit_type_ObjectPropertyInfo(m, &native_i->value, NULL, &err);
3205            }
3206            error_propagate(errp, err);
3207            err = NULL;
3208
3209            /* Always call end_list if start_list succeeded.  */
3210            visit_end_list(m, &err);
3211        }
3212        error_propagate(errp, err);
3213    }
3214}
3215
3216static void visit_type_ObjectTypeInfo_fields(Visitor *m, ObjectTypeInfo ** obj, Error **errp)
3217{
3218    Error *err = NULL;
3219    visit_type_str(m, obj ? &(*obj)->name : NULL, "name", &err);
3220
3221    error_propagate(errp, err);
3222}
3223
3224void visit_type_ObjectTypeInfo(Visitor *m, ObjectTypeInfo ** obj, const char *name, Error **errp)
3225{
3226    if (!error_is_set(errp)) {
3227        Error *err = NULL;
3228        visit_start_struct(m, (void **)obj, "ObjectTypeInfo", name, sizeof(ObjectTypeInfo), &err);
3229        if (!err) {
3230            if (!obj || *obj) {
3231                visit_type_ObjectTypeInfo_fields(m, obj, &err);
3232                error_propagate(errp, err);
3233                err = NULL;
3234            }
3235            /* Always call end_struct if start_struct succeeded.  */
3236            visit_end_struct(m, &err);
3237        }
3238        error_propagate(errp, err);
3239    }
3240}
3241
3242void visit_type_ObjectTypeInfoList(Visitor *m, ObjectTypeInfoList ** obj, const char *name, Error **errp)
3243{
3244    GenericList *i, **prev = (GenericList **)obj;
3245    Error *err = NULL;
3246
3247    if (!error_is_set(errp)) {
3248        visit_start_list(m, name, &err);
3249        if (!err) {
3250            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
3251                ObjectTypeInfoList *native_i = (ObjectTypeInfoList *)i;
3252                visit_type_ObjectTypeInfo(m, &native_i->value, NULL, &err);
3253            }
3254            error_propagate(errp, err);
3255            err = NULL;
3256
3257            /* Always call end_list if start_list succeeded.  */
3258            visit_end_list(m, &err);
3259        }
3260        error_propagate(errp, err);
3261    }
3262}
3263
3264static void visit_type_DevicePropertyInfo_fields(Visitor *m, DevicePropertyInfo ** obj, Error **errp)
3265{
3266    Error *err = NULL;
3267    visit_type_str(m, obj ? &(*obj)->name : NULL, "name", &err);
3268    visit_type_str(m, obj ? &(*obj)->type : NULL, "type", &err);
3269
3270    error_propagate(errp, err);
3271}
3272
3273void visit_type_DevicePropertyInfo(Visitor *m, DevicePropertyInfo ** obj, const char *name, Error **errp)
3274{
3275    if (!error_is_set(errp)) {
3276        Error *err = NULL;
3277        visit_start_struct(m, (void **)obj, "DevicePropertyInfo", name, sizeof(DevicePropertyInfo), &err);
3278        if (!err) {
3279            if (!obj || *obj) {
3280                visit_type_DevicePropertyInfo_fields(m, obj, &err);
3281                error_propagate(errp, err);
3282                err = NULL;
3283            }
3284            /* Always call end_struct if start_struct succeeded.  */
3285            visit_end_struct(m, &err);
3286        }
3287        error_propagate(errp, err);
3288    }
3289}
3290
3291void visit_type_DevicePropertyInfoList(Visitor *m, DevicePropertyInfoList ** obj, const char *name, Error **errp)
3292{
3293    GenericList *i, **prev = (GenericList **)obj;
3294    Error *err = NULL;
3295
3296    if (!error_is_set(errp)) {
3297        visit_start_list(m, name, &err);
3298        if (!err) {
3299            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
3300                DevicePropertyInfoList *native_i = (DevicePropertyInfoList *)i;
3301                visit_type_DevicePropertyInfo(m, &native_i->value, NULL, &err);
3302            }
3303            error_propagate(errp, err);
3304            err = NULL;
3305
3306            /* Always call end_list if start_list succeeded.  */
3307            visit_end_list(m, &err);
3308        }
3309        error_propagate(errp, err);
3310    }
3311}
3312
3313static void visit_type_NetdevNoneOptions_fields(Visitor *m, NetdevNoneOptions ** obj, Error **errp)
3314{
3315    Error *err = NULL;
3316
3317    error_propagate(errp, err);
3318}
3319
3320void visit_type_NetdevNoneOptions(Visitor *m, NetdevNoneOptions ** obj, const char *name, Error **errp)
3321{
3322    if (!error_is_set(errp)) {
3323        Error *err = NULL;
3324        visit_start_struct(m, (void **)obj, "NetdevNoneOptions", name, sizeof(NetdevNoneOptions), &err);
3325        if (!err) {
3326            if (!obj || *obj) {
3327                visit_type_NetdevNoneOptions_fields(m, obj, &err);
3328                error_propagate(errp, err);
3329                err = NULL;
3330            }
3331            /* Always call end_struct if start_struct succeeded.  */
3332            visit_end_struct(m, &err);
3333        }
3334        error_propagate(errp, err);
3335    }
3336}
3337
3338void visit_type_NetdevNoneOptionsList(Visitor *m, NetdevNoneOptionsList ** obj, const char *name, Error **errp)
3339{
3340    GenericList *i, **prev = (GenericList **)obj;
3341    Error *err = NULL;
3342
3343    if (!error_is_set(errp)) {
3344        visit_start_list(m, name, &err);
3345        if (!err) {
3346            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
3347                NetdevNoneOptionsList *native_i = (NetdevNoneOptionsList *)i;
3348                visit_type_NetdevNoneOptions(m, &native_i->value, NULL, &err);
3349            }
3350            error_propagate(errp, err);
3351            err = NULL;
3352
3353            /* Always call end_list if start_list succeeded.  */
3354            visit_end_list(m, &err);
3355        }
3356        error_propagate(errp, err);
3357    }
3358}
3359
3360static void visit_type_NetLegacyNicOptions_fields(Visitor *m, NetLegacyNicOptions ** obj, Error **errp)
3361{
3362    Error *err = NULL;
3363    visit_start_optional(m, obj ? &(*obj)->has_netdev : NULL, "netdev", &err);
3364    if (obj && (*obj)->has_netdev) {
3365        visit_type_str(m, obj ? &(*obj)->netdev : NULL, "netdev", &err);
3366    }
3367    visit_end_optional(m, &err);
3368    visit_start_optional(m, obj ? &(*obj)->has_macaddr : NULL, "macaddr", &err);
3369    if (obj && (*obj)->has_macaddr) {
3370        visit_type_str(m, obj ? &(*obj)->macaddr : NULL, "macaddr", &err);
3371    }
3372    visit_end_optional(m, &err);
3373    visit_start_optional(m, obj ? &(*obj)->has_model : NULL, "model", &err);
3374    if (obj && (*obj)->has_model) {
3375        visit_type_str(m, obj ? &(*obj)->model : NULL, "model", &err);
3376    }
3377    visit_end_optional(m, &err);
3378    visit_start_optional(m, obj ? &(*obj)->has_addr : NULL, "addr", &err);
3379    if (obj && (*obj)->has_addr) {
3380        visit_type_str(m, obj ? &(*obj)->addr : NULL, "addr", &err);
3381    }
3382    visit_end_optional(m, &err);
3383    visit_start_optional(m, obj ? &(*obj)->has_vectors : NULL, "vectors", &err);
3384    if (obj && (*obj)->has_vectors) {
3385        visit_type_uint32(m, obj ? &(*obj)->vectors : NULL, "vectors", &err);
3386    }
3387    visit_end_optional(m, &err);
3388
3389    error_propagate(errp, err);
3390}
3391
3392void visit_type_NetLegacyNicOptions(Visitor *m, NetLegacyNicOptions ** obj, const char *name, Error **errp)
3393{
3394    if (!error_is_set(errp)) {
3395        Error *err = NULL;
3396        visit_start_struct(m, (void **)obj, "NetLegacyNicOptions", name, sizeof(NetLegacyNicOptions), &err);
3397        if (!err) {
3398            if (!obj || *obj) {
3399                visit_type_NetLegacyNicOptions_fields(m, obj, &err);
3400                error_propagate(errp, err);
3401                err = NULL;
3402            }
3403            /* Always call end_struct if start_struct succeeded.  */
3404            visit_end_struct(m, &err);
3405        }
3406        error_propagate(errp, err);
3407    }
3408}
3409
3410void visit_type_NetLegacyNicOptionsList(Visitor *m, NetLegacyNicOptionsList ** obj, const char *name, Error **errp)
3411{
3412    GenericList *i, **prev = (GenericList **)obj;
3413    Error *err = NULL;
3414
3415    if (!error_is_set(errp)) {
3416        visit_start_list(m, name, &err);
3417        if (!err) {
3418            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
3419                NetLegacyNicOptionsList *native_i = (NetLegacyNicOptionsList *)i;
3420                visit_type_NetLegacyNicOptions(m, &native_i->value, NULL, &err);
3421            }
3422            error_propagate(errp, err);
3423            err = NULL;
3424
3425            /* Always call end_list if start_list succeeded.  */
3426            visit_end_list(m, &err);
3427        }
3428        error_propagate(errp, err);
3429    }
3430}
3431
3432static void visit_type_String_fields(Visitor *m, String ** obj, Error **errp)
3433{
3434    Error *err = NULL;
3435    visit_type_str(m, obj ? &(*obj)->str : NULL, "str", &err);
3436
3437    error_propagate(errp, err);
3438}
3439
3440void visit_type_String(Visitor *m, String ** obj, const char *name, Error **errp)
3441{
3442    if (!error_is_set(errp)) {
3443        Error *err = NULL;
3444        visit_start_struct(m, (void **)obj, "String", name, sizeof(String), &err);
3445        if (!err) {
3446            if (!obj || *obj) {
3447                visit_type_String_fields(m, obj, &err);
3448                error_propagate(errp, err);
3449                err = NULL;
3450            }
3451            /* Always call end_struct if start_struct succeeded.  */
3452            visit_end_struct(m, &err);
3453        }
3454        error_propagate(errp, err);
3455    }
3456}
3457
3458void visit_type_StringList(Visitor *m, StringList ** obj, const char *name, Error **errp)
3459{
3460    GenericList *i, **prev = (GenericList **)obj;
3461    Error *err = NULL;
3462
3463    if (!error_is_set(errp)) {
3464        visit_start_list(m, name, &err);
3465        if (!err) {
3466            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
3467                StringList *native_i = (StringList *)i;
3468                visit_type_String(m, &native_i->value, NULL, &err);
3469            }
3470            error_propagate(errp, err);
3471            err = NULL;
3472
3473            /* Always call end_list if start_list succeeded.  */
3474            visit_end_list(m, &err);
3475        }
3476        error_propagate(errp, err);
3477    }
3478}
3479
3480static void visit_type_NetdevUserOptions_fields(Visitor *m, NetdevUserOptions ** obj, Error **errp)
3481{
3482    Error *err = NULL;
3483    visit_start_optional(m, obj ? &(*obj)->has_hostname : NULL, "hostname", &err);
3484    if (obj && (*obj)->has_hostname) {
3485        visit_type_str(m, obj ? &(*obj)->hostname : NULL, "hostname", &err);
3486    }
3487    visit_end_optional(m, &err);
3488    visit_start_optional(m, obj ? &(*obj)->has_q_restrict : NULL, "restrict", &err);
3489    if (obj && (*obj)->has_q_restrict) {
3490        visit_type_bool(m, obj ? &(*obj)->q_restrict : NULL, "restrict", &err);
3491    }
3492    visit_end_optional(m, &err);
3493    visit_start_optional(m, obj ? &(*obj)->has_ip : NULL, "ip", &err);
3494    if (obj && (*obj)->has_ip) {
3495        visit_type_str(m, obj ? &(*obj)->ip : NULL, "ip", &err);
3496    }
3497    visit_end_optional(m, &err);
3498    visit_start_optional(m, obj ? &(*obj)->has_net : NULL, "net", &err);
3499    if (obj && (*obj)->has_net) {
3500        visit_type_str(m, obj ? &(*obj)->net : NULL, "net", &err);
3501    }
3502    visit_end_optional(m, &err);
3503    visit_start_optional(m, obj ? &(*obj)->has_host : NULL, "host", &err);
3504    if (obj && (*obj)->has_host) {
3505        visit_type_str(m, obj ? &(*obj)->host : NULL, "host", &err);
3506    }
3507    visit_end_optional(m, &err);
3508    visit_start_optional(m, obj ? &(*obj)->has_tftp : NULL, "tftp", &err);
3509    if (obj && (*obj)->has_tftp) {
3510        visit_type_str(m, obj ? &(*obj)->tftp : NULL, "tftp", &err);
3511    }
3512    visit_end_optional(m, &err);
3513    visit_start_optional(m, obj ? &(*obj)->has_bootfile : NULL, "bootfile", &err);
3514    if (obj && (*obj)->has_bootfile) {
3515        visit_type_str(m, obj ? &(*obj)->bootfile : NULL, "bootfile", &err);
3516    }
3517    visit_end_optional(m, &err);
3518    visit_start_optional(m, obj ? &(*obj)->has_dhcpstart : NULL, "dhcpstart", &err);
3519    if (obj && (*obj)->has_dhcpstart) {
3520        visit_type_str(m, obj ? &(*obj)->dhcpstart : NULL, "dhcpstart", &err);
3521    }
3522    visit_end_optional(m, &err);
3523    visit_start_optional(m, obj ? &(*obj)->has_dns : NULL, "dns", &err);
3524    if (obj && (*obj)->has_dns) {
3525        visit_type_str(m, obj ? &(*obj)->dns : NULL, "dns", &err);
3526    }
3527    visit_end_optional(m, &err);
3528    visit_start_optional(m, obj ? &(*obj)->has_dnssearch : NULL, "dnssearch", &err);
3529    if (obj && (*obj)->has_dnssearch) {
3530        visit_type_StringList(m, obj ? &(*obj)->dnssearch : NULL, "dnssearch", &err);
3531    }
3532    visit_end_optional(m, &err);
3533    visit_start_optional(m, obj ? &(*obj)->has_smb : NULL, "smb", &err);
3534    if (obj && (*obj)->has_smb) {
3535        visit_type_str(m, obj ? &(*obj)->smb : NULL, "smb", &err);
3536    }
3537    visit_end_optional(m, &err);
3538    visit_start_optional(m, obj ? &(*obj)->has_smbserver : NULL, "smbserver", &err);
3539    if (obj && (*obj)->has_smbserver) {
3540        visit_type_str(m, obj ? &(*obj)->smbserver : NULL, "smbserver", &err);
3541    }
3542    visit_end_optional(m, &err);
3543    visit_start_optional(m, obj ? &(*obj)->has_hostfwd : NULL, "hostfwd", &err);
3544    if (obj && (*obj)->has_hostfwd) {
3545        visit_type_StringList(m, obj ? &(*obj)->hostfwd : NULL, "hostfwd", &err);
3546    }
3547    visit_end_optional(m, &err);
3548    visit_start_optional(m, obj ? &(*obj)->has_guestfwd : NULL, "guestfwd", &err);
3549    if (obj && (*obj)->has_guestfwd) {
3550        visit_type_StringList(m, obj ? &(*obj)->guestfwd : NULL, "guestfwd", &err);
3551    }
3552    visit_end_optional(m, &err);
3553
3554    error_propagate(errp, err);
3555}
3556
3557void visit_type_NetdevUserOptions(Visitor *m, NetdevUserOptions ** obj, const char *name, Error **errp)
3558{
3559    if (!error_is_set(errp)) {
3560        Error *err = NULL;
3561        visit_start_struct(m, (void **)obj, "NetdevUserOptions", name, sizeof(NetdevUserOptions), &err);
3562        if (!err) {
3563            if (!obj || *obj) {
3564                visit_type_NetdevUserOptions_fields(m, obj, &err);
3565                error_propagate(errp, err);
3566                err = NULL;
3567            }
3568            /* Always call end_struct if start_struct succeeded.  */
3569            visit_end_struct(m, &err);
3570        }
3571        error_propagate(errp, err);
3572    }
3573}
3574
3575void visit_type_NetdevUserOptionsList(Visitor *m, NetdevUserOptionsList ** obj, const char *name, Error **errp)
3576{
3577    GenericList *i, **prev = (GenericList **)obj;
3578    Error *err = NULL;
3579
3580    if (!error_is_set(errp)) {
3581        visit_start_list(m, name, &err);
3582        if (!err) {
3583            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
3584                NetdevUserOptionsList *native_i = (NetdevUserOptionsList *)i;
3585                visit_type_NetdevUserOptions(m, &native_i->value, NULL, &err);
3586            }
3587            error_propagate(errp, err);
3588            err = NULL;
3589
3590            /* Always call end_list if start_list succeeded.  */
3591            visit_end_list(m, &err);
3592        }
3593        error_propagate(errp, err);
3594    }
3595}
3596
3597static void visit_type_NetdevTapOptions_fields(Visitor *m, NetdevTapOptions ** obj, Error **errp)
3598{
3599    Error *err = NULL;
3600    visit_start_optional(m, obj ? &(*obj)->has_ifname : NULL, "ifname", &err);
3601    if (obj && (*obj)->has_ifname) {
3602        visit_type_str(m, obj ? &(*obj)->ifname : NULL, "ifname", &err);
3603    }
3604    visit_end_optional(m, &err);
3605    visit_start_optional(m, obj ? &(*obj)->has_fd : NULL, "fd", &err);
3606    if (obj && (*obj)->has_fd) {
3607        visit_type_str(m, obj ? &(*obj)->fd : NULL, "fd", &err);
3608    }
3609    visit_end_optional(m, &err);
3610    visit_start_optional(m, obj ? &(*obj)->has_fds : NULL, "fds", &err);
3611    if (obj && (*obj)->has_fds) {
3612        visit_type_str(m, obj ? &(*obj)->fds : NULL, "fds", &err);
3613    }
3614    visit_end_optional(m, &err);
3615    visit_start_optional(m, obj ? &(*obj)->has_script : NULL, "script", &err);
3616    if (obj && (*obj)->has_script) {
3617        visit_type_str(m, obj ? &(*obj)->script : NULL, "script", &err);
3618    }
3619    visit_end_optional(m, &err);
3620    visit_start_optional(m, obj ? &(*obj)->has_downscript : NULL, "downscript", &err);
3621    if (obj && (*obj)->has_downscript) {
3622        visit_type_str(m, obj ? &(*obj)->downscript : NULL, "downscript", &err);
3623    }
3624    visit_end_optional(m, &err);
3625    visit_start_optional(m, obj ? &(*obj)->has_helper : NULL, "helper", &err);
3626    if (obj && (*obj)->has_helper) {
3627        visit_type_str(m, obj ? &(*obj)->helper : NULL, "helper", &err);
3628    }
3629    visit_end_optional(m, &err);
3630    visit_start_optional(m, obj ? &(*obj)->has_sndbuf : NULL, "sndbuf", &err);
3631    if (obj && (*obj)->has_sndbuf) {
3632        visit_type_size(m, obj ? &(*obj)->sndbuf : NULL, "sndbuf", &err);
3633    }
3634    visit_end_optional(m, &err);
3635    visit_start_optional(m, obj ? &(*obj)->has_vnet_hdr : NULL, "vnet_hdr", &err);
3636    if (obj && (*obj)->has_vnet_hdr) {
3637        visit_type_bool(m, obj ? &(*obj)->vnet_hdr : NULL, "vnet_hdr", &err);
3638    }
3639    visit_end_optional(m, &err);
3640    visit_start_optional(m, obj ? &(*obj)->has_vhost : NULL, "vhost", &err);
3641    if (obj && (*obj)->has_vhost) {
3642        visit_type_bool(m, obj ? &(*obj)->vhost : NULL, "vhost", &err);
3643    }
3644    visit_end_optional(m, &err);
3645    visit_start_optional(m, obj ? &(*obj)->has_vhostfd : NULL, "vhostfd", &err);
3646    if (obj && (*obj)->has_vhostfd) {
3647        visit_type_str(m, obj ? &(*obj)->vhostfd : NULL, "vhostfd", &err);
3648    }
3649    visit_end_optional(m, &err);
3650    visit_start_optional(m, obj ? &(*obj)->has_vhostfds : NULL, "vhostfds", &err);
3651    if (obj && (*obj)->has_vhostfds) {
3652        visit_type_str(m, obj ? &(*obj)->vhostfds : NULL, "vhostfds", &err);
3653    }
3654    visit_end_optional(m, &err);
3655    visit_start_optional(m, obj ? &(*obj)->has_vhostforce : NULL, "vhostforce", &err);
3656    if (obj && (*obj)->has_vhostforce) {
3657        visit_type_bool(m, obj ? &(*obj)->vhostforce : NULL, "vhostforce", &err);
3658    }
3659    visit_end_optional(m, &err);
3660    visit_start_optional(m, obj ? &(*obj)->has_queues : NULL, "queues", &err);
3661    if (obj && (*obj)->has_queues) {
3662        visit_type_uint32(m, obj ? &(*obj)->queues : NULL, "queues", &err);
3663    }
3664    visit_end_optional(m, &err);
3665
3666    error_propagate(errp, err);
3667}
3668
3669void visit_type_NetdevTapOptions(Visitor *m, NetdevTapOptions ** obj, const char *name, Error **errp)
3670{
3671    if (!error_is_set(errp)) {
3672        Error *err = NULL;
3673        visit_start_struct(m, (void **)obj, "NetdevTapOptions", name, sizeof(NetdevTapOptions), &err);
3674        if (!err) {
3675            if (!obj || *obj) {
3676                visit_type_NetdevTapOptions_fields(m, obj, &err);
3677                error_propagate(errp, err);
3678                err = NULL;
3679            }
3680            /* Always call end_struct if start_struct succeeded.  */
3681            visit_end_struct(m, &err);
3682        }
3683        error_propagate(errp, err);
3684    }
3685}
3686
3687void visit_type_NetdevTapOptionsList(Visitor *m, NetdevTapOptionsList ** obj, const char *name, Error **errp)
3688{
3689    GenericList *i, **prev = (GenericList **)obj;
3690    Error *err = NULL;
3691
3692    if (!error_is_set(errp)) {
3693        visit_start_list(m, name, &err);
3694        if (!err) {
3695            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
3696                NetdevTapOptionsList *native_i = (NetdevTapOptionsList *)i;
3697                visit_type_NetdevTapOptions(m, &native_i->value, NULL, &err);
3698            }
3699            error_propagate(errp, err);
3700            err = NULL;
3701
3702            /* Always call end_list if start_list succeeded.  */
3703            visit_end_list(m, &err);
3704        }
3705        error_propagate(errp, err);
3706    }
3707}
3708
3709static void visit_type_NetdevSocketOptions_fields(Visitor *m, NetdevSocketOptions ** obj, Error **errp)
3710{
3711    Error *err = NULL;
3712    visit_start_optional(m, obj ? &(*obj)->has_fd : NULL, "fd", &err);
3713    if (obj && (*obj)->has_fd) {
3714        visit_type_str(m, obj ? &(*obj)->fd : NULL, "fd", &err);
3715    }
3716    visit_end_optional(m, &err);
3717    visit_start_optional(m, obj ? &(*obj)->has_listen : NULL, "listen", &err);
3718    if (obj && (*obj)->has_listen) {
3719        visit_type_str(m, obj ? &(*obj)->listen : NULL, "listen", &err);
3720    }
3721    visit_end_optional(m, &err);
3722    visit_start_optional(m, obj ? &(*obj)->has_connect : NULL, "connect", &err);
3723    if (obj && (*obj)->has_connect) {
3724        visit_type_str(m, obj ? &(*obj)->connect : NULL, "connect", &err);
3725    }
3726    visit_end_optional(m, &err);
3727    visit_start_optional(m, obj ? &(*obj)->has_mcast : NULL, "mcast", &err);
3728    if (obj && (*obj)->has_mcast) {
3729        visit_type_str(m, obj ? &(*obj)->mcast : NULL, "mcast", &err);
3730    }
3731    visit_end_optional(m, &err);
3732    visit_start_optional(m, obj ? &(*obj)->has_localaddr : NULL, "localaddr", &err);
3733    if (obj && (*obj)->has_localaddr) {
3734        visit_type_str(m, obj ? &(*obj)->localaddr : NULL, "localaddr", &err);
3735    }
3736    visit_end_optional(m, &err);
3737    visit_start_optional(m, obj ? &(*obj)->has_udp : NULL, "udp", &err);
3738    if (obj && (*obj)->has_udp) {
3739        visit_type_str(m, obj ? &(*obj)->udp : NULL, "udp", &err);
3740    }
3741    visit_end_optional(m, &err);
3742
3743    error_propagate(errp, err);
3744}
3745
3746void visit_type_NetdevSocketOptions(Visitor *m, NetdevSocketOptions ** obj, const char *name, Error **errp)
3747{
3748    if (!error_is_set(errp)) {
3749        Error *err = NULL;
3750        visit_start_struct(m, (void **)obj, "NetdevSocketOptions", name, sizeof(NetdevSocketOptions), &err);
3751        if (!err) {
3752            if (!obj || *obj) {
3753                visit_type_NetdevSocketOptions_fields(m, obj, &err);
3754                error_propagate(errp, err);
3755                err = NULL;
3756            }
3757            /* Always call end_struct if start_struct succeeded.  */
3758            visit_end_struct(m, &err);
3759        }
3760        error_propagate(errp, err);
3761    }
3762}
3763
3764void visit_type_NetdevSocketOptionsList(Visitor *m, NetdevSocketOptionsList ** obj, const char *name, Error **errp)
3765{
3766    GenericList *i, **prev = (GenericList **)obj;
3767    Error *err = NULL;
3768
3769    if (!error_is_set(errp)) {
3770        visit_start_list(m, name, &err);
3771        if (!err) {
3772            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
3773                NetdevSocketOptionsList *native_i = (NetdevSocketOptionsList *)i;
3774                visit_type_NetdevSocketOptions(m, &native_i->value, NULL, &err);
3775            }
3776            error_propagate(errp, err);
3777            err = NULL;
3778
3779            /* Always call end_list if start_list succeeded.  */
3780            visit_end_list(m, &err);
3781        }
3782        error_propagate(errp, err);
3783    }
3784}
3785
3786static void visit_type_NetdevVdeOptions_fields(Visitor *m, NetdevVdeOptions ** obj, Error **errp)
3787{
3788    Error *err = NULL;
3789    visit_start_optional(m, obj ? &(*obj)->has_sock : NULL, "sock", &err);
3790    if (obj && (*obj)->has_sock) {
3791        visit_type_str(m, obj ? &(*obj)->sock : NULL, "sock", &err);
3792    }
3793    visit_end_optional(m, &err);
3794    visit_start_optional(m, obj ? &(*obj)->has_port : NULL, "port", &err);
3795    if (obj && (*obj)->has_port) {
3796        visit_type_uint16(m, obj ? &(*obj)->port : NULL, "port", &err);
3797    }
3798    visit_end_optional(m, &err);
3799    visit_start_optional(m, obj ? &(*obj)->has_group : NULL, "group", &err);
3800    if (obj && (*obj)->has_group) {
3801        visit_type_str(m, obj ? &(*obj)->group : NULL, "group", &err);
3802    }
3803    visit_end_optional(m, &err);
3804    visit_start_optional(m, obj ? &(*obj)->has_mode : NULL, "mode", &err);
3805    if (obj && (*obj)->has_mode) {
3806        visit_type_uint16(m, obj ? &(*obj)->mode : NULL, "mode", &err);
3807    }
3808    visit_end_optional(m, &err);
3809
3810    error_propagate(errp, err);
3811}
3812
3813void visit_type_NetdevVdeOptions(Visitor *m, NetdevVdeOptions ** obj, const char *name, Error **errp)
3814{
3815    if (!error_is_set(errp)) {
3816        Error *err = NULL;
3817        visit_start_struct(m, (void **)obj, "NetdevVdeOptions", name, sizeof(NetdevVdeOptions), &err);
3818        if (!err) {
3819            if (!obj || *obj) {
3820                visit_type_NetdevVdeOptions_fields(m, obj, &err);
3821                error_propagate(errp, err);
3822                err = NULL;
3823            }
3824            /* Always call end_struct if start_struct succeeded.  */
3825            visit_end_struct(m, &err);
3826        }
3827        error_propagate(errp, err);
3828    }
3829}
3830
3831void visit_type_NetdevVdeOptionsList(Visitor *m, NetdevVdeOptionsList ** obj, const char *name, Error **errp)
3832{
3833    GenericList *i, **prev = (GenericList **)obj;
3834    Error *err = NULL;
3835
3836    if (!error_is_set(errp)) {
3837        visit_start_list(m, name, &err);
3838        if (!err) {
3839            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
3840                NetdevVdeOptionsList *native_i = (NetdevVdeOptionsList *)i;
3841                visit_type_NetdevVdeOptions(m, &native_i->value, NULL, &err);
3842            }
3843            error_propagate(errp, err);
3844            err = NULL;
3845
3846            /* Always call end_list if start_list succeeded.  */
3847            visit_end_list(m, &err);
3848        }
3849        error_propagate(errp, err);
3850    }
3851}
3852
3853static void visit_type_NetdevDumpOptions_fields(Visitor *m, NetdevDumpOptions ** obj, Error **errp)
3854{
3855    Error *err = NULL;
3856    visit_start_optional(m, obj ? &(*obj)->has_len : NULL, "len", &err);
3857    if (obj && (*obj)->has_len) {
3858        visit_type_size(m, obj ? &(*obj)->len : NULL, "len", &err);
3859    }
3860    visit_end_optional(m, &err);
3861    visit_start_optional(m, obj ? &(*obj)->has_file : NULL, "file", &err);
3862    if (obj && (*obj)->has_file) {
3863        visit_type_str(m, obj ? &(*obj)->file : NULL, "file", &err);
3864    }
3865    visit_end_optional(m, &err);
3866
3867    error_propagate(errp, err);
3868}
3869
3870void visit_type_NetdevDumpOptions(Visitor *m, NetdevDumpOptions ** obj, const char *name, Error **errp)
3871{
3872    if (!error_is_set(errp)) {
3873        Error *err = NULL;
3874        visit_start_struct(m, (void **)obj, "NetdevDumpOptions", name, sizeof(NetdevDumpOptions), &err);
3875        if (!err) {
3876            if (!obj || *obj) {
3877                visit_type_NetdevDumpOptions_fields(m, obj, &err);
3878                error_propagate(errp, err);
3879                err = NULL;
3880            }
3881            /* Always call end_struct if start_struct succeeded.  */
3882            visit_end_struct(m, &err);
3883        }
3884        error_propagate(errp, err);
3885    }
3886}
3887
3888void visit_type_NetdevDumpOptionsList(Visitor *m, NetdevDumpOptionsList ** obj, const char *name, Error **errp)
3889{
3890    GenericList *i, **prev = (GenericList **)obj;
3891    Error *err = NULL;
3892
3893    if (!error_is_set(errp)) {
3894        visit_start_list(m, name, &err);
3895        if (!err) {
3896            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
3897                NetdevDumpOptionsList *native_i = (NetdevDumpOptionsList *)i;
3898                visit_type_NetdevDumpOptions(m, &native_i->value, NULL, &err);
3899            }
3900            error_propagate(errp, err);
3901            err = NULL;
3902
3903            /* Always call end_list if start_list succeeded.  */
3904            visit_end_list(m, &err);
3905        }
3906        error_propagate(errp, err);
3907    }
3908}
3909
3910static void visit_type_NetdevBridgeOptions_fields(Visitor *m, NetdevBridgeOptions ** obj, Error **errp)
3911{
3912    Error *err = NULL;
3913    visit_start_optional(m, obj ? &(*obj)->has_br : NULL, "br", &err);
3914    if (obj && (*obj)->has_br) {
3915        visit_type_str(m, obj ? &(*obj)->br : NULL, "br", &err);
3916    }
3917    visit_end_optional(m, &err);
3918    visit_start_optional(m, obj ? &(*obj)->has_helper : NULL, "helper", &err);
3919    if (obj && (*obj)->has_helper) {
3920        visit_type_str(m, obj ? &(*obj)->helper : NULL, "helper", &err);
3921    }
3922    visit_end_optional(m, &err);
3923
3924    error_propagate(errp, err);
3925}
3926
3927void visit_type_NetdevBridgeOptions(Visitor *m, NetdevBridgeOptions ** obj, const char *name, Error **errp)
3928{
3929    if (!error_is_set(errp)) {
3930        Error *err = NULL;
3931        visit_start_struct(m, (void **)obj, "NetdevBridgeOptions", name, sizeof(NetdevBridgeOptions), &err);
3932        if (!err) {
3933            if (!obj || *obj) {
3934                visit_type_NetdevBridgeOptions_fields(m, obj, &err);
3935                error_propagate(errp, err);
3936                err = NULL;
3937            }
3938            /* Always call end_struct if start_struct succeeded.  */
3939            visit_end_struct(m, &err);
3940        }
3941        error_propagate(errp, err);
3942    }
3943}
3944
3945void visit_type_NetdevBridgeOptionsList(Visitor *m, NetdevBridgeOptionsList ** obj, const char *name, Error **errp)
3946{
3947    GenericList *i, **prev = (GenericList **)obj;
3948    Error *err = NULL;
3949
3950    if (!error_is_set(errp)) {
3951        visit_start_list(m, name, &err);
3952        if (!err) {
3953            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
3954                NetdevBridgeOptionsList *native_i = (NetdevBridgeOptionsList *)i;
3955                visit_type_NetdevBridgeOptions(m, &native_i->value, NULL, &err);
3956            }
3957            error_propagate(errp, err);
3958            err = NULL;
3959
3960            /* Always call end_list if start_list succeeded.  */
3961            visit_end_list(m, &err);
3962        }
3963        error_propagate(errp, err);
3964    }
3965}
3966
3967static void visit_type_NetdevHubPortOptions_fields(Visitor *m, NetdevHubPortOptions ** obj, Error **errp)
3968{
3969    Error *err = NULL;
3970    visit_type_int32(m, obj ? &(*obj)->hubid : NULL, "hubid", &err);
3971
3972    error_propagate(errp, err);
3973}
3974
3975void visit_type_NetdevHubPortOptions(Visitor *m, NetdevHubPortOptions ** obj, const char *name, Error **errp)
3976{
3977    if (!error_is_set(errp)) {
3978        Error *err = NULL;
3979        visit_start_struct(m, (void **)obj, "NetdevHubPortOptions", name, sizeof(NetdevHubPortOptions), &err);
3980        if (!err) {
3981            if (!obj || *obj) {
3982                visit_type_NetdevHubPortOptions_fields(m, obj, &err);
3983                error_propagate(errp, err);
3984                err = NULL;
3985            }
3986            /* Always call end_struct if start_struct succeeded.  */
3987            visit_end_struct(m, &err);
3988        }
3989        error_propagate(errp, err);
3990    }
3991}
3992
3993void visit_type_NetdevHubPortOptionsList(Visitor *m, NetdevHubPortOptionsList ** obj, const char *name, Error **errp)
3994{
3995    GenericList *i, **prev = (GenericList **)obj;
3996    Error *err = NULL;
3997
3998    if (!error_is_set(errp)) {
3999        visit_start_list(m, name, &err);
4000        if (!err) {
4001            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
4002                NetdevHubPortOptionsList *native_i = (NetdevHubPortOptionsList *)i;
4003                visit_type_NetdevHubPortOptions(m, &native_i->value, NULL, &err);
4004            }
4005            error_propagate(errp, err);
4006            err = NULL;
4007
4008            /* Always call end_list if start_list succeeded.  */
4009            visit_end_list(m, &err);
4010        }
4011        error_propagate(errp, err);
4012    }
4013}
4014
4015static void visit_type_NetdevNetmapOptions_fields(Visitor *m, NetdevNetmapOptions ** obj, Error **errp)
4016{
4017    Error *err = NULL;
4018    visit_type_str(m, obj ? &(*obj)->ifname : NULL, "ifname", &err);
4019    visit_start_optional(m, obj ? &(*obj)->has_devname : NULL, "devname", &err);
4020    if (obj && (*obj)->has_devname) {
4021        visit_type_str(m, obj ? &(*obj)->devname : NULL, "devname", &err);
4022    }
4023    visit_end_optional(m, &err);
4024
4025    error_propagate(errp, err);
4026}
4027
4028void visit_type_NetdevNetmapOptions(Visitor *m, NetdevNetmapOptions ** obj, const char *name, Error **errp)
4029{
4030    if (!error_is_set(errp)) {
4031        Error *err = NULL;
4032        visit_start_struct(m, (void **)obj, "NetdevNetmapOptions", name, sizeof(NetdevNetmapOptions), &err);
4033        if (!err) {
4034            if (!obj || *obj) {
4035                visit_type_NetdevNetmapOptions_fields(m, obj, &err);
4036                error_propagate(errp, err);
4037                err = NULL;
4038            }
4039            /* Always call end_struct if start_struct succeeded.  */
4040            visit_end_struct(m, &err);
4041        }
4042        error_propagate(errp, err);
4043    }
4044}
4045
4046void visit_type_NetdevNetmapOptionsList(Visitor *m, NetdevNetmapOptionsList ** obj, const char *name, Error **errp)
4047{
4048    GenericList *i, **prev = (GenericList **)obj;
4049    Error *err = NULL;
4050
4051    if (!error_is_set(errp)) {
4052        visit_start_list(m, name, &err);
4053        if (!err) {
4054            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
4055                NetdevNetmapOptionsList *native_i = (NetdevNetmapOptionsList *)i;
4056                visit_type_NetdevNetmapOptions(m, &native_i->value, NULL, &err);
4057            }
4058            error_propagate(errp, err);
4059            err = NULL;
4060
4061            /* Always call end_list if start_list succeeded.  */
4062            visit_end_list(m, &err);
4063        }
4064        error_propagate(errp, err);
4065    }
4066}
4067
4068void visit_type_NetClientOptionsKind(Visitor *m, NetClientOptionsKind * obj, const char *name, Error **errp)
4069{
4070    visit_type_enum(m, (int *)obj, NetClientOptionsKind_lookup, "NetClientOptionsKind", name, errp);
4071}
4072
4073void visit_type_NetClientOptions(Visitor *m, NetClientOptions ** obj, const char *name, Error **errp)
4074{
4075    Error *err = NULL;
4076
4077    if (!error_is_set(errp)) {
4078        visit_start_struct(m, (void **)obj, "NetClientOptions", name, sizeof(NetClientOptions), &err);
4079        if (!err) {
4080            if (obj && *obj) {
4081                visit_type_NetClientOptionsKind(m, &(*obj)->kind, "type", &err);
4082                if (!err) {
4083                    switch ((*obj)->kind) {
4084                    case NET_CLIENT_OPTIONS_KIND_NONE:
4085                        visit_type_NetdevNoneOptions(m, &(*obj)->none, "data", &err);
4086                        break;
4087                    case NET_CLIENT_OPTIONS_KIND_NIC:
4088                        visit_type_NetLegacyNicOptions(m, &(*obj)->nic, "data", &err);
4089                        break;
4090                    case NET_CLIENT_OPTIONS_KIND_USER:
4091                        visit_type_NetdevUserOptions(m, &(*obj)->user, "data", &err);
4092                        break;
4093                    case NET_CLIENT_OPTIONS_KIND_TAP:
4094                        visit_type_NetdevTapOptions(m, &(*obj)->tap, "data", &err);
4095                        break;
4096                    case NET_CLIENT_OPTIONS_KIND_SOCKET:
4097                        visit_type_NetdevSocketOptions(m, &(*obj)->socket, "data", &err);
4098                        break;
4099                    case NET_CLIENT_OPTIONS_KIND_VDE:
4100                        visit_type_NetdevVdeOptions(m, &(*obj)->vde, "data", &err);
4101                        break;
4102                    case NET_CLIENT_OPTIONS_KIND_DUMP:
4103                        visit_type_NetdevDumpOptions(m, &(*obj)->dump, "data", &err);
4104                        break;
4105                    case NET_CLIENT_OPTIONS_KIND_BRIDGE:
4106                        visit_type_NetdevBridgeOptions(m, &(*obj)->bridge, "data", &err);
4107                        break;
4108                    case NET_CLIENT_OPTIONS_KIND_HUBPORT:
4109                        visit_type_NetdevHubPortOptions(m, &(*obj)->hubport, "data", &err);
4110                        break;
4111                    case NET_CLIENT_OPTIONS_KIND_NETMAP:
4112                        visit_type_NetdevNetmapOptions(m, &(*obj)->netmap, "data", &err);
4113                        break;
4114                    default:
4115                        abort();
4116                    }
4117                }
4118                error_propagate(errp, err);
4119                err = NULL;
4120            }
4121            /* Always call end_struct if start_struct succeeded.  */
4122            visit_end_struct(m, &err);
4123        }
4124        error_propagate(errp, err);
4125    }
4126}
4127
4128void visit_type_NetClientOptionsList(Visitor *m, NetClientOptionsList ** obj, const char *name, Error **errp)
4129{
4130    GenericList *i, **prev = (GenericList **)obj;
4131    Error *err = NULL;
4132
4133    if (!error_is_set(errp)) {
4134        visit_start_list(m, name, &err);
4135        if (!err) {
4136            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
4137                NetClientOptionsList *native_i = (NetClientOptionsList *)i;
4138                visit_type_NetClientOptions(m, &native_i->value, NULL, &err);
4139            }
4140            error_propagate(errp, err);
4141            err = NULL;
4142
4143            /* Always call end_list if start_list succeeded.  */
4144            visit_end_list(m, &err);
4145        }
4146        error_propagate(errp, err);
4147    }
4148}
4149
4150static void visit_type_NetLegacy_fields(Visitor *m, NetLegacy ** obj, Error **errp)
4151{
4152    Error *err = NULL;
4153    visit_start_optional(m, obj ? &(*obj)->has_vlan : NULL, "vlan", &err);
4154    if (obj && (*obj)->has_vlan) {
4155        visit_type_int32(m, obj ? &(*obj)->vlan : NULL, "vlan", &err);
4156    }
4157    visit_end_optional(m, &err);
4158    visit_start_optional(m, obj ? &(*obj)->has_id : NULL, "id", &err);
4159    if (obj && (*obj)->has_id) {
4160        visit_type_str(m, obj ? &(*obj)->id : NULL, "id", &err);
4161    }
4162    visit_end_optional(m, &err);
4163    visit_start_optional(m, obj ? &(*obj)->has_name : NULL, "name", &err);
4164    if (obj && (*obj)->has_name) {
4165        visit_type_str(m, obj ? &(*obj)->name : NULL, "name", &err);
4166    }
4167    visit_end_optional(m, &err);
4168    visit_type_NetClientOptions(m, obj ? &(*obj)->opts : NULL, "opts", &err);
4169
4170    error_propagate(errp, err);
4171}
4172
4173void visit_type_NetLegacy(Visitor *m, NetLegacy ** obj, const char *name, Error **errp)
4174{
4175    if (!error_is_set(errp)) {
4176        Error *err = NULL;
4177        visit_start_struct(m, (void **)obj, "NetLegacy", name, sizeof(NetLegacy), &err);
4178        if (!err) {
4179            if (!obj || *obj) {
4180                visit_type_NetLegacy_fields(m, obj, &err);
4181                error_propagate(errp, err);
4182                err = NULL;
4183            }
4184            /* Always call end_struct if start_struct succeeded.  */
4185            visit_end_struct(m, &err);
4186        }
4187        error_propagate(errp, err);
4188    }
4189}
4190
4191void visit_type_NetLegacyList(Visitor *m, NetLegacyList ** obj, const char *name, Error **errp)
4192{
4193    GenericList *i, **prev = (GenericList **)obj;
4194    Error *err = NULL;
4195
4196    if (!error_is_set(errp)) {
4197        visit_start_list(m, name, &err);
4198        if (!err) {
4199            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
4200                NetLegacyList *native_i = (NetLegacyList *)i;
4201                visit_type_NetLegacy(m, &native_i->value, NULL, &err);
4202            }
4203            error_propagate(errp, err);
4204            err = NULL;
4205
4206            /* Always call end_list if start_list succeeded.  */
4207            visit_end_list(m, &err);
4208        }
4209        error_propagate(errp, err);
4210    }
4211}
4212
4213static void visit_type_Netdev_fields(Visitor *m, Netdev ** obj, Error **errp)
4214{
4215    Error *err = NULL;
4216    visit_type_str(m, obj ? &(*obj)->id : NULL, "id", &err);
4217    visit_type_NetClientOptions(m, obj ? &(*obj)->opts : NULL, "opts", &err);
4218
4219    error_propagate(errp, err);
4220}
4221
4222void visit_type_Netdev(Visitor *m, Netdev ** obj, const char *name, Error **errp)
4223{
4224    if (!error_is_set(errp)) {
4225        Error *err = NULL;
4226        visit_start_struct(m, (void **)obj, "Netdev", name, sizeof(Netdev), &err);
4227        if (!err) {
4228            if (!obj || *obj) {
4229                visit_type_Netdev_fields(m, obj, &err);
4230                error_propagate(errp, err);
4231                err = NULL;
4232            }
4233            /* Always call end_struct if start_struct succeeded.  */
4234            visit_end_struct(m, &err);
4235        }
4236        error_propagate(errp, err);
4237    }
4238}
4239
4240void visit_type_NetdevList(Visitor *m, NetdevList ** obj, const char *name, Error **errp)
4241{
4242    GenericList *i, **prev = (GenericList **)obj;
4243    Error *err = NULL;
4244
4245    if (!error_is_set(errp)) {
4246        visit_start_list(m, name, &err);
4247        if (!err) {
4248            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
4249                NetdevList *native_i = (NetdevList *)i;
4250                visit_type_Netdev(m, &native_i->value, NULL, &err);
4251            }
4252            error_propagate(errp, err);
4253            err = NULL;
4254
4255            /* Always call end_list if start_list succeeded.  */
4256            visit_end_list(m, &err);
4257        }
4258        error_propagate(errp, err);
4259    }
4260}
4261
4262static void visit_type_InetSocketAddress_fields(Visitor *m, InetSocketAddress ** obj, Error **errp)
4263{
4264    Error *err = NULL;
4265    visit_type_str(m, obj ? &(*obj)->host : NULL, "host", &err);
4266    visit_type_str(m, obj ? &(*obj)->port : NULL, "port", &err);
4267    visit_start_optional(m, obj ? &(*obj)->has_to : NULL, "to", &err);
4268    if (obj && (*obj)->has_to) {
4269        visit_type_uint16(m, obj ? &(*obj)->to : NULL, "to", &err);
4270    }
4271    visit_end_optional(m, &err);
4272    visit_start_optional(m, obj ? &(*obj)->has_ipv4 : NULL, "ipv4", &err);
4273    if (obj && (*obj)->has_ipv4) {
4274        visit_type_bool(m, obj ? &(*obj)->ipv4 : NULL, "ipv4", &err);
4275    }
4276    visit_end_optional(m, &err);
4277    visit_start_optional(m, obj ? &(*obj)->has_ipv6 : NULL, "ipv6", &err);
4278    if (obj && (*obj)->has_ipv6) {
4279        visit_type_bool(m, obj ? &(*obj)->ipv6 : NULL, "ipv6", &err);
4280    }
4281    visit_end_optional(m, &err);
4282
4283    error_propagate(errp, err);
4284}
4285
4286void visit_type_InetSocketAddress(Visitor *m, InetSocketAddress ** obj, const char *name, Error **errp)
4287{
4288    if (!error_is_set(errp)) {
4289        Error *err = NULL;
4290        visit_start_struct(m, (void **)obj, "InetSocketAddress", name, sizeof(InetSocketAddress), &err);
4291        if (!err) {
4292            if (!obj || *obj) {
4293                visit_type_InetSocketAddress_fields(m, obj, &err);
4294                error_propagate(errp, err);
4295                err = NULL;
4296            }
4297            /* Always call end_struct if start_struct succeeded.  */
4298            visit_end_struct(m, &err);
4299        }
4300        error_propagate(errp, err);
4301    }
4302}
4303
4304void visit_type_InetSocketAddressList(Visitor *m, InetSocketAddressList ** obj, const char *name, Error **errp)
4305{
4306    GenericList *i, **prev = (GenericList **)obj;
4307    Error *err = NULL;
4308
4309    if (!error_is_set(errp)) {
4310        visit_start_list(m, name, &err);
4311        if (!err) {
4312            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
4313                InetSocketAddressList *native_i = (InetSocketAddressList *)i;
4314                visit_type_InetSocketAddress(m, &native_i->value, NULL, &err);
4315            }
4316            error_propagate(errp, err);
4317            err = NULL;
4318
4319            /* Always call end_list if start_list succeeded.  */
4320            visit_end_list(m, &err);
4321        }
4322        error_propagate(errp, err);
4323    }
4324}
4325
4326static void visit_type_UnixSocketAddress_fields(Visitor *m, UnixSocketAddress ** obj, Error **errp)
4327{
4328    Error *err = NULL;
4329    visit_type_str(m, obj ? &(*obj)->path : NULL, "path", &err);
4330
4331    error_propagate(errp, err);
4332}
4333
4334void visit_type_UnixSocketAddress(Visitor *m, UnixSocketAddress ** obj, const char *name, Error **errp)
4335{
4336    if (!error_is_set(errp)) {
4337        Error *err = NULL;
4338        visit_start_struct(m, (void **)obj, "UnixSocketAddress", name, sizeof(UnixSocketAddress), &err);
4339        if (!err) {
4340            if (!obj || *obj) {
4341                visit_type_UnixSocketAddress_fields(m, obj, &err);
4342                error_propagate(errp, err);
4343                err = NULL;
4344            }
4345            /* Always call end_struct if start_struct succeeded.  */
4346            visit_end_struct(m, &err);
4347        }
4348        error_propagate(errp, err);
4349    }
4350}
4351
4352void visit_type_UnixSocketAddressList(Visitor *m, UnixSocketAddressList ** obj, const char *name, Error **errp)
4353{
4354    GenericList *i, **prev = (GenericList **)obj;
4355    Error *err = NULL;
4356
4357    if (!error_is_set(errp)) {
4358        visit_start_list(m, name, &err);
4359        if (!err) {
4360            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
4361                UnixSocketAddressList *native_i = (UnixSocketAddressList *)i;
4362                visit_type_UnixSocketAddress(m, &native_i->value, NULL, &err);
4363            }
4364            error_propagate(errp, err);
4365            err = NULL;
4366
4367            /* Always call end_list if start_list succeeded.  */
4368            visit_end_list(m, &err);
4369        }
4370        error_propagate(errp, err);
4371    }
4372}
4373
4374void visit_type_SocketAddressKind(Visitor *m, SocketAddressKind * obj, const char *name, Error **errp)
4375{
4376    visit_type_enum(m, (int *)obj, SocketAddressKind_lookup, "SocketAddressKind", name, errp);
4377}
4378
4379void visit_type_SocketAddress(Visitor *m, SocketAddress ** obj, const char *name, Error **errp)
4380{
4381    Error *err = NULL;
4382
4383    if (!error_is_set(errp)) {
4384        visit_start_struct(m, (void **)obj, "SocketAddress", name, sizeof(SocketAddress), &err);
4385        if (!err) {
4386            if (obj && *obj) {
4387                visit_type_SocketAddressKind(m, &(*obj)->kind, "type", &err);
4388                if (!err) {
4389                    switch ((*obj)->kind) {
4390                    case SOCKET_ADDRESS_KIND_INET:
4391                        visit_type_InetSocketAddress(m, &(*obj)->inet, "data", &err);
4392                        break;
4393                    case SOCKET_ADDRESS_KIND_UNIX:
4394                        visit_type_UnixSocketAddress(m, &(*obj)->q_unix, "data", &err);
4395                        break;
4396                    case SOCKET_ADDRESS_KIND_FD:
4397                        visit_type_String(m, &(*obj)->fd, "data", &err);
4398                        break;
4399                    default:
4400                        abort();
4401                    }
4402                }
4403                error_propagate(errp, err);
4404                err = NULL;
4405            }
4406            /* Always call end_struct if start_struct succeeded.  */
4407            visit_end_struct(m, &err);
4408        }
4409        error_propagate(errp, err);
4410    }
4411}
4412
4413void visit_type_SocketAddressList(Visitor *m, SocketAddressList ** obj, const char *name, Error **errp)
4414{
4415    GenericList *i, **prev = (GenericList **)obj;
4416    Error *err = NULL;
4417
4418    if (!error_is_set(errp)) {
4419        visit_start_list(m, name, &err);
4420        if (!err) {
4421            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
4422                SocketAddressList *native_i = (SocketAddressList *)i;
4423                visit_type_SocketAddress(m, &native_i->value, NULL, &err);
4424            }
4425            error_propagate(errp, err);
4426            err = NULL;
4427
4428            /* Always call end_list if start_list succeeded.  */
4429            visit_end_list(m, &err);
4430        }
4431        error_propagate(errp, err);
4432    }
4433}
4434
4435static void visit_type_MachineInfo_fields(Visitor *m, MachineInfo ** obj, Error **errp)
4436{
4437    Error *err = NULL;
4438    visit_type_str(m, obj ? &(*obj)->name : NULL, "name", &err);
4439    visit_start_optional(m, obj ? &(*obj)->has_alias : NULL, "alias", &err);
4440    if (obj && (*obj)->has_alias) {
4441        visit_type_str(m, obj ? &(*obj)->alias : NULL, "alias", &err);
4442    }
4443    visit_end_optional(m, &err);
4444    visit_start_optional(m, obj ? &(*obj)->has_is_default : NULL, "is-default", &err);
4445    if (obj && (*obj)->has_is_default) {
4446        visit_type_bool(m, obj ? &(*obj)->is_default : NULL, "is-default", &err);
4447    }
4448    visit_end_optional(m, &err);
4449    visit_type_int(m, obj ? &(*obj)->cpu_max : NULL, "cpu-max", &err);
4450
4451    error_propagate(errp, err);
4452}
4453
4454void visit_type_MachineInfo(Visitor *m, MachineInfo ** obj, const char *name, Error **errp)
4455{
4456    if (!error_is_set(errp)) {
4457        Error *err = NULL;
4458        visit_start_struct(m, (void **)obj, "MachineInfo", name, sizeof(MachineInfo), &err);
4459        if (!err) {
4460            if (!obj || *obj) {
4461                visit_type_MachineInfo_fields(m, obj, &err);
4462                error_propagate(errp, err);
4463                err = NULL;
4464            }
4465            /* Always call end_struct if start_struct succeeded.  */
4466            visit_end_struct(m, &err);
4467        }
4468        error_propagate(errp, err);
4469    }
4470}
4471
4472void visit_type_MachineInfoList(Visitor *m, MachineInfoList ** obj, const char *name, Error **errp)
4473{
4474    GenericList *i, **prev = (GenericList **)obj;
4475    Error *err = NULL;
4476
4477    if (!error_is_set(errp)) {
4478        visit_start_list(m, name, &err);
4479        if (!err) {
4480            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
4481                MachineInfoList *native_i = (MachineInfoList *)i;
4482                visit_type_MachineInfo(m, &native_i->value, NULL, &err);
4483            }
4484            error_propagate(errp, err);
4485            err = NULL;
4486
4487            /* Always call end_list if start_list succeeded.  */
4488            visit_end_list(m, &err);
4489        }
4490        error_propagate(errp, err);
4491    }
4492}
4493
4494static void visit_type_CpuDefinitionInfo_fields(Visitor *m, CpuDefinitionInfo ** obj, Error **errp)
4495{
4496    Error *err = NULL;
4497    visit_type_str(m, obj ? &(*obj)->name : NULL, "name", &err);
4498
4499    error_propagate(errp, err);
4500}
4501
4502void visit_type_CpuDefinitionInfo(Visitor *m, CpuDefinitionInfo ** obj, const char *name, Error **errp)
4503{
4504    if (!error_is_set(errp)) {
4505        Error *err = NULL;
4506        visit_start_struct(m, (void **)obj, "CpuDefinitionInfo", name, sizeof(CpuDefinitionInfo), &err);
4507        if (!err) {
4508            if (!obj || *obj) {
4509                visit_type_CpuDefinitionInfo_fields(m, obj, &err);
4510                error_propagate(errp, err);
4511                err = NULL;
4512            }
4513            /* Always call end_struct if start_struct succeeded.  */
4514            visit_end_struct(m, &err);
4515        }
4516        error_propagate(errp, err);
4517    }
4518}
4519
4520void visit_type_CpuDefinitionInfoList(Visitor *m, CpuDefinitionInfoList ** obj, const char *name, Error **errp)
4521{
4522    GenericList *i, **prev = (GenericList **)obj;
4523    Error *err = NULL;
4524
4525    if (!error_is_set(errp)) {
4526        visit_start_list(m, name, &err);
4527        if (!err) {
4528            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
4529                CpuDefinitionInfoList *native_i = (CpuDefinitionInfoList *)i;
4530                visit_type_CpuDefinitionInfo(m, &native_i->value, NULL, &err);
4531            }
4532            error_propagate(errp, err);
4533            err = NULL;
4534
4535            /* Always call end_list if start_list succeeded.  */
4536            visit_end_list(m, &err);
4537        }
4538        error_propagate(errp, err);
4539    }
4540}
4541
4542static void visit_type_AddfdInfo_fields(Visitor *m, AddfdInfo ** obj, Error **errp)
4543{
4544    Error *err = NULL;
4545    visit_type_int(m, obj ? &(*obj)->fdset_id : NULL, "fdset-id", &err);
4546    visit_type_int(m, obj ? &(*obj)->fd : NULL, "fd", &err);
4547
4548    error_propagate(errp, err);
4549}
4550
4551void visit_type_AddfdInfo(Visitor *m, AddfdInfo ** obj, const char *name, Error **errp)
4552{
4553    if (!error_is_set(errp)) {
4554        Error *err = NULL;
4555        visit_start_struct(m, (void **)obj, "AddfdInfo", name, sizeof(AddfdInfo), &err);
4556        if (!err) {
4557            if (!obj || *obj) {
4558                visit_type_AddfdInfo_fields(m, obj, &err);
4559                error_propagate(errp, err);
4560                err = NULL;
4561            }
4562            /* Always call end_struct if start_struct succeeded.  */
4563            visit_end_struct(m, &err);
4564        }
4565        error_propagate(errp, err);
4566    }
4567}
4568
4569void visit_type_AddfdInfoList(Visitor *m, AddfdInfoList ** obj, const char *name, Error **errp)
4570{
4571    GenericList *i, **prev = (GenericList **)obj;
4572    Error *err = NULL;
4573
4574    if (!error_is_set(errp)) {
4575        visit_start_list(m, name, &err);
4576        if (!err) {
4577            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
4578                AddfdInfoList *native_i = (AddfdInfoList *)i;
4579                visit_type_AddfdInfo(m, &native_i->value, NULL, &err);
4580            }
4581            error_propagate(errp, err);
4582            err = NULL;
4583
4584            /* Always call end_list if start_list succeeded.  */
4585            visit_end_list(m, &err);
4586        }
4587        error_propagate(errp, err);
4588    }
4589}
4590
4591static void visit_type_FdsetFdInfo_fields(Visitor *m, FdsetFdInfo ** obj, Error **errp)
4592{
4593    Error *err = NULL;
4594    visit_type_int(m, obj ? &(*obj)->fd : NULL, "fd", &err);
4595    visit_start_optional(m, obj ? &(*obj)->has_opaque : NULL, "opaque", &err);
4596    if (obj && (*obj)->has_opaque) {
4597        visit_type_str(m, obj ? &(*obj)->opaque : NULL, "opaque", &err);
4598    }
4599    visit_end_optional(m, &err);
4600
4601    error_propagate(errp, err);
4602}
4603
4604void visit_type_FdsetFdInfo(Visitor *m, FdsetFdInfo ** obj, const char *name, Error **errp)
4605{
4606    if (!error_is_set(errp)) {
4607        Error *err = NULL;
4608        visit_start_struct(m, (void **)obj, "FdsetFdInfo", name, sizeof(FdsetFdInfo), &err);
4609        if (!err) {
4610            if (!obj || *obj) {
4611                visit_type_FdsetFdInfo_fields(m, obj, &err);
4612                error_propagate(errp, err);
4613                err = NULL;
4614            }
4615            /* Always call end_struct if start_struct succeeded.  */
4616            visit_end_struct(m, &err);
4617        }
4618        error_propagate(errp, err);
4619    }
4620}
4621
4622void visit_type_FdsetFdInfoList(Visitor *m, FdsetFdInfoList ** obj, const char *name, Error **errp)
4623{
4624    GenericList *i, **prev = (GenericList **)obj;
4625    Error *err = NULL;
4626
4627    if (!error_is_set(errp)) {
4628        visit_start_list(m, name, &err);
4629        if (!err) {
4630            for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
4631                FdsetFdInfoList *native_i = (FdsetFdInfoList *)i;
4632                visit_type_FdsetFdInfo(m, &native_i->value, NULL, &err);
4633            }
4634            error_propagate(errp, err);
4635            err = NULL;
4636
4637            /* Always call end_list if start_list succeeded.  */
4638            visit_end_list(m, &err);
4639        }
4640        error_propagate(errp, err);
4641    }
4642}
4643
4644static void visit_type_FdsetInfo_fields(Visitor *m, FdsetInfo ** obj, Error **errp)
4645{
4646    Error *err = NULL;
4647    visit_type_int(m, obj ? &(*obj)->fdset_id : NULL, "fdset-id", &err);
4648    visit_type_FdsetFdInfoList(m, obj ? &(*obj)->fds : NULL, "fds", &err);
4649
4650    error_propagate(errp, err);
4651}
4652
4653void visit_type_FdsetInfo(Visitor *m,