1/* AUTOMATICALLY GENERATED, DO NOT MODIFY */
2
3/*
4 * Schema-defined QAPI/QMP events
5 *
6 * Copyright (c) 2014 Wenchao Xia
7 * Copyright (c) 2015-2018 Red Hat Inc.
8 *
9 * This work is licensed under the terms of the GNU LGPL, version 2.1 or later.
10 * See the COPYING.LIB file in the top-level directory.
11 */
12
13#include "qemu/osdep.h"
14#include "qapi-emit-events.h"
15#include "qapi-events-job.h"
16#include "qapi-visit-job.h"
17#include "qapi/error.h"
18#include "qapi/qmp/qdict.h"
19#include "qapi/qobject-output-visitor.h"
20#include "qapi/qmp-event.h"
21
22
23void qapi_event_send_job_status_change(const char *id, JobStatus status)
24{
25 QDict *qmp;
26 QObject *obj;
27 Visitor *v;
28 q_obj_JOB_STATUS_CHANGE_arg param = {
29 (char *)id, status
30 };
31
32 qmp = qmp_event_build_dict("JOB_STATUS_CHANGE");
33
34 v = qobject_output_visitor_new(&obj);
35
36 visit_start_struct(v, "JOB_STATUS_CHANGE", NULL, 0, &error_abort);
37 visit_type_q_obj_JOB_STATUS_CHANGE_arg_members(v, &param, &error_abort);
38 visit_check_struct(v, &error_abort);
39 visit_end_struct(v, NULL);
40
41 visit_complete(v, &obj);
42 qdict_put_obj(qmp, "data", obj);
43 qapi_event_emit(QAPI_EVENT_JOB_STATUS_CHANGE, qmp);
44
45 visit_free(v);
46 qobject_unref(qmp);
47}
48
49/* Dummy declaration to prevent empty .o file */
50char qapi_dummy_qapi_events_job_c;
51