]> git.proxmox.com Git - mirror_qemu.git/blame - qapi/misc.json
monitor: only run coroutine commands in qemu_aio_context
[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#
b9ae473d 137# Stop guest VM execution.
112ed241 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 145#
b9ae473d
SS
146# In the "suspended" state, it will completely stop the VM and
147# cause a transition to the "paused" state. (Since 9.0)
148#
112ed241
MA
149# Example:
150#
151# -> { "execute": "stop" }
152# <- { "return": {} }
112ed241
MA
153##
154{ 'command': 'stop' }
155
112ed241
MA
156##
157# @cont:
158#
b9ae473d 159# Resume guest VM execution.
112ed241 160#
23e46452 161# Since: 0.14
112ed241 162#
23e46452 163# Returns: If successful, nothing
112ed241 164#
a937b6aa
MA
165# Notes: This command will succeed if the guest is currently running.
166# It will also succeed if the guest is in the "inmigrate" state;
167# in this case, the effect of the command is to make sure the
168# guest starts once migration finishes, removing the effect of the
169# -S command line option if it was passed.
112ed241 170#
b9ae473d
SS
171# If the VM was previously suspended, and not been reset or woken,
172# this command will transition back to the "suspended" state.
173# (Since 9.0)
174#
112ed241
MA
175# Example:
176#
177# -> { "execute": "cont" }
178# <- { "return": {} }
112ed241
MA
179##
180{ 'command': 'cont' }
181
047f7038 182##
361ac948 183# @x-exit-preconfig:
047f7038
IM
184#
185# Exit from "preconfig" state
186#
a937b6aa
MA
187# This command makes QEMU exit the preconfig state and proceed with VM
188# initialization using configuration data provided on the command line
189# and via the QMP monitor during the preconfig state. The command is
190# only available during the preconfig state (i.e. when the --preconfig
191# command line option was in use).
047f7038 192#
9fb49daa 193# Features:
a937b6aa 194#
9fb49daa
MA
195# @unstable: This command is experimental.
196#
433a4fdc 197# Since: 3.0
047f7038
IM
198#
199# Returns: nothing
200#
201# Example:
202#
361ac948 203# -> { "execute": "x-exit-preconfig" }
047f7038 204# <- { "return": {} }
047f7038 205##
9fb49daa
MA
206{ 'command': 'x-exit-preconfig', 'allow-preconfig': true,
207 'features': [ 'unstable' ] }
047f7038 208
112ed241
MA
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#
5f76a7aa 218# Features:
a937b6aa 219#
5f76a7aa 220# @savevm-monitor-nodes: If present, HMP command savevm only snapshots
a937b6aa
MA
221# monitor-owned nodes if they have no parents. This allows the
222# use of 'savevm' with -blockdev. (since 4.2)
5f76a7aa 223#
112ed241
MA
224# Returns: the output of the command as a string
225#
9bc6e893 226# Since: 0.14
112ed241
MA
227#
228# Notes: This command only exists as a stop-gap. Its use is highly
a937b6aa
MA
229# discouraged. The semantics of this command are not guaranteed:
230# this means that command names, arguments and responses can
231# change or be removed at ANY time. Applications that rely on
232# long term stability guarantees should NOT use this command.
112ed241 233#
a937b6aa 234# Known limitations:
112ed241 235#
a937b6aa
MA
236# * This command is stateless, this means that commands that
237# depend on state information (such as getfd) might not work
112ed241 238#
a937b6aa 239# * Commands that prompt the user for data don't currently work
112ed241
MA
240#
241# Example:
242#
243# -> { "execute": "human-monitor-command",
244# "arguments": { "command-line": "info kvm" } }
245# <- { "return": "kvm support: enabled\r\n" }
112ed241
MA
246##
247{ 'command': 'human-monitor-command',
248 'data': {'command-line': 'str', '*cpu-index': 'int'},
5f76a7aa
PK
249 'returns': 'str',
250 'features': [ 'savevm-monitor-nodes' ] }
112ed241 251
112ed241
MA
252##
253# @getfd:
254#
255# Receive a file descriptor via SCM rights and assign it a name
256#
257# @fdname: file descriptor name
258#
259# Returns: Nothing on success
260#
9bc6e893 261# Since: 0.14
112ed241 262#
a937b6aa
MA
263# Notes: If @fdname already exists, the file descriptor assigned to it
264# will be closed and replaced by the received file descriptor.
112ed241 265#
a937b6aa
MA
266# The 'closefd' command can be used to explicitly close the file
267# descriptor when it is no longer needed.
112ed241
MA
268#
269# Example:
270#
271# -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
272# <- { "return": {} }
112ed241 273##
4bf21c7f 274{ 'command': 'getfd', 'data': {'fdname': 'str'}, 'if': 'CONFIG_POSIX' }
112ed241 275
4cda177c
MAL
276##
277# @get-win32-socket:
278#
279# Add a socket that was duplicated to QEMU process with
280# WSADuplicateSocketW() via WSASocket() & WSAPROTOCOL_INFOW structure
281# and assign it a name (the SOCKET is associated with a CRT file
282# descriptor)
283#
284# @info: the WSAPROTOCOL_INFOW structure (encoded in base64)
285#
286# @fdname: file descriptor name
287#
288# Returns: Nothing on success
289#
290# Since: 8.0
291#
a937b6aa
MA
292# Notes: If @fdname already exists, the file descriptor assigned to it
293# will be closed and replaced by the received file descriptor.
4cda177c 294#
a937b6aa
MA
295# The 'closefd' command can be used to explicitly close the file
296# descriptor when it is no longer needed.
4cda177c
MAL
297#
298# Example:
299#
300# -> { "execute": "get-win32-socket", "arguments": { "info": "abcd123..", fdname": "skclient" } }
301# <- { "return": {} }
4cda177c
MAL
302##
303{ 'command': 'get-win32-socket', 'data': {'info': 'str', 'fdname': 'str'}, 'if': 'CONFIG_WIN32' }
304
112ed241
MA
305##
306# @closefd:
307#
308# Close a file descriptor previously passed via SCM rights
309#
310# @fdname: file descriptor name
311#
312# Returns: Nothing on success
313#
9bc6e893 314# Since: 0.14
112ed241
MA
315#
316# Example:
317#
318# -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
319# <- { "return": {} }
112ed241
MA
320##
321{ 'command': 'closefd', 'data': {'fdname': 'str'} }
322
112ed241
MA
323##
324# @AddfdInfo:
325#
326# Information about a file descriptor that was added to an fd set.
327#
328# @fdset-id: The ID of the fd set that @fd was added to.
329#
a937b6aa
MA
330# @fd: The file descriptor that was received via SCM rights and added
331# to the fd set.
112ed241 332#
9bc6e893 333# Since: 1.2
112ed241
MA
334##
335{ 'struct': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
336
337##
338# @add-fd:
339#
340# Add a file descriptor, that was passed via SCM rights, to an fd set.
341#
342# @fdset-id: The ID of the fd set to add the file descriptor to.
343#
344# @opaque: A free-form string that can be used to describe the fd.
345#
a937b6aa
MA
346# Returns:
347# - @AddfdInfo on success
348# - If file descriptor was not received, GenericError
349# - If @fdset-id is a negative value, GenericError
112ed241
MA
350#
351# Notes: The list of fd sets is shared by all monitor connections.
352#
a937b6aa 353# If @fdset-id is not specified, a new fd set will be created.
112ed241 354#
9bc6e893 355# Since: 1.2
112ed241
MA
356#
357# Example:
358#
359# -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
360# <- { "return": { "fdset-id": 1, "fd": 3 } }
112ed241 361##
b0ddeba2
MAL
362{ 'command': 'add-fd',
363 'data': { '*fdset-id': 'int',
364 '*opaque': 'str' },
112ed241
MA
365 'returns': 'AddfdInfo' }
366
367##
368# @remove-fd:
369#
370# Remove a file descriptor from an fd set.
371#
372# @fdset-id: The ID of the fd set that the file descriptor belongs to.
373#
374# @fd: The file descriptor that is to be removed.
375#
a937b6aa
MA
376# Returns:
377# - Nothing on success
378# - If @fdset-id or @fd is not found, GenericError
112ed241 379#
9bc6e893 380# Since: 1.2
112ed241
MA
381#
382# Notes: The list of fd sets is shared by all monitor connections.
383#
a937b6aa
MA
384# If @fd is not specified, all file descriptors in @fdset-id will be
385# removed.
112ed241
MA
386#
387# Example:
388#
389# -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
390# <- { "return": {} }
112ed241
MA
391##
392{ 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
393
394##
395# @FdsetFdInfo:
396#
397# Information about a file descriptor that belongs to an fd set.
398#
399# @fd: The file descriptor value.
400#
401# @opaque: A free-form string that can be used to describe the fd.
402#
9bc6e893 403# Since: 1.2
112ed241
MA
404##
405{ 'struct': 'FdsetFdInfo',
406 'data': {'fd': 'int', '*opaque': 'str'} }
407
408##
409# @FdsetInfo:
410#
411# Information about an fd set.
412#
413# @fdset-id: The ID of the fd set.
414#
415# @fds: A list of file descriptors that belong to this fd set.
416#
9bc6e893 417# Since: 1.2
112ed241
MA
418##
419{ 'struct': 'FdsetInfo',
420 'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
421
422##
423# @query-fdsets:
424#
425# Return information describing all fd sets.
426#
427# Returns: A list of @FdsetInfo
428#
9bc6e893 429# Since: 1.2
112ed241
MA
430#
431# Note: The list of fd sets is shared by all monitor connections.
432#
433# Example:
434#
435# -> { "execute": "query-fdsets" }
436# <- { "return": [
437# {
438# "fds": [
439# {
440# "fd": 30,
441# "opaque": "rdonly:/path/to/file"
442# },
443# {
444# "fd": 24,
445# "opaque": "rdwr:/path/to/file"
446# }
447# ],
448# "fdset-id": 1
449# },
450# {
451# "fds": [
452# {
453# "fd": 28
454# },
455# {
456# "fd": 29
457# }
458# ],
459# "fdset-id": 0
460# }
461# ]
462# }
112ed241
MA
463##
464{ 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
465
112ed241
MA
466##
467# @CommandLineParameterType:
468#
469# Possible types for an option parameter.
470#
471# @string: accepts a character string
472#
473# @boolean: accepts "on" or "off"
474#
475# @number: accepts a number
476#
477# @size: accepts a number followed by an optional suffix (K)ilo,
a937b6aa 478# (M)ega, (G)iga, (T)era
112ed241
MA
479#
480# Since: 1.5
481##
482{ 'enum': 'CommandLineParameterType',
483 'data': ['string', 'boolean', 'number', 'size'] }
484
485##
486# @CommandLineParameterInfo:
487#
488# Details about a single parameter of a command line option.
489#
490# @name: parameter name
491#
492# @type: parameter @CommandLineParameterType
493#
494# @help: human readable text string, not suitable for parsing.
495#
496# @default: default value string (since 2.1)
497#
498# Since: 1.5
499##
500{ 'struct': 'CommandLineParameterInfo',
501 'data': { 'name': 'str',
502 'type': 'CommandLineParameterType',
503 '*help': 'str',
504 '*default': 'str' } }
505
506##
507# @CommandLineOptionInfo:
508#
a937b6aa
MA
509# Details about a command line option, including its list of parameter
510# details
112ed241
MA
511#
512# @option: option name
513#
514# @parameters: an array of @CommandLineParameterInfo
515#
516# Since: 1.5
517##
518{ 'struct': 'CommandLineOptionInfo',
519 'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
520
521##
522# @query-command-line-options:
523#
524# Query command line option schema.
525#
526# @option: option name
527#
a937b6aa
MA
528# Returns: list of @CommandLineOptionInfo for all options (or for the
529# given @option). Returns an error if the given @option doesn't
530# exist.
112ed241
MA
531#
532# Since: 1.5
533#
534# Example:
535#
536# -> { "execute": "query-command-line-options",
537# "arguments": { "option": "option-rom" } }
538# <- { "return": [
539# {
540# "parameters": [
541# {
542# "name": "romfile",
543# "type": "string"
544# },
545# {
546# "name": "bootindex",
547# "type": "number"
548# }
549# ],
550# "option": "option-rom"
551# }
552# ]
553# }
112ed241 554##
b0ddeba2 555{'command': 'query-command-line-options',
a937b6aa 556 'data': {'*option': 'str'},
d6fe3d02 557 'returns': ['CommandLineOptionInfo'],
a937b6aa 558 'allow-preconfig': true}
1f216b8c
PM
559
560##
561# @RTC_CHANGE:
562#
563# Emitted when the guest changes the RTC time.
564#
a937b6aa
MA
565# @offset: offset in seconds between base RTC clock (as specified by
566# -rtc base), and new RTC clock value
1f216b8c 567#
2beb1e5f
MA
568# @qom-path: path to the RTC object in the QOM tree
569#
a937b6aa
MA
570# Note: This event is rate-limited. It is not guaranteed that the RTC
571# in the system implements this event, or even that the system has
572# an RTC at all.
1f216b8c
PM
573#
574# Since: 0.13
575#
576# Example:
577#
37fa48a4
MA
578# <- { "event": "RTC_CHANGE",
579# "data": { "offset": 78 },
580# "timestamp": { "seconds": 1267020223, "microseconds": 435656 } }
1f216b8c
PM
581##
582{ 'event': 'RTC_CHANGE',
2beb1e5f 583 'data': { 'offset': 'int', 'qom-path': 'str' } }
9fb3fba1
JR
584
585##
586# @VFU_CLIENT_HANGUP:
587#
588# Emitted when the client of a TYPE_VFIO_USER_SERVER closes the
589# communication channel
590#
a937b6aa
MA
591# @vfu-id: ID of the TYPE_VFIO_USER_SERVER object. It is the last
592# component of @vfu-qom-path referenced below
9fb3fba1 593#
a937b6aa
MA
594# @vfu-qom-path: path to the TYPE_VFIO_USER_SERVER object in the QOM
595# tree
9fb3fba1
JR
596#
597# @dev-id: ID of attached PCI device
598#
599# @dev-qom-path: path to attached PCI device in the QOM tree
600#
601# Since: 7.1
602#
603# Example:
604#
605# <- { "event": "VFU_CLIENT_HANGUP",
606# "data": { "vfu-id": "vfu1",
607# "vfu-qom-path": "/objects/vfu1",
608# "dev-id": "sas1",
609# "dev-qom-path": "/machine/peripheral/sas1" },
610# "timestamp": { "seconds": 1265044230, "microseconds": 450486 } }
9fb3fba1
JR
611##
612{ 'event': 'VFU_CLIENT_HANGUP',
613 'data': { 'vfu-id': 'str', 'vfu-qom-path': 'str',
614 'dev-id': 'str', 'dev-qom-path': 'str' } }