blob: af20d3ef16e94cadae0fe5f3569a6dff12e9d478 [file] [log] [blame]
/* THIS FILE IS AUTOMATICALLY GENERATED, DO NOT MODIFY */
/*
* schema-defined QAPI visitor functions
*
* Copyright IBM, Corp. 2011
*
* Authors:
* Anthony Liguori <aliguori@us.ibm.com>
*
* This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
* See the COPYING.LIB file in the top-level directory.
*
*/
#include "qemu-common.h"
#include "qapi-visit.h"
#ifndef QAPI_VISIT_BUILTIN_VISITOR_DEF_H
#define QAPI_VISIT_BUILTIN_VISITOR_DEF_H
void visit_type_strList(Visitor *m, strList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
strList *native_i = (strList *)i;
visit_type_str(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_intList(Visitor *m, intList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
intList *native_i = (intList *)i;
visit_type_int(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_numberList(Visitor *m, numberList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
numberList *native_i = (numberList *)i;
visit_type_number(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_boolList(Visitor *m, boolList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
boolList *native_i = (boolList *)i;
visit_type_bool(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_int8List(Visitor *m, int8List ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
int8List *native_i = (int8List *)i;
visit_type_int8(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_int16List(Visitor *m, int16List ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
int16List *native_i = (int16List *)i;
visit_type_int16(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_int32List(Visitor *m, int32List ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
int32List *native_i = (int32List *)i;
visit_type_int32(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_int64List(Visitor *m, int64List ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
int64List *native_i = (int64List *)i;
visit_type_int64(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_uint8List(Visitor *m, uint8List ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
uint8List *native_i = (uint8List *)i;
visit_type_uint8(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_uint16List(Visitor *m, uint16List ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
uint16List *native_i = (uint16List *)i;
visit_type_uint16(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_uint32List(Visitor *m, uint32List ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
uint32List *native_i = (uint32List *)i;
visit_type_uint32(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_uint64List(Visitor *m, uint64List ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
uint64List *native_i = (uint64List *)i;
visit_type_uint64(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
#endif /* QAPI_VISIT_BUILTIN_VISITOR_DEF_H */
void visit_type_ErrorClassList(Visitor *m, ErrorClassList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
ErrorClassList *native_i = (ErrorClassList *)i;
visit_type_ErrorClass(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_ErrorClass(Visitor *m, ErrorClass * obj, const char *name, Error **errp)
{
visit_type_enum(m, (int *)obj, ErrorClass_lookup, "ErrorClass", name, errp);
}
static void visit_type_NameInfo_fields(Visitor *m, NameInfo ** obj, Error **errp)
{
Error *err = NULL;
visit_start_optional(m, obj ? &(*obj)->has_name : NULL, "name", &err);
if (obj && (*obj)->has_name) {
visit_type_str(m, obj ? &(*obj)->name : NULL, "name", &err);
}
visit_end_optional(m, &err);
error_propagate(errp, err);
}
void visit_type_NameInfo(Visitor *m, NameInfo ** obj, const char *name, Error **errp)
{
if (!error_is_set(errp)) {
Error *err = NULL;
visit_start_struct(m, (void **)obj, "NameInfo", name, sizeof(NameInfo), &err);
if (!err) {
if (!obj || *obj) {
visit_type_NameInfo_fields(m, obj, &err);
error_propagate(errp, err);
err = NULL;
}
/* Always call end_struct if start_struct succeeded. */
visit_end_struct(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_NameInfoList(Visitor *m, NameInfoList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
NameInfoList *native_i = (NameInfoList *)i;
visit_type_NameInfo(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
static void visit_type_VersionInfo_qemu_fields(Visitor *m, VersionInfo ** obj, Error **errp)
{
Error *err = NULL;
visit_type_int(m, obj ? &(*obj)->qemu.major : NULL, "major", &err);
visit_type_int(m, obj ? &(*obj)->qemu.minor : NULL, "minor", &err);
visit_type_int(m, obj ? &(*obj)->qemu.micro : NULL, "micro", &err);
error_propagate(errp, err);
}
static void visit_type_VersionInfo_fields(Visitor *m, VersionInfo ** obj, Error **errp)
{
Error *err = NULL;
if (!error_is_set(errp)) {
Error **errp = &err; /* from outer scope */
Error *err = NULL;
visit_start_struct(m, NULL, "", "qemu", 0, &err);
if (!err) {
if (!obj || *obj) {
visit_type_VersionInfo_qemu_fields(m, obj, &err);
error_propagate(errp, err);
err = NULL;
}
/* Always call end_struct if start_struct succeeded. */
visit_end_struct(m, &err);
}
error_propagate(errp, err);
}
visit_type_str(m, obj ? &(*obj)->package : NULL, "package", &err);
error_propagate(errp, err);
}
void visit_type_VersionInfo(Visitor *m, VersionInfo ** obj, const char *name, Error **errp)
{
if (!error_is_set(errp)) {
Error *err = NULL;
visit_start_struct(m, (void **)obj, "VersionInfo", name, sizeof(VersionInfo), &err);
if (!err) {
if (!obj || *obj) {
visit_type_VersionInfo_fields(m, obj, &err);
error_propagate(errp, err);
err = NULL;
}
/* Always call end_struct if start_struct succeeded. */
visit_end_struct(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_VersionInfoList(Visitor *m, VersionInfoList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
VersionInfoList *native_i = (VersionInfoList *)i;
visit_type_VersionInfo(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
static void visit_type_KvmInfo_fields(Visitor *m, KvmInfo ** obj, Error **errp)
{
Error *err = NULL;
visit_type_bool(m, obj ? &(*obj)->enabled : NULL, "enabled", &err);
visit_type_bool(m, obj ? &(*obj)->present : NULL, "present", &err);
error_propagate(errp, err);
}
void visit_type_KvmInfo(Visitor *m, KvmInfo ** obj, const char *name, Error **errp)
{
if (!error_is_set(errp)) {
Error *err = NULL;
visit_start_struct(m, (void **)obj, "KvmInfo", name, sizeof(KvmInfo), &err);
if (!err) {
if (!obj || *obj) {
visit_type_KvmInfo_fields(m, obj, &err);
error_propagate(errp, err);
err = NULL;
}
/* Always call end_struct if start_struct succeeded. */
visit_end_struct(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_KvmInfoList(Visitor *m, KvmInfoList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
KvmInfoList *native_i = (KvmInfoList *)i;
visit_type_KvmInfo(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_RunStateList(Visitor *m, RunStateList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
RunStateList *native_i = (RunStateList *)i;
visit_type_RunState(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_RunState(Visitor *m, RunState * obj, const char *name, Error **errp)
{
visit_type_enum(m, (int *)obj, RunState_lookup, "RunState", name, errp);
}
static void visit_type_SnapshotInfo_fields(Visitor *m, SnapshotInfo ** obj, Error **errp)
{
Error *err = NULL;
visit_type_str(m, obj ? &(*obj)->id : NULL, "id", &err);
visit_type_str(m, obj ? &(*obj)->name : NULL, "name", &err);
visit_type_int(m, obj ? &(*obj)->vm_state_size : NULL, "vm-state-size", &err);
visit_type_int(m, obj ? &(*obj)->date_sec : NULL, "date-sec", &err);
visit_type_int(m, obj ? &(*obj)->date_nsec : NULL, "date-nsec", &err);
visit_type_int(m, obj ? &(*obj)->vm_clock_sec : NULL, "vm-clock-sec", &err);
visit_type_int(m, obj ? &(*obj)->vm_clock_nsec : NULL, "vm-clock-nsec", &err);
error_propagate(errp, err);
}
void visit_type_SnapshotInfo(Visitor *m, SnapshotInfo ** obj, const char *name, Error **errp)
{
if (!error_is_set(errp)) {
Error *err = NULL;
visit_start_struct(m, (void **)obj, "SnapshotInfo", name, sizeof(SnapshotInfo), &err);
if (!err) {
if (!obj || *obj) {
visit_type_SnapshotInfo_fields(m, obj, &err);
error_propagate(errp, err);
err = NULL;
}
/* Always call end_struct if start_struct succeeded. */
visit_end_struct(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_SnapshotInfoList(Visitor *m, SnapshotInfoList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
SnapshotInfoList *native_i = (SnapshotInfoList *)i;
visit_type_SnapshotInfo(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
static void visit_type_ImageInfoSpecificQCow2_fields(Visitor *m, ImageInfoSpecificQCow2 ** obj, Error **errp)
{
Error *err = NULL;
visit_type_str(m, obj ? &(*obj)->compat : NULL, "compat", &err);
visit_start_optional(m, obj ? &(*obj)->has_lazy_refcounts : NULL, "lazy-refcounts", &err);
if (obj && (*obj)->has_lazy_refcounts) {
visit_type_bool(m, obj ? &(*obj)->lazy_refcounts : NULL, "lazy-refcounts", &err);
}
visit_end_optional(m, &err);
error_propagate(errp, err);
}
void visit_type_ImageInfoSpecificQCow2(Visitor *m, ImageInfoSpecificQCow2 ** obj, const char *name, Error **errp)
{
if (!error_is_set(errp)) {
Error *err = NULL;
visit_start_struct(m, (void **)obj, "ImageInfoSpecificQCow2", name, sizeof(ImageInfoSpecificQCow2), &err);
if (!err) {
if (!obj || *obj) {
visit_type_ImageInfoSpecificQCow2_fields(m, obj, &err);
error_propagate(errp, err);
err = NULL;
}
/* Always call end_struct if start_struct succeeded. */
visit_end_struct(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_ImageInfoSpecificQCow2List(Visitor *m, ImageInfoSpecificQCow2List ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
ImageInfoSpecificQCow2List *native_i = (ImageInfoSpecificQCow2List *)i;
visit_type_ImageInfoSpecificQCow2(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
static void visit_type_ImageInfoSpecificVmdk_fields(Visitor *m, ImageInfoSpecificVmdk ** obj, Error **errp)
{
Error *err = NULL;
visit_type_str(m, obj ? &(*obj)->create_type : NULL, "create-type", &err);
visit_type_int(m, obj ? &(*obj)->cid : NULL, "cid", &err);
visit_type_int(m, obj ? &(*obj)->parent_cid : NULL, "parent-cid", &err);
visit_type_ImageInfoList(m, obj ? &(*obj)->extents : NULL, "extents", &err);
error_propagate(errp, err);
}
void visit_type_ImageInfoSpecificVmdk(Visitor *m, ImageInfoSpecificVmdk ** obj, const char *name, Error **errp)
{
if (!error_is_set(errp)) {
Error *err = NULL;
visit_start_struct(m, (void **)obj, "ImageInfoSpecificVmdk", name, sizeof(ImageInfoSpecificVmdk), &err);
if (!err) {
if (!obj || *obj) {
visit_type_ImageInfoSpecificVmdk_fields(m, obj, &err);
error_propagate(errp, err);
err = NULL;
}
/* Always call end_struct if start_struct succeeded. */
visit_end_struct(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_ImageInfoSpecificVmdkList(Visitor *m, ImageInfoSpecificVmdkList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
ImageInfoSpecificVmdkList *native_i = (ImageInfoSpecificVmdkList *)i;
visit_type_ImageInfoSpecificVmdk(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_ImageInfoSpecificKind(Visitor *m, ImageInfoSpecificKind * obj, const char *name, Error **errp)
{
visit_type_enum(m, (int *)obj, ImageInfoSpecificKind_lookup, "ImageInfoSpecificKind", name, errp);
}
void visit_type_ImageInfoSpecific(Visitor *m, ImageInfoSpecific ** obj, const char *name, Error **errp)
{
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_struct(m, (void **)obj, "ImageInfoSpecific", name, sizeof(ImageInfoSpecific), &err);
if (!err) {
if (obj && *obj) {
visit_type_ImageInfoSpecificKind(m, &(*obj)->kind, "type", &err);
if (!err) {
switch ((*obj)->kind) {
case IMAGE_INFO_SPECIFIC_KIND_QCOW2:
visit_type_ImageInfoSpecificQCow2(m, &(*obj)->qcow2, "data", &err);
break;
case IMAGE_INFO_SPECIFIC_KIND_VMDK:
visit_type_ImageInfoSpecificVmdk(m, &(*obj)->vmdk, "data", &err);
break;
default:
abort();
}
}
error_propagate(errp, err);
err = NULL;
}
/* Always call end_struct if start_struct succeeded. */
visit_end_struct(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_ImageInfoSpecificList(Visitor *m, ImageInfoSpecificList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
ImageInfoSpecificList *native_i = (ImageInfoSpecificList *)i;
visit_type_ImageInfoSpecific(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
static void visit_type_ImageInfo_fields(Visitor *m, ImageInfo ** obj, Error **errp)
{
Error *err = NULL;
visit_type_str(m, obj ? &(*obj)->filename : NULL, "filename", &err);
visit_type_str(m, obj ? &(*obj)->format : NULL, "format", &err);
visit_start_optional(m, obj ? &(*obj)->has_dirty_flag : NULL, "dirty-flag", &err);
if (obj && (*obj)->has_dirty_flag) {
visit_type_bool(m, obj ? &(*obj)->dirty_flag : NULL, "dirty-flag", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_actual_size : NULL, "actual-size", &err);
if (obj && (*obj)->has_actual_size) {
visit_type_int(m, obj ? &(*obj)->actual_size : NULL, "actual-size", &err);
}
visit_end_optional(m, &err);
visit_type_int(m, obj ? &(*obj)->virtual_size : NULL, "virtual-size", &err);
visit_start_optional(m, obj ? &(*obj)->has_cluster_size : NULL, "cluster-size", &err);
if (obj && (*obj)->has_cluster_size) {
visit_type_int(m, obj ? &(*obj)->cluster_size : NULL, "cluster-size", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_encrypted : NULL, "encrypted", &err);
if (obj && (*obj)->has_encrypted) {
visit_type_bool(m, obj ? &(*obj)->encrypted : NULL, "encrypted", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_compressed : NULL, "compressed", &err);
if (obj && (*obj)->has_compressed) {
visit_type_bool(m, obj ? &(*obj)->compressed : NULL, "compressed", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_backing_filename : NULL, "backing-filename", &err);
if (obj && (*obj)->has_backing_filename) {
visit_type_str(m, obj ? &(*obj)->backing_filename : NULL, "backing-filename", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_full_backing_filename : NULL, "full-backing-filename", &err);
if (obj && (*obj)->has_full_backing_filename) {
visit_type_str(m, obj ? &(*obj)->full_backing_filename : NULL, "full-backing-filename", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_backing_filename_format : NULL, "backing-filename-format", &err);
if (obj && (*obj)->has_backing_filename_format) {
visit_type_str(m, obj ? &(*obj)->backing_filename_format : NULL, "backing-filename-format", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_snapshots : NULL, "snapshots", &err);
if (obj && (*obj)->has_snapshots) {
visit_type_SnapshotInfoList(m, obj ? &(*obj)->snapshots : NULL, "snapshots", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_backing_image : NULL, "backing-image", &err);
if (obj && (*obj)->has_backing_image) {
visit_type_ImageInfo(m, obj ? &(*obj)->backing_image : NULL, "backing-image", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_format_specific : NULL, "format-specific", &err);
if (obj && (*obj)->has_format_specific) {
visit_type_ImageInfoSpecific(m, obj ? &(*obj)->format_specific : NULL, "format-specific", &err);
}
visit_end_optional(m, &err);
error_propagate(errp, err);
}
void visit_type_ImageInfo(Visitor *m, ImageInfo ** obj, const char *name, Error **errp)
{
if (!error_is_set(errp)) {
Error *err = NULL;
visit_start_struct(m, (void **)obj, "ImageInfo", name, sizeof(ImageInfo), &err);
if (!err) {
if (!obj || *obj) {
visit_type_ImageInfo_fields(m, obj, &err);
error_propagate(errp, err);
err = NULL;
}
/* Always call end_struct if start_struct succeeded. */
visit_end_struct(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_ImageInfoList(Visitor *m, ImageInfoList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
ImageInfoList *native_i = (ImageInfoList *)i;
visit_type_ImageInfo(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
static void visit_type_ImageCheck_fields(Visitor *m, ImageCheck ** obj, Error **errp)
{
Error *err = NULL;
visit_type_str(m, obj ? &(*obj)->filename : NULL, "filename", &err);
visit_type_str(m, obj ? &(*obj)->format : NULL, "format", &err);
visit_type_int(m, obj ? &(*obj)->check_errors : NULL, "check-errors", &err);
visit_start_optional(m, obj ? &(*obj)->has_image_end_offset : NULL, "image-end-offset", &err);
if (obj && (*obj)->has_image_end_offset) {
visit_type_int(m, obj ? &(*obj)->image_end_offset : NULL, "image-end-offset", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_corruptions : NULL, "corruptions", &err);
if (obj && (*obj)->has_corruptions) {
visit_type_int(m, obj ? &(*obj)->corruptions : NULL, "corruptions", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_leaks : NULL, "leaks", &err);
if (obj && (*obj)->has_leaks) {
visit_type_int(m, obj ? &(*obj)->leaks : NULL, "leaks", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_corruptions_fixed : NULL, "corruptions-fixed", &err);
if (obj && (*obj)->has_corruptions_fixed) {
visit_type_int(m, obj ? &(*obj)->corruptions_fixed : NULL, "corruptions-fixed", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_leaks_fixed : NULL, "leaks-fixed", &err);
if (obj && (*obj)->has_leaks_fixed) {
visit_type_int(m, obj ? &(*obj)->leaks_fixed : NULL, "leaks-fixed", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_total_clusters : NULL, "total-clusters", &err);
if (obj && (*obj)->has_total_clusters) {
visit_type_int(m, obj ? &(*obj)->total_clusters : NULL, "total-clusters", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_allocated_clusters : NULL, "allocated-clusters", &err);
if (obj && (*obj)->has_allocated_clusters) {
visit_type_int(m, obj ? &(*obj)->allocated_clusters : NULL, "allocated-clusters", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_fragmented_clusters : NULL, "fragmented-clusters", &err);
if (obj && (*obj)->has_fragmented_clusters) {
visit_type_int(m, obj ? &(*obj)->fragmented_clusters : NULL, "fragmented-clusters", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_compressed_clusters : NULL, "compressed-clusters", &err);
if (obj && (*obj)->has_compressed_clusters) {
visit_type_int(m, obj ? &(*obj)->compressed_clusters : NULL, "compressed-clusters", &err);
}
visit_end_optional(m, &err);
error_propagate(errp, err);
}
void visit_type_ImageCheck(Visitor *m, ImageCheck ** obj, const char *name, Error **errp)
{
if (!error_is_set(errp)) {
Error *err = NULL;
visit_start_struct(m, (void **)obj, "ImageCheck", name, sizeof(ImageCheck), &err);
if (!err) {
if (!obj || *obj) {
visit_type_ImageCheck_fields(m, obj, &err);
error_propagate(errp, err);
err = NULL;
}
/* Always call end_struct if start_struct succeeded. */
visit_end_struct(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_ImageCheckList(Visitor *m, ImageCheckList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
ImageCheckList *native_i = (ImageCheckList *)i;
visit_type_ImageCheck(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
static void visit_type_StatusInfo_fields(Visitor *m, StatusInfo ** obj, Error **errp)
{
Error *err = NULL;
visit_type_bool(m, obj ? &(*obj)->running : NULL, "running", &err);
visit_type_bool(m, obj ? &(*obj)->singlestep : NULL, "singlestep", &err);
visit_type_RunState(m, obj ? &(*obj)->status : NULL, "status", &err);
error_propagate(errp, err);
}
void visit_type_StatusInfo(Visitor *m, StatusInfo ** obj, const char *name, Error **errp)
{
if (!error_is_set(errp)) {
Error *err = NULL;
visit_start_struct(m, (void **)obj, "StatusInfo", name, sizeof(StatusInfo), &err);
if (!err) {
if (!obj || *obj) {
visit_type_StatusInfo_fields(m, obj, &err);
error_propagate(errp, err);
err = NULL;
}
/* Always call end_struct if start_struct succeeded. */
visit_end_struct(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_StatusInfoList(Visitor *m, StatusInfoList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
StatusInfoList *native_i = (StatusInfoList *)i;
visit_type_StatusInfo(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
static void visit_type_UuidInfo_fields(Visitor *m, UuidInfo ** obj, Error **errp)
{
Error *err = NULL;
visit_type_str(m, obj ? &(*obj)->UUID : NULL, "UUID", &err);
error_propagate(errp, err);
}
void visit_type_UuidInfo(Visitor *m, UuidInfo ** obj, const char *name, Error **errp)
{
if (!error_is_set(errp)) {
Error *err = NULL;
visit_start_struct(m, (void **)obj, "UuidInfo", name, sizeof(UuidInfo), &err);
if (!err) {
if (!obj || *obj) {
visit_type_UuidInfo_fields(m, obj, &err);
error_propagate(errp, err);
err = NULL;
}
/* Always call end_struct if start_struct succeeded. */
visit_end_struct(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_UuidInfoList(Visitor *m, UuidInfoList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
UuidInfoList *native_i = (UuidInfoList *)i;
visit_type_UuidInfo(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
static void visit_type_ChardevInfo_fields(Visitor *m, ChardevInfo ** obj, Error **errp)
{
Error *err = NULL;
visit_type_str(m, obj ? &(*obj)->label : NULL, "label", &err);
visit_type_str(m, obj ? &(*obj)->filename : NULL, "filename", &err);
error_propagate(errp, err);
}
void visit_type_ChardevInfo(Visitor *m, ChardevInfo ** obj, const char *name, Error **errp)
{
if (!error_is_set(errp)) {
Error *err = NULL;
visit_start_struct(m, (void **)obj, "ChardevInfo", name, sizeof(ChardevInfo), &err);
if (!err) {
if (!obj || *obj) {
visit_type_ChardevInfo_fields(m, obj, &err);
error_propagate(errp, err);
err = NULL;
}
/* Always call end_struct if start_struct succeeded. */
visit_end_struct(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_ChardevInfoList(Visitor *m, ChardevInfoList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
ChardevInfoList *native_i = (ChardevInfoList *)i;
visit_type_ChardevInfo(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_DataFormatList(Visitor *m, DataFormatList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
DataFormatList *native_i = (DataFormatList *)i;
visit_type_DataFormat(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_DataFormat(Visitor *m, DataFormat * obj, const char *name, Error **errp)
{
visit_type_enum(m, (int *)obj, DataFormat_lookup, "DataFormat", name, errp);
}
static void visit_type_CommandInfo_fields(Visitor *m, CommandInfo ** obj, Error **errp)
{
Error *err = NULL;
visit_type_str(m, obj ? &(*obj)->name : NULL, "name", &err);
error_propagate(errp, err);
}
void visit_type_CommandInfo(Visitor *m, CommandInfo ** obj, const char *name, Error **errp)
{
if (!error_is_set(errp)) {
Error *err = NULL;
visit_start_struct(m, (void **)obj, "CommandInfo", name, sizeof(CommandInfo), &err);
if (!err) {
if (!obj || *obj) {
visit_type_CommandInfo_fields(m, obj, &err);
error_propagate(errp, err);
err = NULL;
}
/* Always call end_struct if start_struct succeeded. */
visit_end_struct(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_CommandInfoList(Visitor *m, CommandInfoList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
CommandInfoList *native_i = (CommandInfoList *)i;
visit_type_CommandInfo(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
static void visit_type_EventInfo_fields(Visitor *m, EventInfo ** obj, Error **errp)
{
Error *err = NULL;
visit_type_str(m, obj ? &(*obj)->name : NULL, "name", &err);
error_propagate(errp, err);
}
void visit_type_EventInfo(Visitor *m, EventInfo ** obj, const char *name, Error **errp)
{
if (!error_is_set(errp)) {
Error *err = NULL;
visit_start_struct(m, (void **)obj, "EventInfo", name, sizeof(EventInfo), &err);
if (!err) {
if (!obj || *obj) {
visit_type_EventInfo_fields(m, obj, &err);
error_propagate(errp, err);
err = NULL;
}
/* Always call end_struct if start_struct succeeded. */
visit_end_struct(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_EventInfoList(Visitor *m, EventInfoList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
EventInfoList *native_i = (EventInfoList *)i;
visit_type_EventInfo(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
static void visit_type_MigrationStats_fields(Visitor *m, MigrationStats ** obj, Error **errp)
{
Error *err = NULL;
visit_type_int(m, obj ? &(*obj)->transferred : NULL, "transferred", &err);
visit_type_int(m, obj ? &(*obj)->remaining : NULL, "remaining", &err);
visit_type_int(m, obj ? &(*obj)->total : NULL, "total", &err);
visit_type_int(m, obj ? &(*obj)->duplicate : NULL, "duplicate", &err);
visit_type_int(m, obj ? &(*obj)->skipped : NULL, "skipped", &err);
visit_type_int(m, obj ? &(*obj)->normal : NULL, "normal", &err);
visit_type_int(m, obj ? &(*obj)->normal_bytes : NULL, "normal-bytes", &err);
visit_type_int(m, obj ? &(*obj)->dirty_pages_rate : NULL, "dirty-pages-rate", &err);
visit_type_number(m, obj ? &(*obj)->mbps : NULL, "mbps", &err);
error_propagate(errp, err);
}
void visit_type_MigrationStats(Visitor *m, MigrationStats ** obj, const char *name, Error **errp)
{
if (!error_is_set(errp)) {
Error *err = NULL;
visit_start_struct(m, (void **)obj, "MigrationStats", name, sizeof(MigrationStats), &err);
if (!err) {
if (!obj || *obj) {
visit_type_MigrationStats_fields(m, obj, &err);
error_propagate(errp, err);
err = NULL;
}
/* Always call end_struct if start_struct succeeded. */
visit_end_struct(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_MigrationStatsList(Visitor *m, MigrationStatsList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
MigrationStatsList *native_i = (MigrationStatsList *)i;
visit_type_MigrationStats(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
static void visit_type_XBZRLECacheStats_fields(Visitor *m, XBZRLECacheStats ** obj, Error **errp)
{
Error *err = NULL;
visit_type_int(m, obj ? &(*obj)->cache_size : NULL, "cache-size", &err);
visit_type_int(m, obj ? &(*obj)->bytes : NULL, "bytes", &err);
visit_type_int(m, obj ? &(*obj)->pages : NULL, "pages", &err);
visit_type_int(m, obj ? &(*obj)->cache_miss : NULL, "cache-miss", &err);
visit_type_int(m, obj ? &(*obj)->overflow : NULL, "overflow", &err);
error_propagate(errp, err);
}
void visit_type_XBZRLECacheStats(Visitor *m, XBZRLECacheStats ** obj, const char *name, Error **errp)
{
if (!error_is_set(errp)) {
Error *err = NULL;
visit_start_struct(m, (void **)obj, "XBZRLECacheStats", name, sizeof(XBZRLECacheStats), &err);
if (!err) {
if (!obj || *obj) {
visit_type_XBZRLECacheStats_fields(m, obj, &err);
error_propagate(errp, err);
err = NULL;
}
/* Always call end_struct if start_struct succeeded. */
visit_end_struct(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_XBZRLECacheStatsList(Visitor *m, XBZRLECacheStatsList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
XBZRLECacheStatsList *native_i = (XBZRLECacheStatsList *)i;
visit_type_XBZRLECacheStats(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
static void visit_type_MigrationInfo_fields(Visitor *m, MigrationInfo ** obj, Error **errp)
{
Error *err = NULL;
visit_start_optional(m, obj ? &(*obj)->has_status : NULL, "status", &err);
if (obj && (*obj)->has_status) {
visit_type_str(m, obj ? &(*obj)->status : NULL, "status", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_ram : NULL, "ram", &err);
if (obj && (*obj)->has_ram) {
visit_type_MigrationStats(m, obj ? &(*obj)->ram : NULL, "ram", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_disk : NULL, "disk", &err);
if (obj && (*obj)->has_disk) {
visit_type_MigrationStats(m, obj ? &(*obj)->disk : NULL, "disk", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_xbzrle_cache : NULL, "xbzrle-cache", &err);
if (obj && (*obj)->has_xbzrle_cache) {
visit_type_XBZRLECacheStats(m, obj ? &(*obj)->xbzrle_cache : NULL, "xbzrle-cache", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_total_time : NULL, "total-time", &err);
if (obj && (*obj)->has_total_time) {
visit_type_int(m, obj ? &(*obj)->total_time : NULL, "total-time", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_expected_downtime : NULL, "expected-downtime", &err);
if (obj && (*obj)->has_expected_downtime) {
visit_type_int(m, obj ? &(*obj)->expected_downtime : NULL, "expected-downtime", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_downtime : NULL, "downtime", &err);
if (obj && (*obj)->has_downtime) {
visit_type_int(m, obj ? &(*obj)->downtime : NULL, "downtime", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_setup_time : NULL, "setup-time", &err);
if (obj && (*obj)->has_setup_time) {
visit_type_int(m, obj ? &(*obj)->setup_time : NULL, "setup-time", &err);
}
visit_end_optional(m, &err);
error_propagate(errp, err);
}
void visit_type_MigrationInfo(Visitor *m, MigrationInfo ** obj, const char *name, Error **errp)
{
if (!error_is_set(errp)) {
Error *err = NULL;
visit_start_struct(m, (void **)obj, "MigrationInfo", name, sizeof(MigrationInfo), &err);
if (!err) {
if (!obj || *obj) {
visit_type_MigrationInfo_fields(m, obj, &err);
error_propagate(errp, err);
err = NULL;
}
/* Always call end_struct if start_struct succeeded. */
visit_end_struct(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_MigrationInfoList(Visitor *m, MigrationInfoList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
MigrationInfoList *native_i = (MigrationInfoList *)i;
visit_type_MigrationInfo(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_MigrationCapabilityList(Visitor *m, MigrationCapabilityList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
MigrationCapabilityList *native_i = (MigrationCapabilityList *)i;
visit_type_MigrationCapability(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_MigrationCapability(Visitor *m, MigrationCapability * obj, const char *name, Error **errp)
{
visit_type_enum(m, (int *)obj, MigrationCapability_lookup, "MigrationCapability", name, errp);
}
static void visit_type_MigrationCapabilityStatus_fields(Visitor *m, MigrationCapabilityStatus ** obj, Error **errp)
{
Error *err = NULL;
visit_type_MigrationCapability(m, obj ? &(*obj)->capability : NULL, "capability", &err);
visit_type_bool(m, obj ? &(*obj)->state : NULL, "state", &err);
error_propagate(errp, err);
}
void visit_type_MigrationCapabilityStatus(Visitor *m, MigrationCapabilityStatus ** obj, const char *name, Error **errp)
{
if (!error_is_set(errp)) {
Error *err = NULL;
visit_start_struct(m, (void **)obj, "MigrationCapabilityStatus", name, sizeof(MigrationCapabilityStatus), &err);
if (!err) {
if (!obj || *obj) {
visit_type_MigrationCapabilityStatus_fields(m, obj, &err);
error_propagate(errp, err);
err = NULL;
}
/* Always call end_struct if start_struct succeeded. */
visit_end_struct(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_MigrationCapabilityStatusList(Visitor *m, MigrationCapabilityStatusList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
MigrationCapabilityStatusList *native_i = (MigrationCapabilityStatusList *)i;
visit_type_MigrationCapabilityStatus(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
static void visit_type_MouseInfo_fields(Visitor *m, MouseInfo ** obj, Error **errp)
{
Error *err = NULL;
visit_type_str(m, obj ? &(*obj)->name : NULL, "name", &err);
visit_type_int(m, obj ? &(*obj)->index : NULL, "index", &err);
visit_type_bool(m, obj ? &(*obj)->current : NULL, "current", &err);
visit_type_bool(m, obj ? &(*obj)->absolute : NULL, "absolute", &err);
error_propagate(errp, err);
}
void visit_type_MouseInfo(Visitor *m, MouseInfo ** obj, const char *name, Error **errp)
{
if (!error_is_set(errp)) {
Error *err = NULL;
visit_start_struct(m, (void **)obj, "MouseInfo", name, sizeof(MouseInfo), &err);
if (!err) {
if (!obj || *obj) {
visit_type_MouseInfo_fields(m, obj, &err);
error_propagate(errp, err);
err = NULL;
}
/* Always call end_struct if start_struct succeeded. */
visit_end_struct(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_MouseInfoList(Visitor *m, MouseInfoList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
MouseInfoList *native_i = (MouseInfoList *)i;
visit_type_MouseInfo(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
static void visit_type_CpuInfo_fields(Visitor *m, CpuInfo ** obj, Error **errp)
{
Error *err = NULL;
visit_type_int(m, obj ? &(*obj)->CPU : NULL, "CPU", &err);
visit_type_bool(m, obj ? &(*obj)->current : NULL, "current", &err);
visit_type_bool(m, obj ? &(*obj)->halted : NULL, "halted", &err);
visit_start_optional(m, obj ? &(*obj)->has_pc : NULL, "pc", &err);
if (obj && (*obj)->has_pc) {
visit_type_int(m, obj ? &(*obj)->pc : NULL, "pc", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_nip : NULL, "nip", &err);
if (obj && (*obj)->has_nip) {
visit_type_int(m, obj ? &(*obj)->nip : NULL, "nip", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_npc : NULL, "npc", &err);
if (obj && (*obj)->has_npc) {
visit_type_int(m, obj ? &(*obj)->npc : NULL, "npc", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_PC : NULL, "PC", &err);
if (obj && (*obj)->has_PC) {
visit_type_int(m, obj ? &(*obj)->PC : NULL, "PC", &err);
}
visit_end_optional(m, &err);
visit_type_int(m, obj ? &(*obj)->thread_id : NULL, "thread_id", &err);
error_propagate(errp, err);
}
void visit_type_CpuInfo(Visitor *m, CpuInfo ** obj, const char *name, Error **errp)
{
if (!error_is_set(errp)) {
Error *err = NULL;
visit_start_struct(m, (void **)obj, "CpuInfo", name, sizeof(CpuInfo), &err);
if (!err) {
if (!obj || *obj) {
visit_type_CpuInfo_fields(m, obj, &err);
error_propagate(errp, err);
err = NULL;
}
/* Always call end_struct if start_struct succeeded. */
visit_end_struct(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_CpuInfoList(Visitor *m, CpuInfoList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
CpuInfoList *native_i = (CpuInfoList *)i;
visit_type_CpuInfo(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
static void visit_type_BlockDeviceInfo_fields(Visitor *m, BlockDeviceInfo ** obj, Error **errp)
{
Error *err = NULL;
visit_type_str(m, obj ? &(*obj)->file : NULL, "file", &err);
visit_type_bool(m, obj ? &(*obj)->ro : NULL, "ro", &err);
visit_type_str(m, obj ? &(*obj)->drv : NULL, "drv", &err);
visit_start_optional(m, obj ? &(*obj)->has_backing_file : NULL, "backing_file", &err);
if (obj && (*obj)->has_backing_file) {
visit_type_str(m, obj ? &(*obj)->backing_file : NULL, "backing_file", &err);
}
visit_end_optional(m, &err);
visit_type_int(m, obj ? &(*obj)->backing_file_depth : NULL, "backing_file_depth", &err);
visit_type_bool(m, obj ? &(*obj)->encrypted : NULL, "encrypted", &err);
visit_type_bool(m, obj ? &(*obj)->encryption_key_missing : NULL, "encryption_key_missing", &err);
visit_type_int(m, obj ? &(*obj)->bps : NULL, "bps", &err);
visit_type_int(m, obj ? &(*obj)->bps_rd : NULL, "bps_rd", &err);
visit_type_int(m, obj ? &(*obj)->bps_wr : NULL, "bps_wr", &err);
visit_type_int(m, obj ? &(*obj)->iops : NULL, "iops", &err);
visit_type_int(m, obj ? &(*obj)->iops_rd : NULL, "iops_rd", &err);
visit_type_int(m, obj ? &(*obj)->iops_wr : NULL, "iops_wr", &err);
visit_type_ImageInfo(m, obj ? &(*obj)->image : NULL, "image", &err);
visit_start_optional(m, obj ? &(*obj)->has_bps_max : NULL, "bps_max", &err);
if (obj && (*obj)->has_bps_max) {
visit_type_int(m, obj ? &(*obj)->bps_max : NULL, "bps_max", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_bps_rd_max : NULL, "bps_rd_max", &err);
if (obj && (*obj)->has_bps_rd_max) {
visit_type_int(m, obj ? &(*obj)->bps_rd_max : NULL, "bps_rd_max", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_bps_wr_max : NULL, "bps_wr_max", &err);
if (obj && (*obj)->has_bps_wr_max) {
visit_type_int(m, obj ? &(*obj)->bps_wr_max : NULL, "bps_wr_max", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_iops_max : NULL, "iops_max", &err);
if (obj && (*obj)->has_iops_max) {
visit_type_int(m, obj ? &(*obj)->iops_max : NULL, "iops_max", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_iops_rd_max : NULL, "iops_rd_max", &err);
if (obj && (*obj)->has_iops_rd_max) {
visit_type_int(m, obj ? &(*obj)->iops_rd_max : NULL, "iops_rd_max", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_iops_wr_max : NULL, "iops_wr_max", &err);
if (obj && (*obj)->has_iops_wr_max) {
visit_type_int(m, obj ? &(*obj)->iops_wr_max : NULL, "iops_wr_max", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_iops_size : NULL, "iops_size", &err);
if (obj && (*obj)->has_iops_size) {
visit_type_int(m, obj ? &(*obj)->iops_size : NULL, "iops_size", &err);
}
visit_end_optional(m, &err);
error_propagate(errp, err);
}
void visit_type_BlockDeviceInfo(Visitor *m, BlockDeviceInfo ** obj, const char *name, Error **errp)
{
if (!error_is_set(errp)) {
Error *err = NULL;
visit_start_struct(m, (void **)obj, "BlockDeviceInfo", name, sizeof(BlockDeviceInfo), &err);
if (!err) {
if (!obj || *obj) {
visit_type_BlockDeviceInfo_fields(m, obj, &err);
error_propagate(errp, err);
err = NULL;
}
/* Always call end_struct if start_struct succeeded. */
visit_end_struct(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_BlockDeviceInfoList(Visitor *m, BlockDeviceInfoList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
BlockDeviceInfoList *native_i = (BlockDeviceInfoList *)i;
visit_type_BlockDeviceInfo(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_BlockDeviceIoStatusList(Visitor *m, BlockDeviceIoStatusList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
BlockDeviceIoStatusList *native_i = (BlockDeviceIoStatusList *)i;
visit_type_BlockDeviceIoStatus(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_BlockDeviceIoStatus(Visitor *m, BlockDeviceIoStatus * obj, const char *name, Error **errp)
{
visit_type_enum(m, (int *)obj, BlockDeviceIoStatus_lookup, "BlockDeviceIoStatus", name, errp);
}
static void visit_type_BlockDeviceMapEntry_fields(Visitor *m, BlockDeviceMapEntry ** obj, Error **errp)
{
Error *err = NULL;
visit_type_int(m, obj ? &(*obj)->start : NULL, "start", &err);
visit_type_int(m, obj ? &(*obj)->length : NULL, "length", &err);
visit_type_int(m, obj ? &(*obj)->depth : NULL, "depth", &err);
visit_type_bool(m, obj ? &(*obj)->zero : NULL, "zero", &err);
visit_type_bool(m, obj ? &(*obj)->data : NULL, "data", &err);
visit_start_optional(m, obj ? &(*obj)->has_offset : NULL, "offset", &err);
if (obj && (*obj)->has_offset) {
visit_type_int(m, obj ? &(*obj)->offset : NULL, "offset", &err);
}
visit_end_optional(m, &err);
error_propagate(errp, err);
}
void visit_type_BlockDeviceMapEntry(Visitor *m, BlockDeviceMapEntry ** obj, const char *name, Error **errp)
{
if (!error_is_set(errp)) {
Error *err = NULL;
visit_start_struct(m, (void **)obj, "BlockDeviceMapEntry", name, sizeof(BlockDeviceMapEntry), &err);
if (!err) {
if (!obj || *obj) {
visit_type_BlockDeviceMapEntry_fields(m, obj, &err);
error_propagate(errp, err);
err = NULL;
}
/* Always call end_struct if start_struct succeeded. */
visit_end_struct(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_BlockDeviceMapEntryList(Visitor *m, BlockDeviceMapEntryList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
BlockDeviceMapEntryList *native_i = (BlockDeviceMapEntryList *)i;
visit_type_BlockDeviceMapEntry(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
static void visit_type_BlockDirtyInfo_fields(Visitor *m, BlockDirtyInfo ** obj, Error **errp)
{
Error *err = NULL;
visit_type_int(m, obj ? &(*obj)->count : NULL, "count", &err);
visit_type_int(m, obj ? &(*obj)->granularity : NULL, "granularity", &err);
error_propagate(errp, err);
}
void visit_type_BlockDirtyInfo(Visitor *m, BlockDirtyInfo ** obj, const char *name, Error **errp)
{
if (!error_is_set(errp)) {
Error *err = NULL;
visit_start_struct(m, (void **)obj, "BlockDirtyInfo", name, sizeof(BlockDirtyInfo), &err);
if (!err) {
if (!obj || *obj) {
visit_type_BlockDirtyInfo_fields(m, obj, &err);
error_propagate(errp, err);
err = NULL;
}
/* Always call end_struct if start_struct succeeded. */
visit_end_struct(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_BlockDirtyInfoList(Visitor *m, BlockDirtyInfoList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
BlockDirtyInfoList *native_i = (BlockDirtyInfoList *)i;
visit_type_BlockDirtyInfo(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
static void visit_type_BlockInfo_fields(Visitor *m, BlockInfo ** obj, Error **errp)
{
Error *err = NULL;
visit_type_str(m, obj ? &(*obj)->device : NULL, "device", &err);
visit_type_str(m, obj ? &(*obj)->type : NULL, "type", &err);
visit_type_bool(m, obj ? &(*obj)->removable : NULL, "removable", &err);
visit_type_bool(m, obj ? &(*obj)->locked : NULL, "locked", &err);
visit_start_optional(m, obj ? &(*obj)->has_inserted : NULL, "inserted", &err);
if (obj && (*obj)->has_inserted) {
visit_type_BlockDeviceInfo(m, obj ? &(*obj)->inserted : NULL, "inserted", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_tray_open : NULL, "tray_open", &err);
if (obj && (*obj)->has_tray_open) {
visit_type_bool(m, obj ? &(*obj)->tray_open : NULL, "tray_open", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_io_status : NULL, "io-status", &err);
if (obj && (*obj)->has_io_status) {
visit_type_BlockDeviceIoStatus(m, obj ? &(*obj)->io_status : NULL, "io-status", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_dirty_bitmaps : NULL, "dirty-bitmaps", &err);
if (obj && (*obj)->has_dirty_bitmaps) {
visit_type_BlockDirtyInfoList(m, obj ? &(*obj)->dirty_bitmaps : NULL, "dirty-bitmaps", &err);
}
visit_end_optional(m, &err);
error_propagate(errp, err);
}
void visit_type_BlockInfo(Visitor *m, BlockInfo ** obj, const char *name, Error **errp)
{
if (!error_is_set(errp)) {
Error *err = NULL;
visit_start_struct(m, (void **)obj, "BlockInfo", name, sizeof(BlockInfo), &err);
if (!err) {
if (!obj || *obj) {
visit_type_BlockInfo_fields(m, obj, &err);
error_propagate(errp, err);
err = NULL;
}
/* Always call end_struct if start_struct succeeded. */
visit_end_struct(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_BlockInfoList(Visitor *m, BlockInfoList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
BlockInfoList *native_i = (BlockInfoList *)i;
visit_type_BlockInfo(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
static void visit_type_BlockDeviceStats_fields(Visitor *m, BlockDeviceStats ** obj, Error **errp)
{
Error *err = NULL;
visit_type_int(m, obj ? &(*obj)->rd_bytes : NULL, "rd_bytes", &err);
visit_type_int(m, obj ? &(*obj)->wr_bytes : NULL, "wr_bytes", &err);
visit_type_int(m, obj ? &(*obj)->rd_operations : NULL, "rd_operations", &err);
visit_type_int(m, obj ? &(*obj)->wr_operations : NULL, "wr_operations", &err);
visit_type_int(m, obj ? &(*obj)->flush_operations : NULL, "flush_operations", &err);
visit_type_int(m, obj ? &(*obj)->flush_total_time_ns : NULL, "flush_total_time_ns", &err);
visit_type_int(m, obj ? &(*obj)->wr_total_time_ns : NULL, "wr_total_time_ns", &err);
visit_type_int(m, obj ? &(*obj)->rd_total_time_ns : NULL, "rd_total_time_ns", &err);
visit_type_int(m, obj ? &(*obj)->wr_highest_offset : NULL, "wr_highest_offset", &err);
error_propagate(errp, err);
}
void visit_type_BlockDeviceStats(Visitor *m, BlockDeviceStats ** obj, const char *name, Error **errp)
{
if (!error_is_set(errp)) {
Error *err = NULL;
visit_start_struct(m, (void **)obj, "BlockDeviceStats", name, sizeof(BlockDeviceStats), &err);
if (!err) {
if (!obj || *obj) {
visit_type_BlockDeviceStats_fields(m, obj, &err);
error_propagate(errp, err);
err = NULL;
}
/* Always call end_struct if start_struct succeeded. */
visit_end_struct(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_BlockDeviceStatsList(Visitor *m, BlockDeviceStatsList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
BlockDeviceStatsList *native_i = (BlockDeviceStatsList *)i;
visit_type_BlockDeviceStats(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
static void visit_type_BlockStats_fields(Visitor *m, BlockStats ** obj, Error **errp)
{
Error *err = NULL;
visit_start_optional(m, obj ? &(*obj)->has_device : NULL, "device", &err);
if (obj && (*obj)->has_device) {
visit_type_str(m, obj ? &(*obj)->device : NULL, "device", &err);
}
visit_end_optional(m, &err);
visit_type_BlockDeviceStats(m, obj ? &(*obj)->stats : NULL, "stats", &err);
visit_start_optional(m, obj ? &(*obj)->has_parent : NULL, "parent", &err);
if (obj && (*obj)->has_parent) {
visit_type_BlockStats(m, obj ? &(*obj)->parent : NULL, "parent", &err);
}
visit_end_optional(m, &err);
error_propagate(errp, err);
}
void visit_type_BlockStats(Visitor *m, BlockStats ** obj, const char *name, Error **errp)
{
if (!error_is_set(errp)) {
Error *err = NULL;
visit_start_struct(m, (void **)obj, "BlockStats", name, sizeof(BlockStats), &err);
if (!err) {
if (!obj || *obj) {
visit_type_BlockStats_fields(m, obj, &err);
error_propagate(errp, err);
err = NULL;
}
/* Always call end_struct if start_struct succeeded. */
visit_end_struct(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_BlockStatsList(Visitor *m, BlockStatsList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
BlockStatsList *native_i = (BlockStatsList *)i;
visit_type_BlockStats(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
static void visit_type_VncClientInfo_fields(Visitor *m, VncClientInfo ** obj, Error **errp)
{
Error *err = NULL;
visit_type_str(m, obj ? &(*obj)->host : NULL, "host", &err);
visit_type_str(m, obj ? &(*obj)->family : NULL, "family", &err);
visit_type_str(m, obj ? &(*obj)->service : NULL, "service", &err);
visit_start_optional(m, obj ? &(*obj)->has_x509_dname : NULL, "x509_dname", &err);
if (obj && (*obj)->has_x509_dname) {
visit_type_str(m, obj ? &(*obj)->x509_dname : NULL, "x509_dname", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_sasl_username : NULL, "sasl_username", &err);
if (obj && (*obj)->has_sasl_username) {
visit_type_str(m, obj ? &(*obj)->sasl_username : NULL, "sasl_username", &err);
}
visit_end_optional(m, &err);
error_propagate(errp, err);
}
void visit_type_VncClientInfo(Visitor *m, VncClientInfo ** obj, const char *name, Error **errp)
{
if (!error_is_set(errp)) {
Error *err = NULL;
visit_start_struct(m, (void **)obj, "VncClientInfo", name, sizeof(VncClientInfo), &err);
if (!err) {
if (!obj || *obj) {
visit_type_VncClientInfo_fields(m, obj, &err);
error_propagate(errp, err);
err = NULL;
}
/* Always call end_struct if start_struct succeeded. */
visit_end_struct(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_VncClientInfoList(Visitor *m, VncClientInfoList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
VncClientInfoList *native_i = (VncClientInfoList *)i;
visit_type_VncClientInfo(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
static void visit_type_VncInfo_fields(Visitor *m, VncInfo ** obj, Error **errp)
{
Error *err = NULL;
visit_type_bool(m, obj ? &(*obj)->enabled : NULL, "enabled", &err);
visit_start_optional(m, obj ? &(*obj)->has_host : NULL, "host", &err);
if (obj && (*obj)->has_host) {
visit_type_str(m, obj ? &(*obj)->host : NULL, "host", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_family : NULL, "family", &err);
if (obj && (*obj)->has_family) {
visit_type_str(m, obj ? &(*obj)->family : NULL, "family", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_service : NULL, "service", &err);
if (obj && (*obj)->has_service) {
visit_type_str(m, obj ? &(*obj)->service : NULL, "service", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_auth : NULL, "auth", &err);
if (obj && (*obj)->has_auth) {
visit_type_str(m, obj ? &(*obj)->auth : NULL, "auth", &err);
}
visit_end_optional(m, &err);
visit_start_optional(m, obj ? &(*obj)->has_clients : NULL, "clients", &err);
if (obj && (*obj)->has_clients) {
visit_type_VncClientInfoList(m, obj ? &(*obj)->clients : NULL, "clients", &err);
}
visit_end_optional(m, &err);
error_propagate(errp, err);
}
void visit_type_VncInfo(Visitor *m, VncInfo ** obj, const char *name, Error **errp)
{
if (!error_is_set(errp)) {
Error *err = NULL;
visit_start_struct(m, (void **)obj, "VncInfo", name, sizeof(VncInfo), &err);
if (!err) {
if (!obj || *obj) {
visit_type_VncInfo_fields(m, obj, &err);
error_propagate(errp, err);
err = NULL;
}
/* Always call end_struct if start_struct succeeded. */
visit_end_struct(m, &err);
}
error_propagate(errp, err);
}
}
void visit_type_VncInfoList(Visitor *m, VncInfoList ** obj, const char *name, Error **errp)
{
GenericList *i, **prev = (GenericList **)obj;
Error *err = NULL;
if (!error_is_set(errp)) {
visit_start_list(m, name, &err);
if (!err) {
for (; (i = visit_next_list(m, prev, &err)) != NULL; prev = &i) {
VncInfoList *native_i = (VncInfoList *)i;
visit_type_VncInfo(m, &native_i->value, NULL, &err);
}
error_propagate(errp, err);
err = NULL;
/* Always call end_list if start_list succeeded. */
visit_end_list(m, &err);
}
error_propagate(errp, err);
}
}
static void visit_type_SpiceChannel_fields(Visitor *m, SpiceChannel ** obj, Error **errp)
{
Error *err = NULL;
visit_type_str(m, obj ? &(*obj)->host : NULL, "host", &err);
visit_type_str(m, obj ? &(*obj)->family : NULL, "family", &err);
visit_type_str(m, obj ? &(*obj)->port : NULL, "port", &err);
visit_type_int(m, obj ? &(*obj)->connection_id : NULL, "connection-id", &err);
visit_type_int(m, obj ? &(*obj)->channel_type : NULL, "channel-type", &err);
visit_type_int(m, obj ? &(*obj)->channel_id : NULL, "channel-id", &err);
visit_type_bool(m, obj ? &(*obj)->tls :