master
json 608 lines 14.9 KB
Raw
1 # -*- Mode: Python -*-
2 # vim: filetype=python
3 #
4
5 ##
6 # ***********
7 # Miscellanea
8 # ***********
9 ##
10
11 { 'include': 'common.json' }
12
13 ##
14 # @add_client:
15 #
16 # Allow client connections for VNC, Spice and socket based character
17 # devices to be passed in to QEMU via SCM_RIGHTS.
18 #
19 # If the FD associated with @fdname is not a socket, the command will
20 # fail and the FD will be closed.
21 #
22 # @protocol: protocol name. Valid names are "vnc", "spice",
23 # "@dbus-display" or the name of a character device (e.g. from
24 # -chardev id=XXXX)
25 #
26 # @fdname: file descriptor name previously passed via `getfd` command
27 #
28 # @skipauth: whether to skip authentication. Only applies to "vnc"
29 # and "spice" protocols
30 #
31 # @tls: whether to perform TLS. Only applies to the "spice" protocol
32 #
33 # Since: 0.14
34 #
35 # .. qmp-example::
36 #
37 # -> { "execute": "add_client", "arguments": { "protocol": "vnc",
38 # "fdname": "myclient" } }
39 # <- { "return": {} }
40 ##
41 { 'command': 'add_client',
42 'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
43 '*tls': 'bool' } }
44
45 ##
46 # @NameInfo:
47 #
48 # Guest name information.
49 #
50 # @name: The name of the guest
51 #
52 # Since: 0.14
53 ##
54 { 'struct': 'NameInfo', 'data': {'*name': 'str'} }
55
56 ##
57 # @query-name:
58 #
59 # Return the name information of a guest.
60 #
61 # Since: 0.14
62 #
63 # .. qmp-example::
64 #
65 # -> { "execute": "query-name" }
66 # <- { "return": { "name": "qemu-name" } }
67 ##
68 { 'command': 'query-name', 'returns': 'NameInfo', 'allow-preconfig': true }
69
70 ##
71 # @IOThreadInfo:
72 #
73 # Information about an iothread
74 #
75 # @id: the identifier of the iothread
76 #
77 # @thread-id: ID of the underlying host thread
78 #
79 # @poll-max-ns: maximum polling time in ns, 0 means polling is
80 # disabled (since 2.9)
81 #
82 # @poll-grow: how many ns will be added to polling time, 0 means that
83 # it's not configured (since 2.9)
84 #
85 # @poll-shrink: how many ns will be removed from polling time, 0 means
86 # that it's not configured (since 2.9)
87 #
88 # @poll-weight: the weight factor for adaptive polling.
89 # Determines how much the current event interval contributes to
90 # the next polling time calculation. Valid values are 1 or
91 # greater (since 11.1)
92 #
93 # @aio-max-batch: maximum number of requests in a batch for the AIO
94 # engine, 0 means that the engine will use its default (since 6.1)
95 #
96 # Since: 2.0
97 ##
98 { 'struct': 'IOThreadInfo',
99 'data': {'id': 'str',
100 'thread-id': 'int',
101 'poll-max-ns': 'int',
102 'poll-grow': 'int',
103 'poll-shrink': 'int',
104 'poll-weight': 'int',
105 'aio-max-batch': 'int' } }
106
107 ##
108 # @query-iothreads:
109 #
110 # Return a list of information about each iothread.
111 #
112 # .. note:: This list excludes the QEMU main loop thread, which is not
113 # declared using the ``-object iothread`` command-line option. It
114 # is always the main thread of the process.
115 #
116 # Returns: a list of info for each iothread
117 #
118 # Since: 2.0
119 #
120 # .. qmp-example::
121 #
122 # -> { "execute": "query-iothreads" }
123 # <- { "return": [
124 # {
125 # "id":"iothread0",
126 # "thread-id":3134
127 # },
128 # {
129 # "id":"iothread1",
130 # "thread-id":3135
131 # }
132 # ]
133 # }
134 ##
135 { 'command': 'query-iothreads', 'returns': ['IOThreadInfo'],
136 'allow-preconfig': true }
137
138 ##
139 # @stop:
140 #
141 # Stop guest VM execution.
142 #
143 # Since: 0.14
144 #
145 # .. note:: This function will succeed even if the guest is already in
146 # the stopped state. In "inmigrate" state, it will ensure that the
147 # guest remains paused once migration finishes, as if the ``-S``
148 # option was passed on the command line.
149 #
150 # In the "suspended" state, it will completely stop the VM and
151 # cause a transition to the "paused" state. (Since 9.0)
152 #
153 # .. qmp-example::
154 #
155 # -> { "execute": "stop" }
156 # <- { "return": {} }
157 ##
158 { 'command': 'stop' }
159
160 ##
161 # @cont:
162 #
163 # Resume guest VM execution.
164 #
165 # Since: 0.14
166 #
167 # .. note:: This command will succeed if the guest is currently
168 # running. It will also succeed if the guest is in the "inmigrate"
169 # state; in this case, the effect of the command is to make sure
170 # the guest starts once migration finishes, removing the effect of
171 # the ``-S`` command line option if it was passed.
172 #
173 # If the VM was previously suspended, and not been reset or woken,
174 # this command will transition back to the "suspended" state.
175 # (Since 9.0)
176 #
177 # .. qmp-example::
178 #
179 # -> { "execute": "cont" }
180 # <- { "return": {} }
181 ##
182 { 'command': 'cont' }
183
184 ##
185 # @x-exit-preconfig:
186 #
187 # Exit from "preconfig" state
188 #
189 # This command makes QEMU exit the preconfig state and proceed with VM
190 # initialization using configuration data provided on the command line
191 # and via the QMP monitor during the preconfig state. The command is
192 # only available during the preconfig state (i.e. when the --preconfig
193 # command line option was in use).
194 #
195 # Features:
196 #
197 # @unstable: This command is experimental.
198 #
199 # Since: 3.0
200 #
201 # .. qmp-example::
202 #
203 # -> { "execute": "x-exit-preconfig" }
204 # <- { "return": {} }
205 ##
206 { 'command': 'x-exit-preconfig', 'allow-preconfig': true,
207 'features': [ 'unstable' ] }
208
209 ##
210 # @human-monitor-command:
211 #
212 # Execute a command on the human monitor and return the output.
213 #
214 # @command-line: the command to execute in the human monitor
215 #
216 # @cpu-index: The CPU to use for commands that require an implicit CPU
217 #
218 # Features:
219 #
220 # @savevm-monitor-nodes: If present, HMP command savevm only snapshots
221 # monitor-owned nodes if they have no parents. This allows the
222 # use of 'savevm' with -blockdev. (since 4.2)
223 #
224 # Returns: the output of the command as a string
225 #
226 # Since: 0.14
227 #
228 # .. note:: This command only exists as a stop-gap. Its use is highly
229 # discouraged. The semantics of this command are not guaranteed:
230 # this means that command names, arguments and responses can change
231 # or be removed at **any** time. Applications that rely on long
232 # term stability guarantees should **not** use this command.
233 #
234 # Known limitations:
235 #
236 # * This command is stateless, this means that commands that depend
237 # on state information (such as `getfd`) might not work.
238 #
239 # * Commands that prompt the user for data don't currently work.
240 #
241 # .. qmp-example::
242 #
243 # -> { "execute": "human-monitor-command",
244 # "arguments": { "command-line": "info kvm" } }
245 # <- { "return": "kvm support: enabled\r\n" }
246 ##
247 { 'command': 'human-monitor-command',
248 'data': {'command-line': 'str', '*cpu-index': 'int'},
249 'returns': 'str',
250 'features': [ 'savevm-monitor-nodes' ],
251 'if': 'CONFIG_HMP' }
252
253 ##
254 # @getfd:
255 #
256 # Receive a file descriptor via SCM rights and assign it a name
257 #
258 # @fdname: file descriptor name
259 #
260 # Since: 0.14
261 #
262 # .. note:: If @fdname already exists, the file descriptor assigned to
263 # it will be closed and replaced by the received file descriptor.
264 #
265 # The `closefd` command can be used to explicitly close the file
266 # descriptor when it is no longer needed.
267 #
268 # .. qmp-example::
269 #
270 # -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
271 # <- { "return": {} }
272 ##
273 { 'command': 'getfd', 'data': {'fdname': 'str'}, 'if': 'CONFIG_POSIX' }
274
275 ##
276 # @get-win32-socket:
277 #
278 # Add a socket that was duplicated to QEMU process with
279 # WSADuplicateSocketW() via WSASocket() & WSAPROTOCOL_INFOW structure
280 # and assign it a name (the SOCKET is associated with a CRT file
281 # descriptor)
282 #
283 # @info: the WSAPROTOCOL_INFOW structure (encoded in base64)
284 #
285 # @fdname: file descriptor name
286 #
287 # Since: 8.0
288 #
289 # .. note:: If @fdname already exists, the file descriptor assigned to
290 # it will be closed and replaced by the received file descriptor.
291 #
292 # The `closefd` command can be used to explicitly close the file
293 # descriptor when it is no longer needed.
294 #
295 # .. qmp-example::
296 #
297 # -> { "execute": "get-win32-socket",
298 # "arguments": { "info": "abcd123..", "fdname": "skclient" } }
299 # <- { "return": {} }
300 ##
301 { 'command': 'get-win32-socket', 'data': {'info': 'str', 'fdname': 'str'}, 'if': 'CONFIG_WIN32' }
302
303 ##
304 # @closefd:
305 #
306 # Close a file descriptor previously passed via SCM rights
307 #
308 # @fdname: file descriptor name
309 #
310 # Since: 0.14
311 #
312 # .. qmp-example::
313 #
314 # -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
315 # <- { "return": {} }
316 ##
317 { 'command': 'closefd', 'data': {'fdname': 'str'} }
318
319 ##
320 # @AddfdInfo:
321 #
322 # Information about a file descriptor that was added to an fd set.
323 #
324 # @fdset-id: The ID of the fd set that @fd was added to.
325 #
326 # @fd: The file descriptor that was received via SCM rights and added
327 # to the fd set.
328 #
329 # Since: 1.2
330 ##
331 { 'struct': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
332
333 ##
334 # @add-fd:
335 #
336 # Add a file descriptor, that was passed via SCM rights, to an fd set.
337 #
338 # @fdset-id: The ID of the fd set to add the file descriptor to.
339 #
340 # @opaque: A free-form string that can be used to describe the fd.
341 #
342 # Errors:
343 # - If file descriptor was not received, GenericError
344 # - If @fdset-id is a negative value, GenericError
345 #
346 # .. note:: The list of fd sets is shared by all monitor connections.
347 #
348 # .. note:: If @fdset-id is not specified, a new fd set will be
349 # created.
350 #
351 # Since: 1.2
352 #
353 # .. qmp-example::
354 #
355 # -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
356 # <- { "return": { "fdset-id": 1, "fd": 3 } }
357 ##
358 { 'command': 'add-fd',
359 'data': { '*fdset-id': 'int',
360 '*opaque': 'str' },
361 'returns': 'AddfdInfo' }
362
363 ##
364 # @remove-fd:
365 #
366 # Remove a file descriptor from an fd set.
367 #
368 # @fdset-id: The ID of the fd set that the file descriptor belongs to.
369 #
370 # @fd: The file descriptor that is to be removed.
371 #
372 # Errors:
373 # - If @fdset-id or @fd is not found, GenericError
374 #
375 # Since: 1.2
376 #
377 # .. note:: The list of fd sets is shared by all monitor connections.
378 #
379 # .. note:: If @fd is not specified, all file descriptors in @fdset-id
380 # will be removed.
381 #
382 # .. qmp-example::
383 #
384 # -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
385 # <- { "return": {} }
386 ##
387 { 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
388
389 ##
390 # @FdsetFdInfo:
391 #
392 # Information about a file descriptor that belongs to an fd set.
393 #
394 # @fd: The file descriptor value.
395 #
396 # @opaque: A free-form string that can be used to describe the fd.
397 #
398 # Since: 1.2
399 ##
400 { 'struct': 'FdsetFdInfo',
401 'data': {'fd': 'int', '*opaque': 'str'} }
402
403 ##
404 # @FdsetInfo:
405 #
406 # Information about an fd set.
407 #
408 # @fdset-id: The ID of the fd set.
409 #
410 # @fds: A list of file descriptors that belong to this fd set.
411 #
412 # Since: 1.2
413 ##
414 { 'struct': 'FdsetInfo',
415 'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
416
417 ##
418 # @query-fdsets:
419 #
420 # Return information describing all fd sets.
421 #
422 # Since: 1.2
423 #
424 # .. note:: The list of fd sets is shared by all monitor connections.
425 #
426 # .. qmp-example::
427 #
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 # }
456 ##
457 { 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
458
459 ##
460 # @CommandLineParameterType:
461 #
462 # Possible types for an option parameter.
463 #
464 # @string: accepts a character string
465 #
466 # @boolean: accepts "on" or "off"
467 #
468 # @number: accepts a number
469 #
470 # @size: accepts a number followed by an optional suffix (K)ilo,
471 # (M)ega, (G)iga, (T)era
472 #
473 # Since: 1.5
474 ##
475 { 'enum': 'CommandLineParameterType',
476 'data': ['string', 'boolean', 'number', 'size'] }
477
478 ##
479 # @CommandLineParameterInfo:
480 #
481 # Details about a single parameter of a command line option.
482 #
483 # @name: parameter name
484 #
485 # @type: parameter `CommandLineParameterType`
486 #
487 # @help: human readable text string, not suitable for parsing.
488 #
489 # @default: default value string (since 2.1)
490 #
491 # Since: 1.5
492 ##
493 { 'struct': 'CommandLineParameterInfo',
494 'data': { 'name': 'str',
495 'type': 'CommandLineParameterType',
496 '*help': 'str',
497 '*default': 'str' } }
498
499 ##
500 # @CommandLineOptionInfo:
501 #
502 # Details about a command line option, including its list of parameter
503 # details
504 #
505 # @option: option name
506 #
507 # @parameters: an array of `CommandLineParameterInfo`
508 #
509 # Since: 1.5
510 ##
511 { 'struct': 'CommandLineOptionInfo',
512 'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
513
514 ##
515 # @query-command-line-options:
516 #
517 # Query command line option schema.
518 #
519 # @option: option name
520 #
521 # Returns: list of objects for all options (or for the given @option).
522 #
523 # Errors:
524 # - if the given @option doesn't exist
525 #
526 # Since: 1.5
527 #
528 # .. qmp-example::
529 #
530 # -> { "execute": "query-command-line-options",
531 # "arguments": { "option": "option-rom" } }
532 # <- { "return": [
533 # {
534 # "parameters": [
535 # {
536 # "name": "romfile",
537 # "type": "string"
538 # },
539 # {
540 # "name": "bootindex",
541 # "type": "number"
542 # }
543 # ],
544 # "option": "option-rom"
545 # }
546 # ]
547 # }
548 ##
549 {'command': 'query-command-line-options',
550 'data': {'*option': 'str'},
551 'returns': ['CommandLineOptionInfo'],
552 'allow-preconfig': true}
553
554 ##
555 # @RTC_CHANGE:
556 #
557 # Emitted when the guest changes the RTC time.
558 #
559 # @offset: offset in seconds between base RTC clock (as specified by
560 # -rtc base), and new RTC clock value
561 #
562 # @qom-path: path to the RTC object in the QOM tree
563 #
564 # .. note:: This event is rate-limited. It is not guaranteed that the
565 # RTC in the system implements this event, or even that the system
566 # has an RTC at all.
567 #
568 # Since: 0.13
569 #
570 # .. qmp-example::
571 #
572 # <- { "event": "RTC_CHANGE",
573 # "data": { "offset": 78 },
574 # "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
575 ##
576 { 'event': 'RTC_CHANGE',
577 'data': { 'offset': 'int', 'qom-path': 'str' } }
578
579 ##
580 # @VFU_CLIENT_HANGUP:
581 #
582 # Emitted when the client of a TYPE_VFIO_USER_SERVER closes the
583 # communication channel
584 #
585 # @vfu-id: ID of the TYPE_VFIO_USER_SERVER object. It is the last
586 # component of @vfu-qom-path referenced below
587 #
588 # @vfu-qom-path: path to the TYPE_VFIO_USER_SERVER object in the QOM
589 # tree
590 #
591 # @dev-id: ID of attached PCI device
592 #
593 # @dev-qom-path: path to attached PCI device in the QOM tree
594 #
595 # Since: 7.1
596 #
597 # .. qmp-example::
598 #
599 # <- { "event": "VFU_CLIENT_HANGUP",
600 # "data": { "vfu-id": "vfu1",
601 # "vfu-qom-path": "/objects/vfu1",
602 # "dev-id": "sas1",
603 # "dev-qom-path": "/machine/peripheral/sas1" },
604 # "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
605 ##
606 { 'event': 'VFU_CLIENT_HANGUP',
607 'data': { 'vfu-id': 'str', 'vfu-qom-path': 'str',
608 'dev-id': 'str', 'dev-qom-path': 'str' } }