/src/qemu/build-oss-fuzz/qapi/qapi-events-char.c
Line | Count | Source |
1 | | /* AUTOMATICALLY GENERATED by qapi-gen.py 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-char.h" |
16 | | #include "qapi-visit-char.h" |
17 | | #include "qapi/compat-policy.h" |
18 | | #include "qapi/error.h" |
19 | | #include "qobject/qdict.h" |
20 | | #include "qapi/qmp-event.h" |
21 | | |
22 | | void qapi_event_send_vserport_change(const char *id, bool open) |
23 | 0 | { |
24 | 0 | QDict *qmp; |
25 | 0 | QObject *obj; |
26 | 0 | Visitor *v; |
27 | 0 | q_obj_VSERPORT_CHANGE_arg param = { |
28 | 0 | (char *)id, open |
29 | 0 | }; |
30 | |
|
31 | 0 | qmp = qmp_event_build_dict("VSERPORT_CHANGE"); |
32 | |
|
33 | 0 | v = qobject_output_visitor_new_qmp(&obj); |
34 | |
|
35 | 0 | visit_start_struct(v, "VSERPORT_CHANGE", NULL, 0, &error_abort); |
36 | 0 | visit_type_q_obj_VSERPORT_CHANGE_arg_members(v, ¶m, &error_abort); |
37 | 0 | visit_check_struct(v, &error_abort); |
38 | 0 | visit_end_struct(v, NULL); |
39 | |
|
40 | 0 | visit_complete(v, &obj); |
41 | 0 | if (qdict_size(qobject_to(QDict, obj))) { |
42 | 0 | qdict_put_obj(qmp, "data", obj); |
43 | 0 | } else { |
44 | 0 | qobject_unref(obj); |
45 | 0 | } |
46 | 0 | qapi_event_emit(QAPI_EVENT_VSERPORT_CHANGE, qmp); |
47 | |
|
48 | 0 | visit_free(v); |
49 | | qobject_unref(qmp); |
50 | 0 | } |
51 | | |
52 | | /* Dummy declaration to prevent empty .o file */ |
53 | | char qapi_dummy_qapi_events_char_c; |