migration/rdma: Fix qemu_rdma_accept() to return failure on errors
[qemu/kevin.git] / qapi / misc.json
blobcda2effa8155a8a6175036f678877ec2c7cdd1bf
1 # -*- Mode: Python -*-
2 # vim: filetype=python
5 ##
6 # = Miscellanea
7 ##
9 { 'include': 'common.json' }
12 # @add_client:
14 # Allow client connections for VNC, Spice and socket based character
15 # devices to be passed in to QEMU via SCM_RIGHTS.
17 # If the FD associated with @fdname is not a socket, the command will
18 # fail and the FD will be closed.
20 # @protocol: protocol name.  Valid names are "vnc", "spice",
21 #     "@dbus-display" or the name of a character device (e.g. from
22 #     -chardev id=XXXX)
24 # @fdname: file descriptor name previously passed via 'getfd' command
26 # @skipauth: whether to skip authentication.  Only applies to "vnc"
27 #     and "spice" protocols
29 # @tls: whether to perform TLS. Only applies to the "spice" protocol
31 # Returns: nothing on success.
33 # Since: 0.14
35 # Example:
37 # -> { "execute": "add_client", "arguments": { "protocol": "vnc",
38 #                                              "fdname": "myclient" } }
39 # <- { "return": {} }
41 { 'command': 'add_client',
42   'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
43             '*tls': 'bool' } }
46 # @NameInfo:
48 # Guest name information.
50 # @name: The name of the guest
52 # Since: 0.14
54 { 'struct': 'NameInfo', 'data': {'*name': 'str'} }
57 # @query-name:
59 # Return the name information of a guest.
61 # Returns: @NameInfo of the guest
63 # Since: 0.14
65 # Example:
67 # -> { "execute": "query-name" }
68 # <- { "return": { "name": "qemu-name" } }
70 { 'command': 'query-name', 'returns': 'NameInfo', 'allow-preconfig': true }
73 # @IOThreadInfo:
75 # Information about an iothread
77 # @id: the identifier of the iothread
79 # @thread-id: ID of the underlying host thread
81 # @poll-max-ns: maximum polling time in ns, 0 means polling is
82 #     disabled (since 2.9)
84 # @poll-grow: how many ns will be added to polling time, 0 means that
85 #     it's not configured (since 2.9)
87 # @poll-shrink: how many ns will be removed from polling time, 0 means
88 #     that it's not configured (since 2.9)
90 # @aio-max-batch: maximum number of requests in a batch for the AIO
91 #     engine, 0 means that the engine will use its default (since 6.1)
93 # Since: 2.0
95 { 'struct': 'IOThreadInfo',
96   'data': {'id': 'str',
97            'thread-id': 'int',
98            'poll-max-ns': 'int',
99            'poll-grow': 'int',
100            'poll-shrink': 'int',
101            'aio-max-batch': 'int' } }
104 # @query-iothreads:
106 # Returns a list of information about each iothread.
108 # Note: this list excludes the QEMU main loop thread, which is not
109 #     declared using the -object iothread command-line option.  It is
110 #     always the main thread of the process.
112 # Returns: a list of @IOThreadInfo for each iothread
114 # Since: 2.0
116 # Example:
118 # -> { "execute": "query-iothreads" }
119 # <- { "return": [
120 #          {
121 #             "id":"iothread0",
122 #             "thread-id":3134
123 #          },
124 #          {
125 #             "id":"iothread1",
126 #             "thread-id":3135
127 #          }
128 #       ]
129 #    }
131 { 'command': 'query-iothreads', 'returns': ['IOThreadInfo'],
132   'allow-preconfig': true }
135 # @stop:
137 # Stop all guest VCPU execution.
139 # Since: 0.14
141 # Notes: This function will succeed even if the guest is already in
142 #     the stopped state.  In "inmigrate" state, it will ensure that
143 #     the guest remains paused once migration finishes, as if the -S
144 #     option was passed on the command line.
146 # Example:
148 # -> { "execute": "stop" }
149 # <- { "return": {} }
151 { 'command': 'stop' }
154 # @cont:
156 # Resume guest VCPU execution.
158 # Since: 0.14
160 # Returns: If successful, nothing
162 # Notes: This command will succeed if the guest is currently running.
163 #     It will also succeed if the guest is in the "inmigrate" state;
164 #     in this case, the effect of the command is to make sure the
165 #     guest starts once migration finishes, removing the effect of the
166 #     -S command line option if it was passed.
168 # Example:
170 # -> { "execute": "cont" }
171 # <- { "return": {} }
173 { 'command': 'cont' }
176 # @x-exit-preconfig:
178 # Exit from "preconfig" state
180 # This command makes QEMU exit the preconfig state and proceed with VM
181 # initialization using configuration data provided on the command line
182 # and via the QMP monitor during the preconfig state.  The command is
183 # only available during the preconfig state (i.e. when the --preconfig
184 # command line option was in use).
186 # Features:
188 # @unstable: This command is experimental.
190 # Since: 3.0
192 # Returns: nothing
194 # Example:
196 # -> { "execute": "x-exit-preconfig" }
197 # <- { "return": {} }
199 { 'command': 'x-exit-preconfig', 'allow-preconfig': true,
200   'features': [ 'unstable' ] }
203 # @human-monitor-command:
205 # Execute a command on the human monitor and return the output.
207 # @command-line: the command to execute in the human monitor
209 # @cpu-index: The CPU to use for commands that require an implicit CPU
211 # Features:
213 # @savevm-monitor-nodes: If present, HMP command savevm only snapshots
214 #     monitor-owned nodes if they have no parents.  This allows the
215 #     use of 'savevm' with -blockdev.  (since 4.2)
217 # Returns: the output of the command as a string
219 # Since: 0.14
221 # Notes: This command only exists as a stop-gap.  Its use is highly
222 #     discouraged.  The semantics of this command are not guaranteed:
223 #     this means that command names, arguments and responses can
224 #     change or be removed at ANY time.  Applications that rely on
225 #     long term stability guarantees should NOT use this command.
227 #     Known limitations:
229 #     * This command is stateless, this means that commands that
230 #       depend on state information (such as getfd) might not work
232 #     * Commands that prompt the user for data don't currently work
234 # Example:
236 # -> { "execute": "human-monitor-command",
237 #      "arguments": { "command-line": "info kvm" } }
238 # <- { "return": "kvm support: enabled\r\n" }
240 { 'command': 'human-monitor-command',
241   'data': {'command-line': 'str', '*cpu-index': 'int'},
242   'returns': 'str',
243   'features': [ 'savevm-monitor-nodes' ] }
246 # @getfd:
248 # Receive a file descriptor via SCM rights and assign it a name
250 # @fdname: file descriptor name
252 # Returns: Nothing on success
254 # Since: 0.14
256 # Notes: If @fdname already exists, the file descriptor assigned to it
257 #     will be closed and replaced by the received file descriptor.
259 #     The 'closefd' command can be used to explicitly close the file
260 #     descriptor when it is no longer needed.
262 # Example:
264 # -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
265 # <- { "return": {} }
267 { 'command': 'getfd', 'data': {'fdname': 'str'}, 'if': 'CONFIG_POSIX' }
270 # @get-win32-socket:
272 # Add a socket that was duplicated to QEMU process with
273 # WSADuplicateSocketW() via WSASocket() & WSAPROTOCOL_INFOW structure
274 # and assign it a name (the SOCKET is associated with a CRT file
275 # descriptor)
277 # @info: the WSAPROTOCOL_INFOW structure (encoded in base64)
279 # @fdname: file descriptor name
281 # Returns: Nothing on success
283 # Since: 8.0
285 # Notes: If @fdname already exists, the file descriptor assigned to it
286 #     will be closed and replaced by the received file descriptor.
288 #     The 'closefd' command can be used to explicitly close the file
289 #     descriptor when it is no longer needed.
291 # Example:
293 # -> { "execute": "get-win32-socket", "arguments": { "info": "abcd123..", fdname": "skclient" } }
294 # <- { "return": {} }
296 { 'command': 'get-win32-socket', 'data': {'info': 'str', 'fdname': 'str'}, 'if': 'CONFIG_WIN32' }
299 # @closefd:
301 # Close a file descriptor previously passed via SCM rights
303 # @fdname: file descriptor name
305 # Returns: Nothing on success
307 # Since: 0.14
309 # Example:
311 # -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
312 # <- { "return": {} }
314 { 'command': 'closefd', 'data': {'fdname': 'str'} }
317 # @AddfdInfo:
319 # Information about a file descriptor that was added to an fd set.
321 # @fdset-id: The ID of the fd set that @fd was added to.
323 # @fd: The file descriptor that was received via SCM rights and added
324 #     to the fd set.
326 # Since: 1.2
328 { 'struct': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
331 # @add-fd:
333 # Add a file descriptor, that was passed via SCM rights, to an fd set.
335 # @fdset-id: The ID of the fd set to add the file descriptor to.
337 # @opaque: A free-form string that can be used to describe the fd.
339 # Returns:
340 # - @AddfdInfo on success
341 # - If file descriptor was not received, GenericError
342 # - If @fdset-id is a negative value, GenericError
344 # Notes: The list of fd sets is shared by all monitor connections.
346 # If @fdset-id is not specified, a new fd set will be created.
348 # Since: 1.2
350 # Example:
352 # -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
353 # <- { "return": { "fdset-id": 1, "fd": 3 } }
355 { 'command': 'add-fd',
356   'data': { '*fdset-id': 'int',
357             '*opaque': 'str' },
358   'returns': 'AddfdInfo' }
361 # @remove-fd:
363 # Remove a file descriptor from an fd set.
365 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
367 # @fd: The file descriptor that is to be removed.
369 # Returns:
370 # - Nothing on success
371 # - If @fdset-id or @fd is not found, GenericError
373 # Since: 1.2
375 # Notes: The list of fd sets is shared by all monitor connections.
377 # If @fd is not specified, all file descriptors in @fdset-id will be
378 # removed.
380 # Example:
382 # -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
383 # <- { "return": {} }
385 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
388 # @FdsetFdInfo:
390 # Information about a file descriptor that belongs to an fd set.
392 # @fd: The file descriptor value.
394 # @opaque: A free-form string that can be used to describe the fd.
396 # Since: 1.2
398 { 'struct': 'FdsetFdInfo',
399   'data': {'fd': 'int', '*opaque': 'str'} }
402 # @FdsetInfo:
404 # Information about an fd set.
406 # @fdset-id: The ID of the fd set.
408 # @fds: A list of file descriptors that belong to this fd set.
410 # Since: 1.2
412 { 'struct': 'FdsetInfo',
413   'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
416 # @query-fdsets:
418 # Return information describing all fd sets.
420 # Returns: A list of @FdsetInfo
422 # Since: 1.2
424 # Note: The list of fd sets is shared by all monitor connections.
426 # Example:
428 # -> { "execute": "query-fdsets" }
429 # <- { "return": [
430 #        {
431 #          "fds": [
432 #            {
433 #              "fd": 30,
434 #              "opaque": "rdonly:/path/to/file"
435 #            },
436 #            {
437 #              "fd": 24,
438 #              "opaque": "rdwr:/path/to/file"
439 #            }
440 #          ],
441 #          "fdset-id": 1
442 #        },
443 #        {
444 #          "fds": [
445 #            {
446 #              "fd": 28
447 #            },
448 #            {
449 #              "fd": 29
450 #            }
451 #          ],
452 #          "fdset-id": 0
453 #        }
454 #      ]
455 #    }
457 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
460 # @CommandLineParameterType:
462 # Possible types for an option parameter.
464 # @string: accepts a character string
466 # @boolean: accepts "on" or "off"
468 # @number: accepts a number
470 # @size: accepts a number followed by an optional suffix (K)ilo,
471 #     (M)ega, (G)iga, (T)era
473 # Since: 1.5
475 { 'enum': 'CommandLineParameterType',
476   'data': ['string', 'boolean', 'number', 'size'] }
479 # @CommandLineParameterInfo:
481 # Details about a single parameter of a command line option.
483 # @name: parameter name
485 # @type: parameter @CommandLineParameterType
487 # @help: human readable text string, not suitable for parsing.
489 # @default: default value string (since 2.1)
491 # Since: 1.5
493 { 'struct': 'CommandLineParameterInfo',
494   'data': { 'name': 'str',
495             'type': 'CommandLineParameterType',
496             '*help': 'str',
497             '*default': 'str' } }
500 # @CommandLineOptionInfo:
502 # Details about a command line option, including its list of parameter
503 # details
505 # @option: option name
507 # @parameters: an array of @CommandLineParameterInfo
509 # Since: 1.5
511 { 'struct': 'CommandLineOptionInfo',
512   'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
515 # @query-command-line-options:
517 # Query command line option schema.
519 # @option: option name
521 # Returns: list of @CommandLineOptionInfo for all options (or for the
522 #     given @option).  Returns an error if the given @option doesn't
523 #     exist.
525 # Since: 1.5
527 # Example:
529 # -> { "execute": "query-command-line-options",
530 #      "arguments": { "option": "option-rom" } }
531 # <- { "return": [
532 #         {
533 #             "parameters": [
534 #                 {
535 #                     "name": "romfile",
536 #                     "type": "string"
537 #                 },
538 #                 {
539 #                     "name": "bootindex",
540 #                     "type": "number"
541 #                 }
542 #             ],
543 #             "option": "option-rom"
544 #         }
545 #      ]
546 #    }
548 {'command': 'query-command-line-options',
549  'data': {'*option': 'str'},
550  'returns': ['CommandLineOptionInfo'],
551  'allow-preconfig': true}
554 # @RTC_CHANGE:
556 # Emitted when the guest changes the RTC time.
558 # @offset: offset in seconds between base RTC clock (as specified by
559 #     -rtc base), and new RTC clock value
561 # @qom-path: path to the RTC object in the QOM tree
563 # Note: This event is rate-limited.  It is not guaranteed that the RTC
564 #     in the system implements this event, or even that the system has
565 #     an RTC at all.
567 # Since: 0.13
569 # Example:
571 # <- { "event": "RTC_CHANGE",
572 #      "data": { "offset": 78 },
573 #      "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
575 { 'event': 'RTC_CHANGE',
576   'data': { 'offset': 'int', 'qom-path': 'str' } }
579 # @VFU_CLIENT_HANGUP:
581 # Emitted when the client of a TYPE_VFIO_USER_SERVER closes the
582 # communication channel
584 # @vfu-id: ID of the TYPE_VFIO_USER_SERVER object.  It is the last
585 #     component of @vfu-qom-path referenced below
587 # @vfu-qom-path: path to the TYPE_VFIO_USER_SERVER object in the QOM
588 #     tree
590 # @dev-id: ID of attached PCI device
592 # @dev-qom-path: path to attached PCI device in the QOM tree
594 # Since: 7.1
596 # Example:
598 # <- { "event": "VFU_CLIENT_HANGUP",
599 #      "data": { "vfu-id": "vfu1",
600 #                "vfu-qom-path": "/objects/vfu1",
601 #                "dev-id": "sas1",
602 #                "dev-qom-path": "/machine/peripheral/sas1" },
603 #      "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
605 { 'event': 'VFU_CLIENT_HANGUP',
606   'data': { 'vfu-id': 'str', 'vfu-qom-path': 'str',
607             'dev-id': 'str', 'dev-qom-path': 'str' } }