| 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-ui.h" |
| 21 | #include "qapi-commands-ui.h" |
| 22 | |
| 23 | |
| 24 | void qmp_marshal_set_password(QDict *args, QObject **ret, Error **errp) |
| 25 | { |
| 26 | Error *err = NULL; |
| 27 | Visitor *v; |
| 28 | q_obj_set_password_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_set_password_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_set_password(arg.protocol, arg.password, arg.has_connected, arg.connected, &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_set_password_arg_members(v, &arg, NULL); |
| 52 | visit_end_struct(v, NULL); |
| 53 | visit_free(v); |
| 54 | } |
| 55 | |
| 56 | void qmp_marshal_expire_password(QDict *args, QObject **ret, Error **errp) |
| 57 | { |
| 58 | Error *err = NULL; |
| 59 | Visitor *v; |
| 60 | q_obj_expire_password_arg arg = {0}; |
| 61 | |
| 62 | v = qobject_input_visitor_new(QOBJECT(args)); |
| 63 | visit_start_struct(v, NULL, NULL, 0, &err); |
| 64 | if (err) { |
| 65 | goto out; |
| 66 | } |
| 67 | visit_type_q_obj_expire_password_arg_members(v, &arg, &err); |
| 68 | if (!err) { |
| 69 | visit_check_struct(v, &err); |
| 70 | } |
| 71 | visit_end_struct(v, NULL); |
| 72 | if (err) { |
| 73 | goto out; |
| 74 | } |
| 75 | |
| 76 | qmp_expire_password(arg.protocol, arg.time, &err); |
| 77 | |
| 78 | out: |
| 79 | error_propagate(errp, err); |
| 80 | visit_free(v); |
| 81 | v = qapi_dealloc_visitor_new(); |
| 82 | visit_start_struct(v, NULL, NULL, 0, NULL); |
| 83 | visit_type_q_obj_expire_password_arg_members(v, &arg, NULL); |
| 84 | visit_end_struct(v, NULL); |
| 85 | visit_free(v); |
| 86 | } |
| 87 | |
| 88 | void qmp_marshal_screendump(QDict *args, QObject **ret, Error **errp) |
| 89 | { |
| 90 | Error *err = NULL; |
| 91 | Visitor *v; |
| 92 | q_obj_screendump_arg arg = {0}; |
| 93 | |
| 94 | v = qobject_input_visitor_new(QOBJECT(args)); |
| 95 | visit_start_struct(v, NULL, NULL, 0, &err); |
| 96 | if (err) { |
| 97 | goto out; |
| 98 | } |
| 99 | visit_type_q_obj_screendump_arg_members(v, &arg, &err); |
| 100 | if (!err) { |
| 101 | visit_check_struct(v, &err); |
| 102 | } |
| 103 | visit_end_struct(v, NULL); |
| 104 | if (err) { |
| 105 | goto out; |
| 106 | } |
| 107 | |
| 108 | qmp_screendump(arg.filename, arg.has_device, arg.device, arg.has_head, arg.head, &err); |
| 109 | |
| 110 | out: |
| 111 | error_propagate(errp, err); |
| 112 | visit_free(v); |
| 113 | v = qapi_dealloc_visitor_new(); |
| 114 | visit_start_struct(v, NULL, NULL, 0, NULL); |
| 115 | visit_type_q_obj_screendump_arg_members(v, &arg, NULL); |
| 116 | visit_end_struct(v, NULL); |
| 117 | visit_free(v); |
| 118 | } |
| 119 | |
| 120 | #if defined(CONFIG_SPICE) |
| 121 | static void qmp_marshal_output_SpiceInfo(SpiceInfo *ret_in, QObject **ret_out, Error **errp) |
| 122 | { |
| 123 | Error *err = NULL; |
| 124 | Visitor *v; |
| 125 | |
| 126 | v = qobject_output_visitor_new(ret_out); |
| 127 | visit_type_SpiceInfo(v, "unused" , &ret_in, &err); |
| 128 | if (!err) { |
| 129 | visit_complete(v, ret_out); |
| 130 | } |
| 131 | error_propagate(errp, err); |
| 132 | visit_free(v); |
| 133 | v = qapi_dealloc_visitor_new(); |
| 134 | visit_type_SpiceInfo(v, "unused" , &ret_in, NULL); |
| 135 | visit_free(v); |
| 136 | } |
| 137 | #endif /* defined(CONFIG_SPICE) */ |
| 138 | |
| 139 | #if defined(CONFIG_SPICE) |
| 140 | void qmp_marshal_query_spice(QDict *args, QObject **ret, Error **errp) |
| 141 | { |
| 142 | Error *err = NULL; |
| 143 | SpiceInfo *retval; |
| 144 | Visitor *v = NULL; |
| 145 | |
| 146 | if (args) { |
| 147 | v = qobject_input_visitor_new(QOBJECT(args)); |
| 148 | visit_start_struct(v, NULL, NULL, 0, &err); |
| 149 | if (err) { |
| 150 | goto out; |
| 151 | } |
| 152 | |
| 153 | if (!err) { |
| 154 | visit_check_struct(v, &err); |
| 155 | } |
| 156 | visit_end_struct(v, NULL); |
| 157 | if (err) { |
| 158 | goto out; |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | retval = qmp_query_spice(&err); |
| 163 | if (err) { |
| 164 | goto out; |
| 165 | } |
| 166 | |
| 167 | qmp_marshal_output_SpiceInfo(retval, ret, &err); |
| 168 | |
| 169 | out: |
| 170 | error_propagate(errp, err); |
| 171 | visit_free(v); |
| 172 | if (args) { |
| 173 | v = qapi_dealloc_visitor_new(); |
| 174 | visit_start_struct(v, NULL, NULL, 0, NULL); |
| 175 | |
| 176 | visit_end_struct(v, NULL); |
| 177 | visit_free(v); |
| 178 | } |
| 179 | } |
| 180 | #endif /* defined(CONFIG_SPICE) */ |
| 181 | |
| 182 | #if defined(CONFIG_VNC) |
| 183 | static void qmp_marshal_output_VncInfo(VncInfo *ret_in, QObject **ret_out, Error **errp) |
| 184 | { |
| 185 | Error *err = NULL; |
| 186 | Visitor *v; |
| 187 | |
| 188 | v = qobject_output_visitor_new(ret_out); |
| 189 | visit_type_VncInfo(v, "unused" , &ret_in, &err); |
| 190 | if (!err) { |
| 191 | visit_complete(v, ret_out); |
| 192 | } |
| 193 | error_propagate(errp, err); |
| 194 | visit_free(v); |
| 195 | v = qapi_dealloc_visitor_new(); |
| 196 | visit_type_VncInfo(v, "unused" , &ret_in, NULL); |
| 197 | visit_free(v); |
| 198 | } |
| 199 | #endif /* defined(CONFIG_VNC) */ |
| 200 | |
| 201 | #if defined(CONFIG_VNC) |
| 202 | void qmp_marshal_query_vnc(QDict *args, QObject **ret, Error **errp) |
| 203 | { |
| 204 | Error *err = NULL; |
| 205 | VncInfo *retval; |
| 206 | Visitor *v = NULL; |
| 207 | |
| 208 | if (args) { |
| 209 | v = qobject_input_visitor_new(QOBJECT(args)); |
| 210 | visit_start_struct(v, NULL, NULL, 0, &err); |
| 211 | if (err) { |
| 212 | goto out; |
| 213 | } |
| 214 | |
| 215 | if (!err) { |
| 216 | visit_check_struct(v, &err); |
| 217 | } |
| 218 | visit_end_struct(v, NULL); |
| 219 | if (err) { |
| 220 | goto out; |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | retval = qmp_query_vnc(&err); |
| 225 | if (err) { |
| 226 | goto out; |
| 227 | } |
| 228 | |
| 229 | qmp_marshal_output_VncInfo(retval, ret, &err); |
| 230 | |
| 231 | out: |
| 232 | error_propagate(errp, err); |
| 233 | visit_free(v); |
| 234 | if (args) { |
| 235 | v = qapi_dealloc_visitor_new(); |
| 236 | visit_start_struct(v, NULL, NULL, 0, NULL); |
| 237 | |
| 238 | visit_end_struct(v, NULL); |
| 239 | visit_free(v); |
| 240 | } |
| 241 | } |
| 242 | #endif /* defined(CONFIG_VNC) */ |
| 243 | |
| 244 | #if defined(CONFIG_VNC) |
| 245 | static void qmp_marshal_output_VncInfo2List(VncInfo2List *ret_in, QObject **ret_out, Error **errp) |
| 246 | { |
| 247 | Error *err = NULL; |
| 248 | Visitor *v; |
| 249 | |
| 250 | v = qobject_output_visitor_new(ret_out); |
| 251 | visit_type_VncInfo2List(v, "unused" , &ret_in, &err); |
| 252 | if (!err) { |
| 253 | visit_complete(v, ret_out); |
| 254 | } |
| 255 | error_propagate(errp, err); |
| 256 | visit_free(v); |
| 257 | v = qapi_dealloc_visitor_new(); |
| 258 | visit_type_VncInfo2List(v, "unused" , &ret_in, NULL); |
| 259 | visit_free(v); |
| 260 | } |
| 261 | #endif /* defined(CONFIG_VNC) */ |
| 262 | |
| 263 | #if defined(CONFIG_VNC) |
| 264 | void qmp_marshal_query_vnc_servers(QDict *args, QObject **ret, Error **errp) |
| 265 | { |
| 266 | Error *err = NULL; |
| 267 | VncInfo2List *retval; |
| 268 | Visitor *v = NULL; |
| 269 | |
| 270 | if (args) { |
| 271 | v = qobject_input_visitor_new(QOBJECT(args)); |
| 272 | visit_start_struct(v, NULL, NULL, 0, &err); |
| 273 | if (err) { |
| 274 | goto out; |
| 275 | } |
| 276 | |
| 277 | if (!err) { |
| 278 | visit_check_struct(v, &err); |
| 279 | } |
| 280 | visit_end_struct(v, NULL); |
| 281 | if (err) { |
| 282 | goto out; |
| 283 | } |
| 284 | } |
| 285 | |
| 286 | retval = qmp_query_vnc_servers(&err); |
| 287 | if (err) { |
| 288 | goto out; |
| 289 | } |
| 290 | |
| 291 | qmp_marshal_output_VncInfo2List(retval, ret, &err); |
| 292 | |
| 293 | out: |
| 294 | error_propagate(errp, err); |
| 295 | visit_free(v); |
| 296 | if (args) { |
| 297 | v = qapi_dealloc_visitor_new(); |
| 298 | visit_start_struct(v, NULL, NULL, 0, NULL); |
| 299 | |
| 300 | visit_end_struct(v, NULL); |
| 301 | visit_free(v); |
| 302 | } |
| 303 | } |
| 304 | #endif /* defined(CONFIG_VNC) */ |
| 305 | |
| 306 | #if defined(CONFIG_VNC) |
| 307 | void qmp_marshal_change_vnc_password(QDict *args, QObject **ret, Error **errp) |
| 308 | { |
| 309 | Error *err = NULL; |
| 310 | Visitor *v; |
| 311 | q_obj_change_vnc_password_arg arg = {0}; |
| 312 | |
| 313 | v = qobject_input_visitor_new(QOBJECT(args)); |
| 314 | visit_start_struct(v, NULL, NULL, 0, &err); |
| 315 | if (err) { |
| 316 | goto out; |
| 317 | } |
| 318 | visit_type_q_obj_change_vnc_password_arg_members(v, &arg, &err); |
| 319 | if (!err) { |
| 320 | visit_check_struct(v, &err); |
| 321 | } |
| 322 | visit_end_struct(v, NULL); |
| 323 | if (err) { |
| 324 | goto out; |
| 325 | } |
| 326 | |
| 327 | qmp_change_vnc_password(arg.password, &err); |
| 328 | |
| 329 | out: |
| 330 | error_propagate(errp, err); |
| 331 | visit_free(v); |
| 332 | v = qapi_dealloc_visitor_new(); |
| 333 | visit_start_struct(v, NULL, NULL, 0, NULL); |
| 334 | visit_type_q_obj_change_vnc_password_arg_members(v, &arg, NULL); |
| 335 | visit_end_struct(v, NULL); |
| 336 | visit_free(v); |
| 337 | } |
| 338 | #endif /* defined(CONFIG_VNC) */ |
| 339 | |
| 340 | static void qmp_marshal_output_MouseInfoList(MouseInfoList *ret_in, QObject **ret_out, Error **errp) |
| 341 | { |
| 342 | Error *err = NULL; |
| 343 | Visitor *v; |
| 344 | |
| 345 | v = qobject_output_visitor_new(ret_out); |
| 346 | visit_type_MouseInfoList(v, "unused" , &ret_in, &err); |
| 347 | if (!err) { |
| 348 | visit_complete(v, ret_out); |
| 349 | } |
| 350 | error_propagate(errp, err); |
| 351 | visit_free(v); |
| 352 | v = qapi_dealloc_visitor_new(); |
| 353 | visit_type_MouseInfoList(v, "unused" , &ret_in, NULL); |
| 354 | visit_free(v); |
| 355 | } |
| 356 | |
| 357 | void qmp_marshal_query_mice(QDict *args, QObject **ret, Error **errp) |
| 358 | { |
| 359 | Error *err = NULL; |
| 360 | MouseInfoList *retval; |
| 361 | Visitor *v = NULL; |
| 362 | |
| 363 | if (args) { |
| 364 | v = qobject_input_visitor_new(QOBJECT(args)); |
| 365 | visit_start_struct(v, NULL, NULL, 0, &err); |
| 366 | if (err) { |
| 367 | goto out; |
| 368 | } |
| 369 | |
| 370 | if (!err) { |
| 371 | visit_check_struct(v, &err); |
| 372 | } |
| 373 | visit_end_struct(v, NULL); |
| 374 | if (err) { |
| 375 | goto out; |
| 376 | } |
| 377 | } |
| 378 | |
| 379 | retval = qmp_query_mice(&err); |
| 380 | if (err) { |
| 381 | goto out; |
| 382 | } |
| 383 | |
| 384 | qmp_marshal_output_MouseInfoList(retval, ret, &err); |
| 385 | |
| 386 | out: |
| 387 | error_propagate(errp, err); |
| 388 | visit_free(v); |
| 389 | if (args) { |
| 390 | v = qapi_dealloc_visitor_new(); |
| 391 | visit_start_struct(v, NULL, NULL, 0, NULL); |
| 392 | |
| 393 | visit_end_struct(v, NULL); |
| 394 | visit_free(v); |
| 395 | } |
| 396 | } |
| 397 | |
| 398 | void qmp_marshal_send_key(QDict *args, QObject **ret, Error **errp) |
| 399 | { |
| 400 | Error *err = NULL; |
| 401 | Visitor *v; |
| 402 | q_obj_send_key_arg arg = {0}; |
| 403 | |
| 404 | v = qobject_input_visitor_new(QOBJECT(args)); |
| 405 | visit_start_struct(v, NULL, NULL, 0, &err); |
| 406 | if (err) { |
| 407 | goto out; |
| 408 | } |
| 409 | visit_type_q_obj_send_key_arg_members(v, &arg, &err); |
| 410 | if (!err) { |
| 411 | visit_check_struct(v, &err); |
| 412 | } |
| 413 | visit_end_struct(v, NULL); |
| 414 | if (err) { |
| 415 | goto out; |
| 416 | } |
| 417 | |
| 418 | qmp_send_key(arg.keys, arg.has_hold_time, arg.hold_time, &err); |
| 419 | |
| 420 | out: |
| 421 | error_propagate(errp, err); |
| 422 | visit_free(v); |
| 423 | v = qapi_dealloc_visitor_new(); |
| 424 | visit_start_struct(v, NULL, NULL, 0, NULL); |
| 425 | visit_type_q_obj_send_key_arg_members(v, &arg, NULL); |
| 426 | visit_end_struct(v, NULL); |
| 427 | visit_free(v); |
| 428 | } |
| 429 | |
| 430 | void qmp_marshal_input_send_event(QDict *args, QObject **ret, Error **errp) |
| 431 | { |
| 432 | Error *err = NULL; |
| 433 | Visitor *v; |
| 434 | q_obj_input_send_event_arg arg = {0}; |
| 435 | |
| 436 | v = qobject_input_visitor_new(QOBJECT(args)); |
| 437 | visit_start_struct(v, NULL, NULL, 0, &err); |
| 438 | if (err) { |
| 439 | goto out; |
| 440 | } |
| 441 | visit_type_q_obj_input_send_event_arg_members(v, &arg, &err); |
| 442 | if (!err) { |
| 443 | visit_check_struct(v, &err); |
| 444 | } |
| 445 | visit_end_struct(v, NULL); |
| 446 | if (err) { |
| 447 | goto out; |
| 448 | } |
| 449 | |
| 450 | qmp_input_send_event(arg.has_device, arg.device, arg.has_head, arg.head, arg.events, &err); |
| 451 | |
| 452 | out: |
| 453 | error_propagate(errp, err); |
| 454 | visit_free(v); |
| 455 | v = qapi_dealloc_visitor_new(); |
| 456 | visit_start_struct(v, NULL, NULL, 0, NULL); |
| 457 | visit_type_q_obj_input_send_event_arg_members(v, &arg, NULL); |
| 458 | visit_end_struct(v, NULL); |
| 459 | visit_free(v); |
| 460 | } |
| 461 | |
| 462 | static void qmp_marshal_output_DisplayOptions(DisplayOptions *ret_in, QObject **ret_out, Error **errp) |
| 463 | { |
| 464 | Error *err = NULL; |
| 465 | Visitor *v; |
| 466 | |
| 467 | v = qobject_output_visitor_new(ret_out); |
| 468 | visit_type_DisplayOptions(v, "unused" , &ret_in, &err); |
| 469 | if (!err) { |
| 470 | visit_complete(v, ret_out); |
| 471 | } |
| 472 | error_propagate(errp, err); |
| 473 | visit_free(v); |
| 474 | v = qapi_dealloc_visitor_new(); |
| 475 | visit_type_DisplayOptions(v, "unused" , &ret_in, NULL); |
| 476 | visit_free(v); |
| 477 | } |
| 478 | |
| 479 | void qmp_marshal_query_display_options(QDict *args, QObject **ret, Error **errp) |
| 480 | { |
| 481 | Error *err = NULL; |
| 482 | DisplayOptions *retval; |
| 483 | Visitor *v = NULL; |
| 484 | |
| 485 | if (args) { |
| 486 | v = qobject_input_visitor_new(QOBJECT(args)); |
| 487 | visit_start_struct(v, NULL, NULL, 0, &err); |
| 488 | if (err) { |
| 489 | goto out; |
| 490 | } |
| 491 | |
| 492 | if (!err) { |
| 493 | visit_check_struct(v, &err); |
| 494 | } |
| 495 | visit_end_struct(v, NULL); |
| 496 | if (err) { |
| 497 | goto out; |
| 498 | } |
| 499 | } |
| 500 | |
| 501 | retval = qmp_query_display_options(&err); |
| 502 | if (err) { |
| 503 | goto out; |
| 504 | } |
| 505 | |
| 506 | qmp_marshal_output_DisplayOptions(retval, ret, &err); |
| 507 | |
| 508 | out: |
| 509 | error_propagate(errp, err); |
| 510 | visit_free(v); |
| 511 | if (args) { |
| 512 | v = qapi_dealloc_visitor_new(); |
| 513 | visit_start_struct(v, NULL, NULL, 0, NULL); |
| 514 | |
| 515 | visit_end_struct(v, NULL); |
| 516 | visit_free(v); |
| 517 | } |
| 518 | } |
| 519 | |
| 520 | /* Dummy declaration to prevent empty .o file */ |
| 521 | char qapi_dummy_qapi_commands_ui_c; |
| 522 | |