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-dump.h" |
16 | #include "qapi-visit-dump.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_dump_completed(DumpQueryResult *result, bool has_error, const char *error) |
24 | { |
25 | QDict *qmp; |
26 | QObject *obj; |
27 | Visitor *v; |
28 | q_obj_DUMP_COMPLETED_arg param = { |
29 | result, has_error, (char *)error |
30 | }; |
31 | |
32 | qmp = qmp_event_build_dict("DUMP_COMPLETED" ); |
33 | |
34 | v = qobject_output_visitor_new(&obj); |
35 | |
36 | visit_start_struct(v, "DUMP_COMPLETED" , NULL, 0, &error_abort); |
37 | visit_type_q_obj_DUMP_COMPLETED_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_DUMP_COMPLETED, qmp); |
44 | |
45 | visit_free(v); |
46 | qobject_unref(qmp); |
47 | } |
48 | |
49 | /* Dummy declaration to prevent empty .o file */ |
50 | char qapi_dummy_qapi_events_dump_c; |
51 | |