blob: bbd7195d661015cb8efc4f0949fb481446acdf12 [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-run-state.h"
#include "qapi-commands-run-state.h"
static void qmp_marshal_output_StatusInfo(StatusInfo *ret_in, QObject **ret_out, Error **errp)
{
Error *err = NULL;
Visitor *v;
v = qobject_output_visitor_new(ret_out);
visit_type_StatusInfo(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_StatusInfo(v, "unused", &ret_in, NULL);
visit_free(v);
}
void qmp_marshal_query_status(QDict *args, QObject **ret, Error **errp)
{
Error *err = NULL;
StatusInfo *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_status(&err);
if (err) {
goto out;
}
qmp_marshal_output_StatusInfo(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);
}
}
void qmp_marshal_watchdog_set_action(QDict *args, QObject **ret, Error **errp)
{
Error *err = NULL;
Visitor *v;
q_obj_watchdog_set_action_arg arg = {0};
v = qobject_input_visitor_new(QOBJECT(args));
visit_start_struct(v, NULL, NULL, 0, &err);
if (err) {
goto out;
}
visit_type_q_obj_watchdog_set_action_arg_members(v, &arg, &err);
if (!err) {
visit_check_struct(v, &err);
}
visit_end_struct(v, NULL);
if (err) {
goto out;
}
qmp_watchdog_set_action(arg.action, &err);
out:
error_propagate(errp, err);
visit_free(v);
v = qapi_dealloc_visitor_new();
visit_start_struct(v, NULL, NULL, 0, NULL);
visit_type_q_obj_watchdog_set_action_arg_members(v, &arg, NULL);
visit_end_struct(v, NULL);
visit_free(v);
}
/* Dummy declaration to prevent empty .o file */
char dummy_qapi_commands_run_state_c;