block_crypto_open_opts_init(QCryptoBlockFormat format,

                            QemuOpts *opts,

                            Error **errp)

{

    OptsVisitor *ov;

    QCryptoBlockOpenOptions *ret = NULL;

    Error *local_err = NULL;



    ret = g_new0(QCryptoBlockOpenOptions, 1);

    ret->format = format;



    ov = opts_visitor_new(opts);



    visit_start_struct(opts_get_visitor(ov),

                       NULL, NULL, 0, &local_err);

    if (local_err) {

        goto out;

    }



    switch (format) {

    case Q_CRYPTO_BLOCK_FORMAT_LUKS:

        visit_type_QCryptoBlockOptionsLUKS_members(

            opts_get_visitor(ov), &ret->u.luks, &local_err);

        break;



    default:

        error_setg(&local_err, "Unsupported block format %d", format);

        break;

    }

    error_propagate(errp, local_err);

    local_err = NULL;



    visit_end_struct(opts_get_visitor(ov), &local_err);



 out:

    if (local_err) {

        error_propagate(errp, local_err);

        qapi_free_QCryptoBlockOpenOptions(ret);

        ret = NULL;

    }

    opts_visitor_cleanup(ov);

    return ret;

}

block_crypto_open_opts_init(QCryptoBlockFormat format,

                            QemuOpts *opts,

                            Error **errp)

{

    OptsVisitor *ov;

    QCryptoBlockOpenOptions *ret = NULL;

    Error *local_err = NULL;



    ret = g_new0(QCryptoBlockOpenOptions, 1);

    ret->format = format;



    ov = opts_visitor_new(opts);



    visit_start_struct(opts_get_visitor(ov),

                       NULL, NULL, 0, &local_err);

    if (local_err) {

        goto out;

    }



    switch (format) {

    case Q_CRYPTO_BLOCK_FORMAT_LUKS:

        visit_type_QCryptoBlockOptionsLUKS_members(

            opts_get_visitor(ov), &ret->u.luks, &local_err);

        break;



    default:

        error_setg(&local_err, "Unsupported block format %d", format);

        break;

    }

    error_propagate(errp, local_err);

    local_err = NULL;



    visit_end_struct(opts_get_visitor(ov), &local_err);



 out:

    if (local_err) {

        error_propagate(errp, local_err);

        qapi_free_QCryptoBlockOpenOptions(ret);

        ret = NULL;

    }

    opts_visitor_cleanup(ov);

    return ret;

}

    error_propagate(errp, local_err);     local_err = NULL;     visit_end_struct(opts_get_visitor(ov), &local_err);     error_propagate(errp, local_err);     local_err = NULL;     visit_end_struct(opts_get_visitor(ov), &local_err);
FUNC_0(QCryptoBlockFormat VAR_0,

                            QemuOpts *VAR_1,

                            Error **VAR_2)

{

    OptsVisitor *ov;

    QCryptoBlockOpenOptions *ret = NULL;

    Error *local_err = NULL;



    ret = g_new0(QCryptoBlockOpenOptions, 1);

    ret->VAR_0 = VAR_0;



    ov = opts_visitor_new(VAR_1);



    visit_start_struct(opts_get_visitor(ov),

                       NULL, NULL, 0, &local_err);

    if (local_err) {

        goto out;

    }



    switch (VAR_0) {

    case Q_CRYPTO_BLOCK_FORMAT_LUKS:

        visit_type_QCryptoBlockOptionsLUKS_members(

            opts_get_visitor(ov), &ret->u.luks, &local_err);

        break;



    default:

        error_setg(&local_err, "Unsupported block VAR_0 %d", VAR_0);

        break;

    }

    error_propagate(VAR_2, local_err);

    local_err = NULL;



    visit_end_struct(opts_get_visitor(ov), &local_err);



 out:

    if (local_err) {

        error_propagate(VAR_2, local_err);

        qapi_free_QCryptoBlockOpenOptions(ret);

        ret = NULL;

    }

    opts_visitor_cleanup(ov);

    return ret;

}

FUNC_0(QCryptoBlockFormat VAR_0,
QemuOpts *VAR_1,
Error **VAR_2)
{ OptsVisitor *ov; QCryptoBlockOpenOptions *ret = NULL; Error *local_err = NULL; ret = g_new0(QCryptoBlockOpenOptions, 1); ret->VAR_0 = VAR_0; ov = opts_visitor_new(VAR_1); visit_start_struct(opts_get_visitor(ov),
NULL, NULL, 0, &local_err); if (local_err) { goto out; } switch (VAR_0) { case Q_CRYPTO_BLOCK_FORMAT_LUKS:
visit_type_QCryptoBlockOptionsLUKS_members(
opts_get_visitor(ov), &ret->u.luks, &local_err); break; default:
error_setg(&local_err, "Unsupported block VAR_0 %d", VAR_0); break; } error_propagate(VAR_2, local_err); local_err = NULL; visit_end_struct(opts_get_visitor(ov), &local_err); out:
if (local_err) { error_propagate(VAR_2, local_err); qapi_free_QCryptoBlockOpenOptions(ret); ret = NULL; } opts_visitor_cleanup(ov); return ret; }