| 1 | /* AUTOMATICALLY GENERATED, DO NOT MODIFY */ |
| 2 | |
| 3 | /* |
| 4 | * Schema-defined QAPI/QMP commands |
| 5 | * |
| 6 | * Copyright IBM, Corp. 2011 |
| 7 | * Copyright (C) 2014-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/visitor.h" |
| 15 | #include "qapi/qmp/qdict.h" |
| 16 | #include "qapi/qobject-output-visitor.h" |
| 17 | #include "qapi/qobject-input-visitor.h" |
| 18 | #include "qapi/dealloc-visitor.h" |
| 19 | #include "qapi/error.h" |
| 20 | #include "qapi-visit-dump.h" |
| 21 | #include "qapi-commands-dump.h" |
| 22 | |
| 23 | |
| 24 | void qmp_marshal_dump_guest_memory(QDict *args, QObject **ret, Error **errp) |
| 25 | { |
| 26 | Error *err = NULL; |
| 27 | Visitor *v; |
| 28 | q_obj_dump_guest_memory_arg arg = {0}; |
| 29 | |
| 30 | v = qobject_input_visitor_new(QOBJECT(args)); |
| 31 | visit_start_struct(v, NULL, NULL, 0, &err); |
| 32 | if (err) { |
| 33 | goto out; |
| 34 | } |
| 35 | visit_type_q_obj_dump_guest_memory_arg_members(v, &arg, &err); |
| 36 | if (!err) { |
| 37 | visit_check_struct(v, &err); |
| 38 | } |
| 39 | visit_end_struct(v, NULL); |
| 40 | if (err) { |
| 41 | goto out; |
| 42 | } |
| 43 | |
| 44 | qmp_dump_guest_memory(arg.paging, arg.protocol, arg.has_detach, arg.detach, arg.has_begin, arg.begin, arg.has_length, arg.length, arg.has_format, arg.format, &err); |
| 45 | |
| 46 | out: |
| 47 | error_propagate(errp, err); |
| 48 | visit_free(v); |
| 49 | v = qapi_dealloc_visitor_new(); |
| 50 | visit_start_struct(v, NULL, NULL, 0, NULL); |
| 51 | visit_type_q_obj_dump_guest_memory_arg_members(v, &arg, NULL); |
| 52 | visit_end_struct(v, NULL); |
| 53 | visit_free(v); |
| 54 | } |
| 55 | |
| 56 | static void qmp_marshal_output_DumpQueryResult(DumpQueryResult *ret_in, QObject **ret_out, Error **errp) |
| 57 | { |
| 58 | Error *err = NULL; |
| 59 | Visitor *v; |
| 60 | |
| 61 | v = qobject_output_visitor_new(ret_out); |
| 62 | visit_type_DumpQueryResult(v, "unused" , &ret_in, &err); |
| 63 | if (!err) { |
| 64 | visit_complete(v, ret_out); |
| 65 | } |
| 66 | error_propagate(errp, err); |
| 67 | visit_free(v); |
| 68 | v = qapi_dealloc_visitor_new(); |
| 69 | visit_type_DumpQueryResult(v, "unused" , &ret_in, NULL); |
| 70 | visit_free(v); |
| 71 | } |
| 72 | |
| 73 | void qmp_marshal_query_dump(QDict *args, QObject **ret, Error **errp) |
| 74 | { |
| 75 | Error *err = NULL; |
| 76 | DumpQueryResult *retval; |
| 77 | Visitor *v = NULL; |
| 78 | |
| 79 | if (args) { |
| 80 | v = qobject_input_visitor_new(QOBJECT(args)); |
| 81 | visit_start_struct(v, NULL, NULL, 0, &err); |
| 82 | if (err) { |
| 83 | goto out; |
| 84 | } |
| 85 | |
| 86 | if (!err) { |
| 87 | visit_check_struct(v, &err); |
| 88 | } |
| 89 | visit_end_struct(v, NULL); |
| 90 | if (err) { |
| 91 | goto out; |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | retval = qmp_query_dump(&err); |
| 96 | if (err) { |
| 97 | goto out; |
| 98 | } |
| 99 | |
| 100 | qmp_marshal_output_DumpQueryResult(retval, ret, &err); |
| 101 | |
| 102 | out: |
| 103 | error_propagate(errp, err); |
| 104 | visit_free(v); |
| 105 | if (args) { |
| 106 | v = qapi_dealloc_visitor_new(); |
| 107 | visit_start_struct(v, NULL, NULL, 0, NULL); |
| 108 | |
| 109 | visit_end_struct(v, NULL); |
| 110 | visit_free(v); |
| 111 | } |
| 112 | } |
| 113 | |
| 114 | static void qmp_marshal_output_DumpGuestMemoryCapability(DumpGuestMemoryCapability *ret_in, QObject **ret_out, Error **errp) |
| 115 | { |
| 116 | Error *err = NULL; |
| 117 | Visitor *v; |
| 118 | |
| 119 | v = qobject_output_visitor_new(ret_out); |
| 120 | visit_type_DumpGuestMemoryCapability(v, "unused" , &ret_in, &err); |
| 121 | if (!err) { |
| 122 | visit_complete(v, ret_out); |
| 123 | } |
| 124 | error_propagate(errp, err); |
| 125 | visit_free(v); |
| 126 | v = qapi_dealloc_visitor_new(); |
| 127 | visit_type_DumpGuestMemoryCapability(v, "unused" , &ret_in, NULL); |
| 128 | visit_free(v); |
| 129 | } |
| 130 | |
| 131 | void qmp_marshal_query_dump_guest_memory_capability(QDict *args, QObject **ret, Error **errp) |
| 132 | { |
| 133 | Error *err = NULL; |
| 134 | DumpGuestMemoryCapability *retval; |
| 135 | Visitor *v = NULL; |
| 136 | |
| 137 | if (args) { |
| 138 | v = qobject_input_visitor_new(QOBJECT(args)); |
| 139 | visit_start_struct(v, NULL, NULL, 0, &err); |
| 140 | if (err) { |
| 141 | goto out; |
| 142 | } |
| 143 | |
| 144 | if (!err) { |
| 145 | visit_check_struct(v, &err); |
| 146 | } |
| 147 | visit_end_struct(v, NULL); |
| 148 | if (err) { |
| 149 | goto out; |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | retval = qmp_query_dump_guest_memory_capability(&err); |
| 154 | if (err) { |
| 155 | goto out; |
| 156 | } |
| 157 | |
| 158 | qmp_marshal_output_DumpGuestMemoryCapability(retval, ret, &err); |
| 159 | |
| 160 | out: |
| 161 | error_propagate(errp, err); |
| 162 | visit_free(v); |
| 163 | if (args) { |
| 164 | v = qapi_dealloc_visitor_new(); |
| 165 | visit_start_struct(v, NULL, NULL, 0, NULL); |
| 166 | |
| 167 | visit_end_struct(v, NULL); |
| 168 | visit_free(v); |
| 169 | } |
| 170 | } |
| 171 | |
| 172 | /* Dummy declaration to prevent empty .o file */ |
| 173 | char qapi_dummy_qapi_commands_dump_c; |
| 174 | |