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-misc.h" |
16 | #include "qapi-visit-misc.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 | |
23 | void qapi_event_send_balloon_change(int64_t actual) |
24 | { |
25 | QDict *qmp; |
26 | QObject *obj; |
27 | Visitor *v; |
28 | q_obj_BALLOON_CHANGE_arg param = { |
29 | actual |
30 | }; |
31 | |
32 | qmp = qmp_event_build_dict("BALLOON_CHANGE" ); |
33 | |
34 | v = qobject_output_visitor_new(&obj); |
35 | |
36 | visit_start_struct(v, "BALLOON_CHANGE" , NULL, 0, &error_abort); |
37 | visit_type_q_obj_BALLOON_CHANGE_arg_members(v, ¶m, &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_BALLOON_CHANGE, qmp); |
44 | |
45 | visit_free(v); |
46 | qobject_unref(qmp); |
47 | } |
48 | |
49 | void qapi_event_send_mem_unplug_error(const char *device, const char *msg) |
50 | { |
51 | QDict *qmp; |
52 | QObject *obj; |
53 | Visitor *v; |
54 | q_obj_MEM_UNPLUG_ERROR_arg param = { |
55 | (char *)device, (char *)msg |
56 | }; |
57 | |
58 | qmp = qmp_event_build_dict("MEM_UNPLUG_ERROR" ); |
59 | |
60 | v = qobject_output_visitor_new(&obj); |
61 | |
62 | visit_start_struct(v, "MEM_UNPLUG_ERROR" , NULL, 0, &error_abort); |
63 | visit_type_q_obj_MEM_UNPLUG_ERROR_arg_members(v, ¶m, &error_abort); |
64 | visit_check_struct(v, &error_abort); |
65 | visit_end_struct(v, NULL); |
66 | |
67 | visit_complete(v, &obj); |
68 | qdict_put_obj(qmp, "data" , obj); |
69 | qapi_event_emit(QAPI_EVENT_MEM_UNPLUG_ERROR, qmp); |
70 | |
71 | visit_free(v); |
72 | qobject_unref(qmp); |
73 | } |
74 | |
75 | void qapi_event_send_acpi_device_ost(ACPIOSTInfo *info) |
76 | { |
77 | QDict *qmp; |
78 | QObject *obj; |
79 | Visitor *v; |
80 | q_obj_ACPI_DEVICE_OST_arg param = { |
81 | info |
82 | }; |
83 | |
84 | qmp = qmp_event_build_dict("ACPI_DEVICE_OST" ); |
85 | |
86 | v = qobject_output_visitor_new(&obj); |
87 | |
88 | visit_start_struct(v, "ACPI_DEVICE_OST" , NULL, 0, &error_abort); |
89 | visit_type_q_obj_ACPI_DEVICE_OST_arg_members(v, ¶m, &error_abort); |
90 | visit_check_struct(v, &error_abort); |
91 | visit_end_struct(v, NULL); |
92 | |
93 | visit_complete(v, &obj); |
94 | qdict_put_obj(qmp, "data" , obj); |
95 | qapi_event_emit(QAPI_EVENT_ACPI_DEVICE_OST, qmp); |
96 | |
97 | visit_free(v); |
98 | qobject_unref(qmp); |
99 | } |
100 | |
101 | /* Dummy declaration to prevent empty .o file */ |
102 | char qapi_dummy_qapi_events_misc_c; |
103 | |