blob: eb6412bc26eb1a72a116638f74cff3bf946aa66e [file] [log] [blame]
/* AUTOMATICALLY GENERATED, DO NOT MODIFY */
/*
* Schema-defined QAPI/QMP commands
*
* Copyright IBM, Corp. 2011
* Copyright (C) 2014-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 "qemu-common.h"
#include "qemu/module.h"
#include "qapi/visitor.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qobject-output-visitor.h"
#include "qapi/qobject-input-visitor.h"
#include "qapi/dealloc-visitor.h"
#include "qapi/error.h"
#include "qapi-visit-tpm.h"
#include "qapi-commands-tpm.h"
static void qmp_marshal_output_TpmModelList(TpmModelList *ret_in, QObject **ret_out, Error **errp)
{
Error *err = NULL;
Visitor *v;
v = qobject_output_visitor_new(ret_out);
visit_type_TpmModelList(v, "unused", &ret_in, &err);
if (!err) {
visit_complete(v, ret_out);
}
error_propagate(errp, err);
visit_free(v);
v = qapi_dealloc_visitor_new();
visit_type_TpmModelList(v, "unused", &ret_in, NULL);
visit_free(v);
}
void qmp_marshal_query_tpm_models(QDict *args, QObject **ret, Error **errp)
{
Error *err = NULL;
TpmModelList *retval;
Visitor *v = NULL;
if (args) {
v = qobject_input_visitor_new(QOBJECT(args));
visit_start_struct(v, NULL, NULL, 0, &err);
if (err) {
goto out;
}
if (!err) {
visit_check_struct(v, &err);
}
visit_end_struct(v, NULL);
if (err) {
goto out;
}
}
retval = qmp_query_tpm_models(&err);
if (err) {
goto out;
}
qmp_marshal_output_TpmModelList(retval, ret, &err);
out:
error_propagate(errp, err);
visit_free(v);
if (args) {
v = qapi_dealloc_visitor_new();
visit_start_struct(v, NULL, NULL, 0, NULL);
visit_end_struct(v, NULL);
visit_free(v);
}
}
static void qmp_marshal_output_TpmTypeList(TpmTypeList *ret_in, QObject **ret_out, Error **errp)
{
Error *err = NULL;
Visitor *v;
v = qobject_output_visitor_new(ret_out);
visit_type_TpmTypeList(v, "unused", &ret_in, &err);
if (!err) {
visit_complete(v, ret_out);
}
error_propagate(errp, err);
visit_free(v);
v = qapi_dealloc_visitor_new();
visit_type_TpmTypeList(v, "unused", &ret_in, NULL);
visit_free(v);
}
void qmp_marshal_query_tpm_types(QDict *args, QObject **ret, Error **errp)
{
Error *err = NULL;
TpmTypeList *retval;
Visitor *v = NULL;
if (args) {
v = qobject_input_visitor_new(QOBJECT(args));
visit_start_struct(v, NULL, NULL, 0, &err);
if (err) {
goto out;
}
if (!err) {
visit_check_struct(v, &err);
}
visit_end_struct(v, NULL);
if (err) {
goto out;
}
}
retval = qmp_query_tpm_types(&err);
if (err) {
goto out;
}
qmp_marshal_output_TpmTypeList(retval, ret, &err);
out:
error_propagate(errp, err);
visit_free(v);
if (args) {
v = qapi_dealloc_visitor_new();
visit_start_struct(v, NULL, NULL, 0, NULL);
visit_end_struct(v, NULL);
visit_free(v);
}
}
static void qmp_marshal_output_TPMInfoList(TPMInfoList *ret_in, QObject **ret_out, Error **errp)
{
Error *err = NULL;
Visitor *v;
v = qobject_output_visitor_new(ret_out);
visit_type_TPMInfoList(v, "unused", &ret_in, &err);
if (!err) {
visit_complete(v, ret_out);
}
error_propagate(errp, err);
visit_free(v);
v = qapi_dealloc_visitor_new();
visit_type_TPMInfoList(v, "unused", &ret_in, NULL);
visit_free(v);
}
void qmp_marshal_query_tpm(QDict *args, QObject **ret, Error **errp)
{
Error *err = NULL;
TPMInfoList *retval;
Visitor *v = NULL;
if (args) {
v = qobject_input_visitor_new(QOBJECT(args));
visit_start_struct(v, NULL, NULL, 0, &err);
if (err) {
goto out;
}
if (!err) {
visit_check_struct(v, &err);
}
visit_end_struct(v, NULL);
if (err) {
goto out;
}
}
retval = qmp_query_tpm(&err);
if (err) {
goto out;
}
qmp_marshal_output_TPMInfoList(retval, ret, &err);
out:
error_propagate(errp, err);
visit_free(v);
if (args) {
v = qapi_dealloc_visitor_new();
visit_start_struct(v, NULL, NULL, 0, NULL);
visit_end_struct(v, NULL);
visit_free(v);
}
}
/* Dummy declaration to prevent empty .o file */
char dummy_qapi_commands_tpm_c;