static int client_migrate_info(Monitor *mon, const QDict *qdict,

                               MonitorCompletion cb, void *opaque)

{

    const char *protocol = qdict_get_str(qdict, "protocol");

    const char *hostname = qdict_get_str(qdict, "hostname");

    const char *subject  = qdict_get_try_str(qdict, "cert-subject");

    int port             = qdict_get_try_int(qdict, "port", -1);

    int tls_port         = qdict_get_try_int(qdict, "tls-port", -1);

    Error *err;

    int ret;



    if (strcmp(protocol, "spice") == 0) {

        if (!qemu_using_spice(&err)) {

            qerror_report_err(err);

            return -1;

        }



        if (port == -1 && tls_port == -1) {

            qerror_report(QERR_MISSING_PARAMETER, "port/tls-port");

            return -1;

        }



        ret = qemu_spice_migrate_info(hostname, port, tls_port, subject,

                                      cb, opaque);

        if (ret != 0) {

            qerror_report(QERR_UNDEFINED_ERROR);

            return -1;

        }

        return 0;

    }



    qerror_report(QERR_INVALID_PARAMETER, "protocol");

    return -1;

}

static int client_migrate_info(Monitor *mon, const QDict *qdict,

                               MonitorCompletion cb, void *opaque)

{

    const char *protocol = qdict_get_str(qdict, "protocol");

    const char *hostname = qdict_get_str(qdict, "hostname");

    const char *subject  = qdict_get_try_str(qdict, "cert-subject");

    int port             = qdict_get_try_int(qdict, "port", -1);

    int tls_port         = qdict_get_try_int(qdict, "tls-port", -1);

    Error *err;

    int ret;



    if (strcmp(protocol, "spice") == 0) {

        if (!qemu_using_spice(&err)) {

            qerror_report_err(err);

            return -1;

        }



        if (port == -1 && tls_port == -1) {

            qerror_report(QERR_MISSING_PARAMETER, "port/tls-port");

            return -1;

        }



        ret = qemu_spice_migrate_info(hostname, port, tls_port, subject,

                                      cb, opaque);

        if (ret != 0) {

            qerror_report(QERR_UNDEFINED_ERROR);

            return -1;

        }

        return 0;

    }



    qerror_report(QERR_INVALID_PARAMETER, "protocol");

    return -1;

}

    Error *err;
static int FUNC_0(Monitor *VAR_0, const QDict *VAR_1,

                               MonitorCompletion VAR_2, void *VAR_3)

{

    const char *VAR_4 = qdict_get_str(VAR_1, "VAR_4");

    const char *VAR_5 = qdict_get_str(VAR_1, "VAR_5");

    const char *VAR_6  = qdict_get_try_str(VAR_1, "cert-VAR_6");

    int VAR_7             = qdict_get_try_int(VAR_1, "VAR_7", -1);

    int VAR_8         = qdict_get_try_int(VAR_1, "tls-VAR_7", -1);

    Error *err;

    int VAR_9;



    if (strcmp(VAR_4, "spice") == 0) {

        if (!qemu_using_spice(&err)) {

            qerror_report_err(err);

            return -1;

        }



        if (VAR_7 == -1 && VAR_8 == -1) {

            qerror_report(QERR_MISSING_PARAMETER, "VAR_7/tls-VAR_7");

            return -1;

        }



        VAR_9 = qemu_spice_migrate_info(VAR_5, VAR_7, VAR_8, VAR_6,

                                      VAR_2, VAR_3);

        if (VAR_9 != 0) {

            qerror_report(QERR_UNDEFINED_ERROR);

            return -1;

        }

        return 0;

    }



    qerror_report(QERR_INVALID_PARAMETER, "VAR_4");

    return -1;

}

static int FUNC_0(Monitor *VAR_0, const QDict *VAR_1,
MonitorCompletion VAR_2, void *VAR_3)
{ const char *VAR_4 = qdict_get_str(VAR_1, "VAR_4"); const char *VAR_5 = qdict_get_str(VAR_1, "VAR_5"); const char *VAR_6  = qdict_get_try_str(VAR_1, "cert-VAR_6"); int VAR_7             = qdict_get_try_int(VAR_1, "VAR_7", -1); int VAR_8         = qdict_get_try_int(VAR_1, "tls-VAR_7", -1); Error *err; int VAR_9; if (strcmp(VAR_4, "spice") == 0) { if (!qemu_using_spice(&err)) { qerror_report_err(err); return -1; } if (VAR_7 == -1 && VAR_8 == -1) { qerror_report(QERR_MISSING_PARAMETER, "VAR_7/tls-VAR_7"); return -1; } VAR_9 = qemu_spice_migrate_info(VAR_5, VAR_7, VAR_8, VAR_6,
VAR_2, VAR_3); if (VAR_9 != 0) { qerror_report(QERR_UNDEFINED_ERROR); return -1; } return 0; } qerror_report(QERR_INVALID_PARAMETER, "VAR_4"); return -1; }