/* AUTOMATICALLY GENERATED by qapi-gen.py DO NOT MODIFY */

/*
 * Schema-defined QAPI types
 *
 * Copyright IBM, Corp. 2011
 * Copyright (c) 2013-2018 Red Hat Inc.
 *
 * 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/osdep.h"
#include "qapi/dealloc-visitor.h"
#include "qapi-types-migration.h"
#include "qapi-visit-migration.h"

void qapi_free_MigrationStats(MigrationStats *obj)
{
    Visitor *v;

    if (!obj) {
        return;
    }

    v = qapi_dealloc_visitor_new();
    visit_type_MigrationStats(v, NULL, &obj, NULL);
    visit_free(v);
}

void qapi_free_XBZRLECacheStats(XBZRLECacheStats *obj)
{
    Visitor *v;

    if (!obj) {
        return;
    }

    v = qapi_dealloc_visitor_new();
    visit_type_XBZRLECacheStats(v, NULL, &obj, NULL);
    visit_free(v);
}

void qapi_free_CompressionStats(CompressionStats *obj)
{
    Visitor *v;

    if (!obj) {
        return;
    }

    v = qapi_dealloc_visitor_new();
    visit_type_CompressionStats(v, NULL, &obj, NULL);
    visit_free(v);
}

const QEnumLookup MigrationStatus_lookup = {
    .array = (const char *const[]) {
        [MIGRATION_STATUS_NONE] = "none",
        [MIGRATION_STATUS_SETUP] = "setup",
        [MIGRATION_STATUS_CANCELLING] = "cancelling",
        [MIGRATION_STATUS_CANCELLED] = "cancelled",
        [MIGRATION_STATUS_ACTIVE] = "active",
        [MIGRATION_STATUS_POSTCOPY_ACTIVE] = "postcopy-active",
        [MIGRATION_STATUS_POSTCOPY_PAUSED] = "postcopy-paused",
        [MIGRATION_STATUS_POSTCOPY_RECOVER_SETUP] = "postcopy-recover-setup",
        [MIGRATION_STATUS_POSTCOPY_RECOVER] = "postcopy-recover",
        [MIGRATION_STATUS_COMPLETED] = "completed",
        [MIGRATION_STATUS_FAILED] = "failed",
        [MIGRATION_STATUS_COLO] = "colo",
        [MIGRATION_STATUS_PRE_SWITCHOVER] = "pre-switchover",
        [MIGRATION_STATUS_DEVICE] = "device",
        [MIGRATION_STATUS_WAIT_UNPLUG] = "wait-unplug",
    },
    .size = MIGRATION_STATUS__MAX
};

void qapi_free_VfioStats(VfioStats *obj)
{
    Visitor *v;

    if (!obj) {
        return;
    }

    v = qapi_dealloc_visitor_new();
    visit_type_VfioStats(v, NULL, &obj, NULL);
    visit_free(v);
}

void qapi_free_MigrationInfo(MigrationInfo *obj)
{
    Visitor *v;

    if (!obj) {
        return;
    }

    v = qapi_dealloc_visitor_new();
    visit_type_MigrationInfo(v, NULL, &obj, NULL);
    visit_free(v);
}

const QEnumLookup MigrationCapability_lookup = {
    .array = (const char *const[]) {
        [MIGRATION_CAPABILITY_XBZRLE] = "xbzrle",
        [MIGRATION_CAPABILITY_RDMA_PIN_ALL] = "rdma-pin-all",
        [MIGRATION_CAPABILITY_AUTO_CONVERGE] = "auto-converge",
        [MIGRATION_CAPABILITY_ZERO_BLOCKS] = "zero-blocks",
        [MIGRATION_CAPABILITY_EVENTS] = "events",
        [MIGRATION_CAPABILITY_POSTCOPY_RAM] = "postcopy-ram",
        [MIGRATION_CAPABILITY_X_COLO] = "x-colo",
        [MIGRATION_CAPABILITY_RELEASE_RAM] = "release-ram",
        [MIGRATION_CAPABILITY_RETURN_PATH] = "return-path",
        [MIGRATION_CAPABILITY_PAUSE_BEFORE_SWITCHOVER] = "pause-before-switchover",
        [MIGRATION_CAPABILITY_MULTIFD] = "multifd",
        [MIGRATION_CAPABILITY_DIRTY_BITMAPS] = "dirty-bitmaps",
        [MIGRATION_CAPABILITY_POSTCOPY_BLOCKTIME] = "postcopy-blocktime",
        [MIGRATION_CAPABILITY_LATE_BLOCK_ACTIVATE] = "late-block-activate",
        [MIGRATION_CAPABILITY_X_IGNORE_SHARED] = "x-ignore-shared",
        [MIGRATION_CAPABILITY_VALIDATE_UUID] = "validate-uuid",
        [MIGRATION_CAPABILITY_BACKGROUND_SNAPSHOT] = "background-snapshot",
        [MIGRATION_CAPABILITY_ZERO_COPY_SEND] = "zero-copy-send",
        [MIGRATION_CAPABILITY_POSTCOPY_PREEMPT] = "postcopy-preempt",
        [MIGRATION_CAPABILITY_SWITCHOVER_ACK] = "switchover-ack",
        [MIGRATION_CAPABILITY_DIRTY_LIMIT] = "dirty-limit",
        [MIGRATION_CAPABILITY_MAPPED_RAM] = "mapped-ram",
    },
    .special_features = (const unsigned char[MIGRATION_CAPABILITY__MAX]) {
        [MIGRATION_CAPABILITY_ZERO_BLOCKS] = 1u << QAPI_DEPRECATED,
        [MIGRATION_CAPABILITY_X_COLO] = 1u << QAPI_UNSTABLE,
        [MIGRATION_CAPABILITY_X_IGNORE_SHARED] = 1u << QAPI_UNSTABLE,
    },
    .size = MIGRATION_CAPABILITY__MAX
};

void qapi_free_MigrationCapabilityStatus(MigrationCapabilityStatus *obj)
{
    Visitor *v;

    if (!obj) {
        return;
    }

    v = qapi_dealloc_visitor_new();
    visit_type_MigrationCapabilityStatus(v, NULL, &obj, NULL);
    visit_free(v);
}

void qapi_free_MigrationCapabilityStatusList(MigrationCapabilityStatusList *obj)
{
    Visitor *v;

    if (!obj) {
        return;
    }

    v = qapi_dealloc_visitor_new();
    visit_type_MigrationCapabilityStatusList(v, NULL, &obj, NULL);
    visit_free(v);
}

const QEnumLookup MultiFDCompression_lookup = {
    .array = (const char *const[]) {
        [MULTIFD_COMPRESSION_NONE] = "none",
        [MULTIFD_COMPRESSION_ZLIB] = "zlib",
#if defined(CONFIG_ZSTD)
        [MULTIFD_COMPRESSION_ZSTD] = "zstd",
#endif /* defined(CONFIG_ZSTD) */
#if defined(CONFIG_QATZIP)
        [MULTIFD_COMPRESSION_QATZIP] = "qatzip",
#endif /* defined(CONFIG_QATZIP) */
#if defined(CONFIG_QPL)
        [MULTIFD_COMPRESSION_QPL] = "qpl",
#endif /* defined(CONFIG_QPL) */
#if defined(CONFIG_UADK)
        [MULTIFD_COMPRESSION_UADK] = "uadk",
#endif /* defined(CONFIG_UADK) */
    },
    .size = MULTIFD_COMPRESSION__MAX
};

const QEnumLookup MigMode_lookup = {
    .array = (const char *const[]) {
        [MIG_MODE_NORMAL] = "normal",
        [MIG_MODE_CPR_REBOOT] = "cpr-reboot",
    },
    .size = MIG_MODE__MAX
};

const QEnumLookup ZeroPageDetection_lookup = {
    .array = (const char *const[]) {
        [ZERO_PAGE_DETECTION_NONE] = "none",
        [ZERO_PAGE_DETECTION_LEGACY] = "legacy",
        [ZERO_PAGE_DETECTION_MULTIFD] = "multifd",
    },
    .size = ZERO_PAGE_DETECTION__MAX
};

void qapi_free_BitmapMigrationBitmapAliasTransform(BitmapMigrationBitmapAliasTransform *obj)
{
    Visitor *v;

    if (!obj) {
        return;
    }

    v = qapi_dealloc_visitor_new();
    visit_type_BitmapMigrationBitmapAliasTransform(v, NULL, &obj, NULL);
    visit_free(v);
}

void qapi_free_BitmapMigrationBitmapAlias(BitmapMigrationBitmapAlias *obj)
{
    Visitor *v;

    if (!obj) {
        return;
    }

    v = qapi_dealloc_visitor_new();
    visit_type_BitmapMigrationBitmapAlias(v, NULL, &obj, NULL);
    visit_free(v);
}

void qapi_free_BitmapMigrationBitmapAliasList(BitmapMigrationBitmapAliasList *obj)
{
    Visitor *v;

    if (!obj) {
        return;
    }

    v = qapi_dealloc_visitor_new();
    visit_type_BitmapMigrationBitmapAliasList(v, NULL, &obj, NULL);
    visit_free(v);
}

void qapi_free_BitmapMigrationNodeAlias(BitmapMigrationNodeAlias *obj)
{
    Visitor *v;

    if (!obj) {
        return;
    }

    v = qapi_dealloc_visitor_new();
    visit_type_BitmapMigrationNodeAlias(v, NULL, &obj, NULL);
    visit_free(v);
}

const QEnumLookup MigrationParameter_lookup = {
    .array = (const char *const[]) {
        [MIGRATION_PARAMETER_ANNOUNCE_INITIAL] = "announce-initial",
        [MIGRATION_PARAMETER_ANNOUNCE_MAX] = "announce-max",
        [MIGRATION_PARAMETER_ANNOUNCE_ROUNDS] = "announce-rounds",
        [MIGRATION_PARAMETER_ANNOUNCE_STEP] = "announce-step",
        [MIGRATION_PARAMETER_THROTTLE_TRIGGER_THRESHOLD] = "throttle-trigger-threshold",
        [MIGRATION_PARAMETER_CPU_THROTTLE_INITIAL] = "cpu-throttle-initial",
        [MIGRATION_PARAMETER_CPU_THROTTLE_INCREMENT] = "cpu-throttle-increment",
        [MIGRATION_PARAMETER_CPU_THROTTLE_TAILSLOW] = "cpu-throttle-tailslow",
        [MIGRATION_PARAMETER_TLS_CREDS] = "tls-creds",
        [MIGRATION_PARAMETER_TLS_HOSTNAME] = "tls-hostname",
        [MIGRATION_PARAMETER_TLS_AUTHZ] = "tls-authz",
        [MIGRATION_PARAMETER_MAX_BANDWIDTH] = "max-bandwidth",
        [MIGRATION_PARAMETER_AVAIL_SWITCHOVER_BANDWIDTH] = "avail-switchover-bandwidth",
        [MIGRATION_PARAMETER_DOWNTIME_LIMIT] = "downtime-limit",
        [MIGRATION_PARAMETER_X_CHECKPOINT_DELAY] = "x-checkpoint-delay",
        [MIGRATION_PARAMETER_MULTIFD_CHANNELS] = "multifd-channels",
        [MIGRATION_PARAMETER_XBZRLE_CACHE_SIZE] = "xbzrle-cache-size",
        [MIGRATION_PARAMETER_MAX_POSTCOPY_BANDWIDTH] = "max-postcopy-bandwidth",
        [MIGRATION_PARAMETER_MAX_CPU_THROTTLE] = "max-cpu-throttle",
        [MIGRATION_PARAMETER_MULTIFD_COMPRESSION] = "multifd-compression",
        [MIGRATION_PARAMETER_MULTIFD_ZLIB_LEVEL] = "multifd-zlib-level",
        [MIGRATION_PARAMETER_MULTIFD_ZSTD_LEVEL] = "multifd-zstd-level",
        [MIGRATION_PARAMETER_MULTIFD_QATZIP_LEVEL] = "multifd-qatzip-level",
        [MIGRATION_PARAMETER_BLOCK_BITMAP_MAPPING] = "block-bitmap-mapping",
        [MIGRATION_PARAMETER_X_VCPU_DIRTY_LIMIT_PERIOD] = "x-vcpu-dirty-limit-period",
        [MIGRATION_PARAMETER_VCPU_DIRTY_LIMIT] = "vcpu-dirty-limit",
        [MIGRATION_PARAMETER_MODE] = "mode",
        [MIGRATION_PARAMETER_ZERO_PAGE_DETECTION] = "zero-page-detection",
        [MIGRATION_PARAMETER_DIRECT_IO] = "direct-io",
    },
    .special_features = (const unsigned char[MIGRATION_PARAMETER__MAX]) {
        [MIGRATION_PARAMETER_X_CHECKPOINT_DELAY] = 1u << QAPI_UNSTABLE,
        [MIGRATION_PARAMETER_X_VCPU_DIRTY_LIMIT_PERIOD] = 1u << QAPI_UNSTABLE,
    },
    .size = MIGRATION_PARAMETER__MAX
};

void qapi_free_BitmapMigrationNodeAliasList(BitmapMigrationNodeAliasList *obj)
{
    Visitor *v;

    if (!obj) {
        return;
    }

    v = qapi_dealloc_visitor_new();
    visit_type_BitmapMigrationNodeAliasList(v, NULL, &obj, NULL);
    visit_free(v);
}

void qapi_free_MigrateSetParameters(MigrateSetParameters *obj)
{
    Visitor *v;

    if (!obj) {
        return;
    }

    v = qapi_dealloc_visitor_new();
    visit_type_MigrateSetParameters(v, NULL, &obj, NULL);
    visit_free(v);
}

void qapi_free_MigrationParameters(MigrationParameters *obj)
{
    Visitor *v;

    if (!obj) {
        return;
    }

    v = qapi_dealloc_visitor_new();
    visit_type_MigrationParameters(v, NULL, &obj, NULL);
    visit_free(v);
}

const QEnumLookup COLOMessage_lookup = {
    .array = (const char *const[]) {
        [COLO_MESSAGE_CHECKPOINT_READY] = "checkpoint-ready",
        [COLO_MESSAGE_CHECKPOINT_REQUEST] = "checkpoint-request",
        [COLO_MESSAGE_CHECKPOINT_REPLY] = "checkpoint-reply",
        [COLO_MESSAGE_VMSTATE_SEND] = "vmstate-send",
        [COLO_MESSAGE_VMSTATE_SIZE] = "vmstate-size",
        [COLO_MESSAGE_VMSTATE_RECEIVED] = "vmstate-received",
        [COLO_MESSAGE_VMSTATE_LOADED] = "vmstate-loaded",
    },
    .size = COLO_MESSAGE__MAX
};

const QEnumLookup COLOMode_lookup = {
    .array = (const char *const[]) {
        [COLO_MODE_NONE] = "none",
        [COLO_MODE_PRIMARY] = "primary",
        [COLO_MODE_SECONDARY] = "secondary",
    },
    .size = COLO_MODE__MAX
};

const QEnumLookup FailoverStatus_lookup = {
    .array = (const char *const[]) {
        [FAILOVER_STATUS_NONE] = "none",
        [FAILOVER_STATUS_REQUIRE] = "require",
        [FAILOVER_STATUS_ACTIVE] = "active",
        [FAILOVER_STATUS_COMPLETED] = "completed",
        [FAILOVER_STATUS_RELAUNCH] = "relaunch",
    },
    .size = FAILOVER_STATUS__MAX
};

const QEnumLookup COLOExitReason_lookup = {
    .array = (const char *const[]) {
        [COLO_EXIT_REASON_NONE] = "none",
        [COLO_EXIT_REASON_REQUEST] = "request",
        [COLO_EXIT_REASON_ERROR] = "error",
        [COLO_EXIT_REASON_PROCESSING] = "processing",
    },
    .size = COLO_EXIT_REASON__MAX
};

const QEnumLookup MigrationAddressType_lookup = {
    .array = (const char *const[]) {
        [MIGRATION_ADDRESS_TYPE_SOCKET] = "socket",
        [MIGRATION_ADDRESS_TYPE_EXEC] = "exec",
        [MIGRATION_ADDRESS_TYPE_RDMA] = "rdma",
        [MIGRATION_ADDRESS_TYPE_FILE] = "file",
    },
    .size = MIGRATION_ADDRESS_TYPE__MAX
};

void qapi_free_FileMigrationArgs(FileMigrationArgs *obj)
{
    Visitor *v;

    if (!obj) {
        return;
    }

    v = qapi_dealloc_visitor_new();
    visit_type_FileMigrationArgs(v, NULL, &obj, NULL);
    visit_free(v);
}

void qapi_free_MigrationExecCommand(MigrationExecCommand *obj)
{
    Visitor *v;

    if (!obj) {
        return;
    }

    v = qapi_dealloc_visitor_new();
    visit_type_MigrationExecCommand(v, NULL, &obj, NULL);
    visit_free(v);
}

void qapi_free_MigrationAddress(MigrationAddress *obj)
{
    Visitor *v;

    if (!obj) {
        return;
    }

    v = qapi_dealloc_visitor_new();
    visit_type_MigrationAddress(v, NULL, &obj, NULL);
    visit_free(v);
}

const QEnumLookup MigrationChannelType_lookup = {
    .array = (const char *const[]) {
        [MIGRATION_CHANNEL_TYPE_MAIN] = "main",
    },
    .size = MIGRATION_CHANNEL_TYPE__MAX
};

void qapi_free_MigrationChannel(MigrationChannel *obj)
{
    Visitor *v;

    if (!obj) {
        return;
    }

    v = qapi_dealloc_visitor_new();
    visit_type_MigrationChannel(v, NULL, &obj, NULL);
    visit_free(v);
}

void qapi_free_MigrationChannelList(MigrationChannelList *obj)
{
    Visitor *v;

    if (!obj) {
        return;
    }

    v = qapi_dealloc_visitor_new();
    visit_type_MigrationChannelList(v, NULL, &obj, NULL);
    visit_free(v);
}

#if defined(CONFIG_REPLICATION)
void qapi_free_ReplicationStatus(ReplicationStatus *obj)
{
    Visitor *v;

    if (!obj) {
        return;
    }

    v = qapi_dealloc_visitor_new();
    visit_type_ReplicationStatus(v, NULL, &obj, NULL);
    visit_free(v);
}
#endif /* defined(CONFIG_REPLICATION) */

#if defined(CONFIG_REPLICATION)
void qapi_free_COLOStatus(COLOStatus *obj)
{
    Visitor *v;

    if (!obj) {
        return;
    }

    v = qapi_dealloc_visitor_new();
    visit_type_COLOStatus(v, NULL, &obj, NULL);
    visit_free(v);
}
#endif /* defined(CONFIG_REPLICATION) */

void qapi_free_DirtyRateVcpu(DirtyRateVcpu *obj)
{
    Visitor *v;

    if (!obj) {
        return;
    }

    v = qapi_dealloc_visitor_new();
    visit_type_DirtyRateVcpu(v, NULL, &obj, NULL);
    visit_free(v);
}

const QEnumLookup DirtyRateStatus_lookup = {
    .array = (const char *const[]) {
        [DIRTY_RATE_STATUS_UNSTARTED] = "unstarted",
        [DIRTY_RATE_STATUS_MEASURING] = "measuring",
        [DIRTY_RATE_STATUS_MEASURED] = "measured",
    },
    .size = DIRTY_RATE_STATUS__MAX
};

const QEnumLookup DirtyRateMeasureMode_lookup = {
    .array = (const char *const[]) {
        [DIRTY_RATE_MEASURE_MODE_PAGE_SAMPLING] = "page-sampling",
        [DIRTY_RATE_MEASURE_MODE_DIRTY_RING] = "dirty-ring",
        [DIRTY_RATE_MEASURE_MODE_DIRTY_BITMAP] = "dirty-bitmap",
    },
    .size = DIRTY_RATE_MEASURE_MODE__MAX
};

const QEnumLookup TimeUnit_lookup = {
    .array = (const char *const[]) {
        [TIME_UNIT_SECOND] = "second",
        [TIME_UNIT_MILLISECOND] = "millisecond",
    },
    .size = TIME_UNIT__MAX
};

void qapi_free_DirtyRateVcpuList(DirtyRateVcpuList *obj)
{
    Visitor *v;

    if (!obj) {
        return;
    }

    v = qapi_dealloc_visitor_new();
    visit_type_DirtyRateVcpuList(v, NULL, &obj, NULL);
    visit_free(v);
}

void qapi_free_DirtyRateInfo(DirtyRateInfo *obj)
{
    Visitor *v;

    if (!obj) {
        return;
    }

    v = qapi_dealloc_visitor_new();
    visit_type_DirtyRateInfo(v, NULL, &obj, NULL);
    visit_free(v);
}

void qapi_free_DirtyLimitInfo(DirtyLimitInfo *obj)
{
    Visitor *v;

    if (!obj) {
        return;
    }

    v = qapi_dealloc_visitor_new();
    visit_type_DirtyLimitInfo(v, NULL, &obj, NULL);
    visit_free(v);
}

void qapi_free_DirtyLimitInfoList(DirtyLimitInfoList *obj)
{
    Visitor *v;

    if (!obj) {
        return;
    }

    v = qapi_dealloc_visitor_new();
    visit_type_DirtyLimitInfoList(v, NULL, &obj, NULL);
    visit_free(v);
}

void qapi_free_MigrationThreadInfo(MigrationThreadInfo *obj)
{
    Visitor *v;

    if (!obj) {
        return;
    }

    v = qapi_dealloc_visitor_new();
    visit_type_MigrationThreadInfo(v, NULL, &obj, NULL);
    visit_free(v);
}

void qapi_free_MigrationThreadInfoList(MigrationThreadInfoList *obj)
{
    Visitor *v;

    if (!obj) {
        return;
    }

    v = qapi_dealloc_visitor_new();
    visit_type_MigrationThreadInfoList(v, NULL, &obj, NULL);
    visit_free(v);
}

/* Dummy declaration to prevent empty .o file */
char qapi_dummy_qapi_types_migration_c;
