]> git.proxmox.com Git - mirror_qemu.git/blame - qapi/misc.json
backends/iommufd: Introduce the iommufd object
[mirror_qemu.git] / qapi / misc.json
CommitLineData
112ed241 1# -*- Mode: Python -*-
f7160f32 2# vim: filetype=python
112ed241
MA
3#
4
5##
6# = Miscellanea
7##
8
b47aa7b3
LE
9{ 'include': 'common.json' }
10
112ed241
MA
11##
12# @add_client:
13#
a937b6aa
MA
14# Allow client connections for VNC, Spice and socket based character
15# devices to be passed in to QEMU via SCM_RIGHTS.
112ed241 16#
a937b6aa
MA
17# If the FD associated with @fdname is not a socket, the command will
18# fail and the FD will be closed.
bf5de8c5 19#
a937b6aa 20# @protocol: protocol name. Valid names are "vnc", "spice",
ff62c210 21# "@dbus-display" or the name of a character device (e.g. from
a937b6aa 22# -chardev id=XXXX)
112ed241
MA
23#
24# @fdname: file descriptor name previously passed via 'getfd' command
25#
a937b6aa
MA
26# @skipauth: whether to skip authentication. Only applies to "vnc"
27# and "spice" protocols
112ed241 28#
a937b6aa 29# @tls: whether to perform TLS. Only applies to the "spice" protocol
112ed241
MA
30#
31# Returns: nothing on success.
32#
9bc6e893 33# Since: 0.14
112ed241
MA
34#
35# Example:
36#
37# -> { "execute": "add_client", "arguments": { "protocol": "vnc",
38# "fdname": "myclient" } }
39# <- { "return": {} }
112ed241
MA
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#
9bc6e893 52# Since: 0.14
112ed241
MA
53##
54{ 'struct': 'NameInfo', 'data': {'*name': 'str'} }
55
56##
57# @query-name:
58#
59# Return the name information of a guest.
60#
61# Returns: @NameInfo of the guest
62#
9bc6e893 63# Since: 0.14
112ed241
MA
64#
65# Example:
66#
67# -> { "execute": "query-name" }
68# <- { "return": { "name": "qemu-name" } }
112ed241 69##
a87706c8 70{ 'command': 'query-name', 'returns': 'NameInfo', 'allow-preconfig': true }
112ed241 71
112ed241
MA
72##
73# @IOThreadInfo:
74#
75# Information about an iothread
76#
77# @id: the identifier of the iothread
78#
79# @thread-id: ID of the underlying host thread
80#
a937b6aa
MA
81# @poll-max-ns: maximum polling time in ns, 0 means polling is
82# disabled (since 2.9)
112ed241 83#
a937b6aa
MA
84# @poll-grow: how many ns will be added to polling time, 0 means that
85# it's not configured (since 2.9)
112ed241 86#
a937b6aa
MA
87# @poll-shrink: how many ns will be removed from polling time, 0 means
88# that it's not configured (since 2.9)
112ed241 89#
a937b6aa
MA
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)
1793ad02 92#
112ed241
MA
93# Since: 2.0
94##
95{ 'struct': 'IOThreadInfo',
96 'data': {'id': 'str',
97 'thread-id': 'int',
98 'poll-max-ns': 'int',
99 'poll-grow': 'int',
1793ad02
SG
100 'poll-shrink': 'int',
101 'aio-max-batch': 'int' } }
112ed241
MA
102
103##
104# @query-iothreads:
105#
106# Returns a list of information about each iothread.
107#
a937b6aa
MA
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.
112ed241
MA
111#
112# Returns: a list of @IOThreadInfo for each iothread
113#
114# Since: 2.0
115#
116# Example:
117#
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# }
112ed241 130##
a87706c8
IM
131{ 'command': 'query-iothreads', 'returns': ['IOThreadInfo'],
132 'allow-preconfig': true }
112ed241 133
112ed241
MA
134##
135# @stop:
136#
137# Stop all guest VCPU execution.
138#
23e46452 139# Since: 0.14
112ed241 140#
a937b6aa
MA
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.
112ed241
MA
145#
146# Example:
147#
148# -> { "execute": "stop" }
149# <- { "return": {} }
112ed241
MA
150##
151{ 'command': 'stop' }
152
112ed241
MA
153##
154# @cont:
155#
156# Resume guest VCPU execution.
157#
23e46452 158# Since: 0.14
112ed241 159#
23e46452 160# Returns: If successful, nothing
112ed241 161#
a937b6aa
MA
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.
112ed241
MA
167#
168# Example:
169#
170# -> { "execute": "cont" }
171# <- { "return": {} }
112ed241
MA
172##
173{ 'command': 'cont' }
174
047f7038 175##
361ac948 176# @x-exit-preconfig:
047f7038
IM
177#
178# Exit from "preconfig" state
179#
a937b6aa
MA
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).
047f7038 185#
9fb49daa 186# Features:
a937b6aa 187#
9fb49daa
MA
188# @unstable: This command is experimental.
189#
433a4fdc 190# Since: 3.0
047f7038
IM
191#
192# Returns: nothing
193#
194# Example:
195#
361ac948 196# -> { "execute": "x-exit-preconfig" }
047f7038 197# <- { "return": {} }
047f7038 198##
9fb49daa
MA
199{ 'command': 'x-exit-preconfig', 'allow-preconfig': true,
200 'features': [ 'unstable' ] }
047f7038 201
112ed241
MA
202##
203# @human-monitor-command:
204#
205# Execute a command on the human monitor and return the output.
206#
207# @command-line: the command to execute in the human monitor
208#
209# @cpu-index: The CPU to use for commands that require an implicit CPU
210#
5f76a7aa 211# Features:
a937b6aa 212#
5f76a7aa 213# @savevm-monitor-nodes: If present, HMP command savevm only snapshots
a937b6aa
MA
214# monitor-owned nodes if they have no parents. This allows the
215# use of 'savevm' with -blockdev. (since 4.2)
5f76a7aa 216#
112ed241
MA
217# Returns: the output of the command as a string
218#
9bc6e893 219# Since: 0.14
112ed241
MA
220#
221# Notes: This command only exists as a stop-gap. Its use is highly
a937b6aa
MA
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.
112ed241 226#
a937b6aa 227# Known limitations:
112ed241 228#
a937b6aa
MA
229# * This command is stateless, this means that commands that
230# depend on state information (such as getfd) might not work
112ed241 231#
a937b6aa 232# * Commands that prompt the user for data don't currently work
112ed241
MA
233#
234# Example:
235#
236# -> { "execute": "human-monitor-command",
237# "arguments": { "command-line": "info kvm" } }
238# <- { "return": "kvm support: enabled\r\n" }
112ed241
MA
239##
240{ 'command': 'human-monitor-command',
241 'data': {'command-line': 'str', '*cpu-index': 'int'},
5f76a7aa
PK
242 'returns': 'str',
243 'features': [ 'savevm-monitor-nodes' ] }
112ed241 244
112ed241
MA
245##
246# @getfd:
247#
248# Receive a file descriptor via SCM rights and assign it a name
249#
250# @fdname: file descriptor name
251#
252# Returns: Nothing on success
253#
9bc6e893 254# Since: 0.14
112ed241 255#
a937b6aa
MA
256# Notes: If @fdname already exists, the file descriptor assigned to it
257# will be closed and replaced by the received file descriptor.
112ed241 258#
a937b6aa
MA
259# The 'closefd' command can be used to explicitly close the file
260# descriptor when it is no longer needed.
112ed241
MA
261#
262# Example:
263#
264# -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
265# <- { "return": {} }
112ed241 266##
4bf21c7f 267{ 'command': 'getfd', 'data': {'fdname': 'str'}, 'if': 'CONFIG_POSIX' }
112ed241 268
4cda177c
MAL
269##
270# @get-win32-socket:
271#
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)
276#
277# @info: the WSAPROTOCOL_INFOW structure (encoded in base64)
278#
279# @fdname: file descriptor name
280#
281# Returns: Nothing on success
282#
283# Since: 8.0
284#
a937b6aa
MA
285# Notes: If @fdname already exists, the file descriptor assigned to it
286# will be closed and replaced by the received file descriptor.
4cda177c 287#
a937b6aa
MA
288# The 'closefd' command can be used to explicitly close the file
289# descriptor when it is no longer needed.
4cda177c
MAL
290#
291# Example:
292#
293# -> { "execute": "get-win32-socket", "arguments": { "info": "abcd123..", fdname": "skclient" } }
294# <- { "return": {} }
4cda177c
MAL
295##
296{ 'command': 'get-win32-socket', 'data': {'info': 'str', 'fdname': 'str'}, 'if': 'CONFIG_WIN32' }
297
112ed241
MA
298##
299# @closefd:
300#
301# Close a file descriptor previously passed via SCM rights
302#
303# @fdname: file descriptor name
304#
305# Returns: Nothing on success
306#
9bc6e893 307# Since: 0.14
112ed241
MA
308#
309# Example:
310#
311# -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
312# <- { "return": {} }
112ed241
MA
313##
314{ 'command': 'closefd', 'data': {'fdname': 'str'} }
315
112ed241
MA
316##
317# @AddfdInfo:
318#
319# Information about a file descriptor that was added to an fd set.
320#
321# @fdset-id: The ID of the fd set that @fd was added to.
322#
a937b6aa
MA
323# @fd: The file descriptor that was received via SCM rights and added
324# to the fd set.
112ed241 325#
9bc6e893 326# Since: 1.2
112ed241
MA
327##
328{ 'struct': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
329
330##
331# @add-fd:
332#
333# Add a file descriptor, that was passed via SCM rights, to an fd set.
334#
335# @fdset-id: The ID of the fd set to add the file descriptor to.
336#
337# @opaque: A free-form string that can be used to describe the fd.
338#
a937b6aa
MA
339# Returns:
340# - @AddfdInfo on success
341# - If file descriptor was not received, GenericError
342# - If @fdset-id is a negative value, GenericError
112ed241
MA
343#
344# Notes: The list of fd sets is shared by all monitor connections.
345#
a937b6aa 346# If @fdset-id is not specified, a new fd set will be created.
112ed241 347#
9bc6e893 348# Since: 1.2
112ed241
MA
349#
350# Example:
351#
352# -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
353# <- { "return": { "fdset-id": 1, "fd": 3 } }
112ed241 354##
b0ddeba2
MAL
355{ 'command': 'add-fd',
356 'data': { '*fdset-id': 'int',
357 '*opaque': 'str' },
112ed241
MA
358 'returns': 'AddfdInfo' }
359
360##
361# @remove-fd:
362#
363# Remove a file descriptor from an fd set.
364#
365# @fdset-id: The ID of the fd set that the file descriptor belongs to.
366#
367# @fd: The file descriptor that is to be removed.
368#
a937b6aa
MA
369# Returns:
370# - Nothing on success
371# - If @fdset-id or @fd is not found, GenericError
112ed241 372#
9bc6e893 373# Since: 1.2
112ed241
MA
374#
375# Notes: The list of fd sets is shared by all monitor connections.
376#
a937b6aa
MA
377# If @fd is not specified, all file descriptors in @fdset-id will be
378# removed.
112ed241
MA
379#
380# Example:
381#
382# -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
383# <- { "return": {} }
112ed241
MA
384##
385{ 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
386
387##
388# @FdsetFdInfo:
389#
390# Information about a file descriptor that belongs to an fd set.
391#
392# @fd: The file descriptor value.
393#
394# @opaque: A free-form string that can be used to describe the fd.
395#
9bc6e893 396# Since: 1.2
112ed241
MA
397##
398{ 'struct': 'FdsetFdInfo',
399 'data': {'fd': 'int', '*opaque': 'str'} }
400
401##
402# @FdsetInfo:
403#
404# Information about an fd set.
405#
406# @fdset-id: The ID of the fd set.
407#
408# @fds: A list of file descriptors that belong to this fd set.
409#
9bc6e893 410# Since: 1.2
112ed241
MA
411##
412{ 'struct': 'FdsetInfo',
413 'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
414
415##
416# @query-fdsets:
417#
418# Return information describing all fd sets.
419#
420# Returns: A list of @FdsetInfo
421#
9bc6e893 422# Since: 1.2
112ed241
MA
423#
424# Note: The list of fd sets is shared by all monitor connections.
425#
426# 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# }
112ed241
MA
456##
457{ 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
458
112ed241
MA
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,
a937b6aa 471# (M)ega, (G)iga, (T)era
112ed241
MA
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#
a937b6aa
MA
502# Details about a command line option, including its list of parameter
503# details
112ed241
MA
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#
a937b6aa
MA
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.
112ed241
MA
524#
525# Since: 1.5
526#
527# Example:
528#
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# }
112ed241 547##
b0ddeba2 548{'command': 'query-command-line-options',
a937b6aa 549 'data': {'*option': 'str'},
d6fe3d02 550 'returns': ['CommandLineOptionInfo'],
a937b6aa 551 'allow-preconfig': true}
1f216b8c
PM
552
553##
554# @RTC_CHANGE:
555#
556# Emitted when the guest changes the RTC time.
557#
a937b6aa
MA
558# @offset: offset in seconds between base RTC clock (as specified by
559# -rtc base), and new RTC clock value
1f216b8c 560#
2beb1e5f
MA
561# @qom-path: path to the RTC object in the QOM tree
562#
a937b6aa
MA
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.
1f216b8c
PM
566#
567# Since: 0.13
568#
569# Example:
570#
37fa48a4
MA
571# <- { "event": "RTC_CHANGE",
572# "data": { "offset": 78 },
573# "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
1f216b8c
PM
574##
575{ 'event': 'RTC_CHANGE',
2beb1e5f 576 'data': { 'offset': 'int', 'qom-path': 'str' } }
9fb3fba1
JR
577
578##
579# @VFU_CLIENT_HANGUP:
580#
581# Emitted when the client of a TYPE_VFIO_USER_SERVER closes the
582# communication channel
583#
a937b6aa
MA
584# @vfu-id: ID of the TYPE_VFIO_USER_SERVER object. It is the last
585# component of @vfu-qom-path referenced below
9fb3fba1 586#
a937b6aa
MA
587# @vfu-qom-path: path to the TYPE_VFIO_USER_SERVER object in the QOM
588# tree
9fb3fba1
JR
589#
590# @dev-id: ID of attached PCI device
591#
592# @dev-qom-path: path to attached PCI device in the QOM tree
593#
594# Since: 7.1
595#
596# Example:
597#
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 } }
9fb3fba1
JR
604##
605{ 'event': 'VFU_CLIENT_HANGUP',
606 'data': { 'vfu-id': 'str', 'vfu-qom-path': 'str',
607 'dev-id': 'str', 'dev-qom-path': 'str' } }