]> git.proxmox.com Git - mirror_qemu.git/blame - qapi-schema.json
coroutine-lock: reschedule coroutine on the AioContext it was running on
[mirror_qemu.git] / qapi-schema.json
CommitLineData
e3193601 1# -*- Mode: Python -*-
4d8bb958
MAL
2##
3# = Introduction
4#
5# This document describes all commands currently supported by QMP.
6#
7# Most of the time their usage is exactly the same as in the user Monitor, this
8# means that any other document which also describe commands (the manpage,
9# QEMU's manual, etc) can and should be consulted.
10#
11# QMP has two types of commands: regular and query commands. Regular commands
12# usually change the Virtual Machine's state someway, while query commands just
13# return information. The sections below are divided accordingly.
14#
15# It's important to observe that all communication examples are formatted in
16# a reader-friendly way, so that they're easier to understand. However, in real
17# protocol usage, they're emitted as a single line.
18#
19# Also, the following notation is used to denote data flow:
20#
21# Example:
22#
23# | -> data issued by the Client
24# | <- Server data response
e3193601 25#
4d8bb958
MAL
26# Please, refer to the QMP specification (docs/qmp-spec.txt) for
27# detailed information on the Server command and response formats.
28#
29# = Stability Considerations
30#
31# The current QMP command set (described in this file) may be useful for a
32# number of use cases, however it's limited and several commands have bad
33# defined semantics, specially with regard to command completion.
34#
35# These problems are going to be solved incrementally in the next QEMU releases
36# and we're going to establish a deprecation policy for badly defined commands.
37#
38# If you're planning to adopt QMP, please observe the following:
39#
40# 1. The deprecation policy will take effect and be documented soon, please
41# check the documentation of each used command as soon as a new release of
42# QEMU is available
43#
44# 2. DO NOT rely on anything which is not explicit documented
45#
46# 3. Errors, in special, are not documented. Applications should NOT check
47# for specific errors classes or data (it's strongly recommended to only
48# check for the "error" key)
49#
50##
48a32bed 51
d34bda71
BC
52# QAPI common definitions
53{ 'include': 'qapi/common.json' }
104059da 54
a090187d
DB
55# QAPI crypto definitions
56{ 'include': 'qapi/crypto.json' }
57
5db15096
BC
58# QAPI block definitions
59{ 'include': 'qapi/block.json' }
60
82d72d9d
WX
61# QAPI event definitions
62{ 'include': 'qapi/event.json' }
63
1dde0f48
LV
64# Tracing commands
65{ 'include': 'qapi/trace.json' }
66
39a18158
MA
67# QAPI introspection
68{ 'include': 'qapi/introspect.json' }
69
d3a48372
MAL
70##
71# = QMP commands
72##
73
119ebac1
MAL
74##
75# @qmp_capabilities:
76#
77# Enable QMP capabilities.
78#
79# Arguments: None.
80#
81# Example:
82#
83# -> { "execute": "qmp_capabilities" }
84# <- { "return": {} }
85#
86# Notes: This command is valid exactly when first connecting: it must be
87# issued before any other command will be accepted, and will fail once the
88# monitor is accepting other commands. (see qemu docs/qmp-spec.txt)
89#
90# Since: 0.13
91#
92##
93{ 'command': 'qmp_capabilities' }
94
104059da 95##
801db5ec 96# @LostTickPolicy:
104059da
PB
97#
98# Policy for handling lost ticks in timer devices.
99#
100# @discard: throw away the missed tick(s) and continue with future injection
101# normally. Guest time may be delayed, unless the OS has explicit
102# handling of lost ticks
103#
104# @delay: continue to deliver ticks at the normal rate. Guest time will be
105# delayed due to the late tick
106#
107# @merge: merge the missed tick(s) into one tick and inject. Guest time
108# may be delayed, depending on how the OS reacts to the merging
109# of ticks
110#
111# @slew: deliver ticks at a higher rate to catch up with the missed tick. The
112# guest time should not be delayed once catchup is complete.
113#
114# Since: 2.0
115##
116{ 'enum': 'LostTickPolicy',
117 'data': ['discard', 'delay', 'merge', 'slew' ] }
118
49687ace 119##
5072f7b3 120# @add_client:
b224e5e2
LC
121#
122# Allow client connections for VNC, Spice and socket based
123# character devices to be passed in to QEMU via SCM_RIGHTS.
124#
125# @protocol: protocol name. Valid names are "vnc", "spice" or the
126# name of a character device (eg. from -chardev id=XXXX)
127#
128# @fdname: file descriptor name previously passed via 'getfd' command
129#
130# @skipauth: #optional whether to skip authentication. Only applies
131# to "vnc" and "spice" protocols
132#
133# @tls: #optional whether to perform TLS. Only applies to the "spice"
134# protocol
135#
136# Returns: nothing on success.
137#
138# Since: 0.14.0
65ce54f5
MAL
139#
140# Example:
141#
142# -> { "execute": "add_client", "arguments": { "protocol": "vnc",
143# "fdname": "myclient" } }
144# <- { "return": {} }
145#
b224e5e2
LC
146##
147{ 'command': 'add_client',
148 'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
149 '*tls': 'bool' } }
150
48a32bed
AL
151##
152# @NameInfo:
153#
154# Guest name information.
155#
156# @name: #optional The name of the guest
157#
5072f7b3 158# Since: 0.14.0
48a32bed 159##
895a2a80 160{ 'struct': 'NameInfo', 'data': {'*name': 'str'} }
48a32bed
AL
161
162##
163# @query-name:
164#
165# Return the name information of a guest.
166#
167# Returns: @NameInfo of the guest
168#
5072f7b3 169# Since: 0.14.0
3aa4c6cd
MAL
170#
171# Example:
172#
173# -> { "execute": "query-name" }
174# <- { "return": { "name": "qemu-name" } }
175#
48a32bed
AL
176##
177{ 'command': 'query-name', 'returns': 'NameInfo' }
b9c15f16 178
292a2602
LC
179##
180# @KvmInfo:
181#
182# Information about support for KVM acceleration
183#
184# @enabled: true if KVM acceleration is active
185#
186# @present: true if KVM acceleration is built into this executable
187#
188# Since: 0.14.0
189##
895a2a80 190{ 'struct': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
292a2602
LC
191
192##
193# @query-kvm:
194#
195# Returns information about KVM acceleration
196#
197# Returns: @KvmInfo
198#
199# Since: 0.14.0
b4f65cd2
MAL
200#
201# Example:
202#
203# -> { "execute": "query-kvm" }
204# <- { "return": { "enabled": true, "present": true } }
205#
292a2602
LC
206##
207{ 'command': 'query-kvm', 'returns': 'KvmInfo' }
208
1fa9a5e4 209##
5072f7b3 210# @RunState:
1fa9a5e4 211#
6932a69b 212# An enumeration of VM run states.
1fa9a5e4
LC
213#
214# @debug: QEMU is running on a debugger
215#
0a24c7b1
LC
216# @finish-migrate: guest is paused to finish the migration process
217#
1e998146
PB
218# @inmigrate: guest is paused waiting for an incoming migration. Note
219# that this state does not tell whether the machine will start at the
220# end of the migration. This depends on the command-line -S option and
221# any invocation of 'stop' or 'cont' that has happened since QEMU was
222# started.
1fa9a5e4
LC
223#
224# @internal-error: An internal error that prevents further guest execution
225# has occurred
226#
227# @io-error: the last IOP has failed and the device is configured to pause
228# on I/O errors
229#
230# @paused: guest has been paused via the 'stop' command
231#
232# @postmigrate: guest is paused following a successful 'migrate'
233#
234# @prelaunch: QEMU was started with -S and guest has not started
235#
1fa9a5e4
LC
236# @restore-vm: guest is paused to restore VM state
237#
238# @running: guest is actively running
239#
240# @save-vm: guest is paused to save the VM state
241#
242# @shutdown: guest is shut down (and -no-shutdown is in use)
243#
ad02b96a
LC
244# @suspended: guest is suspended (ACPI S3)
245#
1fa9a5e4 246# @watchdog: the watchdog action is configured to pause and has been triggered
ede085b3
HT
247#
248# @guest-panicked: guest has been panicked as a result of guest OS panic
21142ba7 249#
252093a7
HZ
250# @colo: guest is paused to save/restore VM state under colo checkpoint,
251# VM can not get into this state unless colo capability is enabled
252# for migration. (since 2.8)
1fa9a5e4
LC
253##
254{ 'enum': 'RunState',
255 'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused',
256 'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm',
ede085b3 257 'running', 'save-vm', 'shutdown', 'suspended', 'watchdog',
21142ba7 258 'guest-panicked', 'colo' ] }
1fa9a5e4
LC
259
260##
261# @StatusInfo:
262#
263# Information about VCPU run state
264#
265# @running: true if all VCPUs are runnable, false if not runnable
266#
267# @singlestep: true if VCPUs are in single-step mode
268#
269# @status: the virtual machine @RunState
270#
271# Since: 0.14.0
272#
273# Notes: @singlestep is enabled through the GDB stub
274##
895a2a80 275{ 'struct': 'StatusInfo',
1fa9a5e4
LC
276 'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
277
278##
279# @query-status:
280#
281# Query the run status of all VCPUs
282#
283# Returns: @StatusInfo reflecting all VCPUs
284#
285# Since: 0.14.0
477bc1e4
MAL
286#
287# Example:
288#
289# -> { "execute": "query-status" }
290# <- { "return": { "running": true,
291# "singlestep": false,
292# "status": "running" } }
293#
1fa9a5e4
LC
294##
295{ 'command': 'query-status', 'returns': 'StatusInfo' }
296
efab767e
LC
297##
298# @UuidInfo:
299#
0ed90f77 300# Guest UUID information (Universally Unique Identifier).
efab767e
LC
301#
302# @UUID: the UUID of the guest
303#
304# Since: 0.14.0
305#
306# Notes: If no UUID was specified for the guest, a null UUID is returned.
307##
895a2a80 308{ 'struct': 'UuidInfo', 'data': {'UUID': 'str'} }
efab767e
LC
309
310##
311# @query-uuid:
312#
313# Query the guest UUID information.
314#
315# Returns: The @UuidInfo for the guest
316#
5072f7b3 317# Since: 0.14.0
0ed90f77
MAL
318#
319# Example:
320#
321# -> { "execute": "query-uuid" }
322# <- { "return": { "UUID": "550e8400-e29b-41d4-a716-446655440000" } }
323#
efab767e
LC
324##
325{ 'command': 'query-uuid', 'returns': 'UuidInfo' }
326
c5a415a0
LC
327##
328# @ChardevInfo:
329#
330# Information about a character device.
331#
332# @label: the label of the character device
333#
334# @filename: the filename of the character device
335#
32a97ea1
LE
336# @frontend-open: shows whether the frontend device attached to this backend
337# (eg. with the chardev=... option) is in open or closed state
338# (since 2.1)
339#
c5a415a0
LC
340# Notes: @filename is encoded using the QEMU command line character device
341# encoding. See the QEMU man page for details.
342#
343# Since: 0.14.0
344##
895a2a80 345{ 'struct': 'ChardevInfo', 'data': {'label': 'str',
32a97ea1
LE
346 'filename': 'str',
347 'frontend-open': 'bool'} }
c5a415a0
LC
348
349##
350# @query-chardev:
351#
352# Returns information about current character devices.
353#
354# Returns: a list of @ChardevInfo
355#
356# Since: 0.14.0
4055aa8d
MAL
357#
358# Example:
359#
360# -> { "execute": "query-chardev" }
361# <- {
362# "return": [
363# {
364# "label": "charchannel0",
365# "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.agent,server",
366# "frontend-open": false
367# },
368# {
369# "label": "charmonitor",
370# "filename": "unix:/var/lib/libvirt/qemu/seabios.rhel6.monitor,server",
371# "frontend-open": true
372# },
373# {
374# "label": "charserial0",
375# "filename": "pty:/dev/pts/2",
376# "frontend-open": true
377# }
378# ]
379# }
380#
c5a415a0
LC
381##
382{ 'command': 'query-chardev', 'returns': ['ChardevInfo'] }
aa9b79bc 383
77d1c3c6
MK
384##
385# @ChardevBackendInfo:
386#
387# Information about a character device backend
388#
389# @name: The backend name
390#
391# Since: 2.0
392##
895a2a80 393{ 'struct': 'ChardevBackendInfo', 'data': {'name': 'str'} }
77d1c3c6
MK
394
395##
396# @query-chardev-backends:
397#
398# Returns information about character device backends.
399#
400# Returns: a list of @ChardevBackendInfo
401#
402# Since: 2.0
90e365c0
MAL
403#
404# Example:
405#
406# -> { "execute": "query-chardev-backends" }
407# <- {
408# "return":[
409# {
410# "name":"udp"
411# },
412# {
413# "name":"tcp"
414# },
415# {
416# "name":"unix"
417# },
418# {
419# "name":"spiceport"
420# }
421# ]
422# }
423#
77d1c3c6
MK
424##
425{ 'command': 'query-chardev-backends', 'returns': ['ChardevBackendInfo'] }
426
1f590cf9
LL
427##
428# @DataFormat:
429#
430# An enumeration of data format.
431#
3949e594 432# @utf8: Data is a UTF-8 string (RFC 3629)
1f590cf9 433#
3949e594 434# @base64: Data is Base64 encoded binary (RFC 3548)
1f590cf9
LL
435#
436# Since: 1.4
437##
ad0f171e 438{ 'enum': 'DataFormat',
1f590cf9
LL
439 'data': [ 'utf8', 'base64' ] }
440
441##
3949e594 442# @ringbuf-write:
1f590cf9 443#
3949e594 444# Write to a ring buffer character device.
1f590cf9 445#
3949e594 446# @device: the ring buffer character device name
1f590cf9 447#
3949e594 448# @data: data to write
1f590cf9 449#
3949e594
MA
450# @format: #optional data encoding (default 'utf8').
451# - base64: data must be base64 encoded text. Its binary
452# decoding gets written.
3949e594
MA
453# - utf8: data's UTF-8 encoding is written
454# - data itself is always Unicode regardless of format, like
455# any other string.
1f590cf9
LL
456#
457# Returns: Nothing on success
1f590cf9
LL
458#
459# Since: 1.4
a4143a84
MAL
460#
461# Example:
462#
463# -> { "execute": "ringbuf-write",
464# "arguments": { "device": "foo",
465# "data": "abcdefgh",
466# "format": "utf8" } }
467# <- { "return": {} }
468#
1f590cf9 469##
3949e594 470{ 'command': 'ringbuf-write',
82e59a67 471 'data': {'device': 'str', 'data': 'str',
1f590cf9
LL
472 '*format': 'DataFormat'} }
473
49b6d722 474##
3949e594 475# @ringbuf-read:
49b6d722 476#
3949e594 477# Read from a ring buffer character device.
49b6d722 478#
3949e594 479# @device: the ring buffer character device name
49b6d722 480#
3949e594 481# @size: how many bytes to read at most
49b6d722 482#
3949e594
MA
483# @format: #optional data encoding (default 'utf8').
484# - base64: the data read is returned in base64 encoding.
485# - utf8: the data read is interpreted as UTF-8.
486# Bug: can screw up when the buffer contains invalid UTF-8
487# sequences, NUL characters, after the ring buffer lost
488# data, and when reading stops because the size limit is
489# reached.
490# - The return value is always Unicode regardless of format,
491# like any other string.
49b6d722 492#
3ab651fc 493# Returns: data read from the device
49b6d722
LL
494#
495# Since: 1.4
4f19a01b
MAL
496#
497# Example:
498#
499# -> { "execute": "ringbuf-read",
500# "arguments": { "device": "foo",
501# "size": 1000,
502# "format": "utf8" } }
503# <- { "return": "abcdefgh" }
504#
49b6d722 505##
3949e594 506{ 'command': 'ringbuf-read',
49b6d722 507 'data': {'device': 'str', 'size': 'int', '*format': 'DataFormat'},
3ab651fc 508 'returns': 'str' }
49b6d722 509
4860853d
DB
510##
511# @EventInfo:
512#
513# Information about a QMP event
514#
515# @name: The event name
516#
517# Since: 1.2.0
518##
895a2a80 519{ 'struct': 'EventInfo', 'data': {'name': 'str'} }
4860853d
DB
520
521##
522# @query-events:
523#
524# Return a list of supported QMP events by this server
525#
526# Returns: A list of @EventInfo for all supported events
527#
528# Since: 1.2.0
66c2f5a5
MAL
529#
530# Example:
531#
532# -> { "execute": "query-events" }
533# <- {
534# "return": [
535# {
536# "name":"SHUTDOWN"
537# },
538# {
539# "name":"RESET"
540# }
541# ]
542# }
543#
544# Note: This example has been shortened as the real response is too long.
545#
4860853d
DB
546##
547{ 'command': 'query-events', 'returns': ['EventInfo'] }
548
791e7c82 549##
5072f7b3 550# @MigrationStats:
791e7c82
LC
551#
552# Detailed migration status.
553#
554# @transferred: amount of bytes already transferred to the target VM
555#
556# @remaining: amount of bytes remaining to be transferred to the target VM
557#
558# @total: total amount of bytes involved in the migration process
559#
f1c72795
PL
560# @duplicate: number of duplicate (zero) pages (since 1.2)
561#
562# @skipped: number of skipped zero pages (since 1.5)
004d4c10 563#
5072f7b3 564# @normal: number of normal pages (since 1.2)
004d4c10 565#
8d017193
JQ
566# @normal-bytes: number of normal bytes sent (since 1.2)
567#
568# @dirty-pages-rate: number of pages dirtied by second by the
569# guest (since 1.3)
004d4c10 570#
7e114f8c
MH
571# @mbps: throughput in megabits/sec. (since 1.6)
572#
58570ed8
C
573# @dirty-sync-count: number of times that dirty ram was synchronized (since 2.1)
574#
d3bf5418
DDAG
575# @postcopy-requests: The number of page requests received from the destination
576# (since 2.7)
577#
004d4c10 578# Since: 0.14.0
791e7c82 579##
895a2a80 580{ 'struct': 'MigrationStats',
d5f8a570 581 'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
f1c72795 582 'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
7e114f8c 583 'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
d3bf5418
DDAG
584 'mbps' : 'number', 'dirty-sync-count' : 'int',
585 'postcopy-requests' : 'int' } }
791e7c82 586
f36d55af 587##
5072f7b3 588# @XBZRLECacheStats:
f36d55af
OW
589#
590# Detailed XBZRLE migration cache statistics
591#
592# @cache-size: XBZRLE cache size
593#
594# @bytes: amount of bytes already transferred to the target VM
595#
596# @pages: amount of pages transferred to the target VM
597#
598# @cache-miss: number of cache miss
599#
8bc39233
C
600# @cache-miss-rate: rate of cache miss (since 2.1)
601#
f36d55af
OW
602# @overflow: number of overflows
603#
604# Since: 1.2
605##
895a2a80 606{ 'struct': 'XBZRLECacheStats',
f36d55af 607 'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
8bc39233
C
608 'cache-miss': 'int', 'cache-miss-rate': 'number',
609 'overflow': 'int' } }
f36d55af 610
49687ace 611##
24b8c39b
HZ
612# @MigrationStatus:
613#
614# An enumeration of migration status.
615#
616# @none: no migration has ever happened.
617#
618# @setup: migration process has been initiated.
619#
620# @cancelling: in the process of cancelling migration.
621#
622# @cancelled: cancelling migration is finished.
623#
624# @active: in the process of doing migration.
625#
9ec055ae
DDAG
626# @postcopy-active: like active, but now in postcopy mode. (since 2.5)
627#
24b8c39b
HZ
628# @completed: migration is finished.
629#
630# @failed: some error occurred during migration process.
631#
252093a7
HZ
632# @colo: VM is in the process of fault tolerance, VM can not get into this
633# state unless colo capability is enabled for migration. (since 2.8)
0b827d5e 634#
24b8c39b
HZ
635# Since: 2.3
636#
637##
638{ 'enum': 'MigrationStatus',
639 'data': [ 'none', 'setup', 'cancelling', 'cancelled',
0b827d5e 640 'active', 'postcopy-active', 'completed', 'failed', 'colo' ] }
24b8c39b 641
791e7c82 642##
5072f7b3 643# @MigrationInfo:
791e7c82
LC
644#
645# Information about current migration process.
646#
24b8c39b
HZ
647# @status: #optional @MigrationStatus describing the current migration status.
648# If this field is not returned, no migration process
791e7c82
LC
649# has been initiated
650#
d5f8a570
JQ
651# @ram: #optional @MigrationStats containing detailed migration
652# status, only returned if status is 'active' or
24b8c39b 653# 'completed'(since 1.2)
791e7c82
LC
654#
655# @disk: #optional @MigrationStats containing detailed disk migration
656# status, only returned if status is 'active' and it is a block
657# migration
658#
f36d55af
OW
659# @xbzrle-cache: #optional @XBZRLECacheStats containing detailed XBZRLE
660# migration statistics, only returned if XBZRLE feature is on and
661# status is 'active' or 'completed' (since 1.2)
662#
7aa939af
JQ
663# @total-time: #optional total amount of milliseconds since migration started.
664# If migration has ended, it returns the total migration
665# time. (since 1.2)
666#
9c5a9fcf
JQ
667# @downtime: #optional only present when migration finishes correctly
668# total downtime in milliseconds for the guest.
669# (since 1.3)
670#
2c52ddf1
JQ
671# @expected-downtime: #optional only present while migration is active
672# expected downtime in milliseconds for the guest in last walk
673# of the dirty bitmap. (since 1.3)
674#
ed4fbd10
MH
675# @setup-time: #optional amount of setup time in milliseconds _before_ the
676# iterations begin but _after_ the QMP command is issued. This is designed
677# to provide an accounting of any activities (such as RDMA pinning) which
678# may be expensive, but do not actually occur during the iterative
679# migration rounds themselves. (since 1.6)
680#
d85a31d1
JH
681# @cpu-throttle-percentage: #optional percentage of time guest cpus are being
682# throttled during auto-converge. This is only present when auto-converge
683# has started throttling guest cpus. (Since 2.7)
4782893e 684#
d59ce6f3
DB
685# @error-desc: #optional the human readable error description string, when
686# @status is 'failed'. Clients should not attempt to parse the
bdbba12b 687# error strings. (Since 2.7)
d59ce6f3 688#
791e7c82
LC
689# Since: 0.14.0
690##
895a2a80 691{ 'struct': 'MigrationInfo',
24b8c39b 692 'data': {'*status': 'MigrationStatus', '*ram': 'MigrationStats',
f36d55af 693 '*disk': 'MigrationStats',
7aa939af 694 '*xbzrle-cache': 'XBZRLECacheStats',
9c5a9fcf 695 '*total-time': 'int',
2c52ddf1 696 '*expected-downtime': 'int',
ed4fbd10 697 '*downtime': 'int',
4782893e 698 '*setup-time': 'int',
d59ce6f3
DB
699 '*cpu-throttle-percentage': 'int',
700 '*error-desc': 'str'} }
791e7c82
LC
701
702##
5072f7b3 703# @query-migrate:
791e7c82 704#
104b1caf
MAL
705# Returns information about current migration process. If migration
706# is active there will be another json-object with RAM migration
707# status and if block migration is active another one with block
708# migration status.
791e7c82
LC
709#
710# Returns: @MigrationInfo
711#
712# Since: 0.14.0
104b1caf
MAL
713#
714# Example:
715#
716# 1. Before the first migration
717#
718# -> { "execute": "query-migrate" }
719# <- { "return": {} }
720#
721# 2. Migration is done and has succeeded
722#
723# -> { "execute": "query-migrate" }
724# <- { "return": {
725# "status": "completed",
726# "ram":{
727# "transferred":123,
728# "remaining":123,
729# "total":246,
730# "total-time":12345,
731# "setup-time":12345,
732# "downtime":12345,
733# "duplicate":123,
734# "normal":123,
735# "normal-bytes":123456,
736# "dirty-sync-count":15
737# }
738# }
739# }
740#
741# 3. Migration is done and has failed
742#
743# -> { "execute": "query-migrate" }
744# <- { "return": { "status": "failed" } }
745#
746# 4. Migration is being performed and is not a block migration:
747#
748# -> { "execute": "query-migrate" }
749# <- {
750# "return":{
751# "status":"active",
752# "ram":{
753# "transferred":123,
754# "remaining":123,
755# "total":246,
756# "total-time":12345,
757# "setup-time":12345,
758# "expected-downtime":12345,
759# "duplicate":123,
760# "normal":123,
761# "normal-bytes":123456,
762# "dirty-sync-count":15
763# }
764# }
765# }
766#
767# 5. Migration is being performed and is a block migration:
768#
769# -> { "execute": "query-migrate" }
770# <- {
771# "return":{
772# "status":"active",
773# "ram":{
774# "total":1057024,
775# "remaining":1053304,
776# "transferred":3720,
777# "total-time":12345,
778# "setup-time":12345,
779# "expected-downtime":12345,
780# "duplicate":123,
781# "normal":123,
782# "normal-bytes":123456,
783# "dirty-sync-count":15
784# },
785# "disk":{
786# "total":20971520,
787# "remaining":20880384,
788# "transferred":91136
789# }
790# }
791# }
792#
793# 6. Migration is being performed and XBZRLE is active:
794#
795# -> { "execute": "query-migrate" }
796# <- {
797# "return":{
798# "status":"active",
799# "capabilities" : [ { "capability": "xbzrle", "state" : true } ],
800# "ram":{
801# "total":1057024,
802# "remaining":1053304,
803# "transferred":3720,
804# "total-time":12345,
805# "setup-time":12345,
806# "expected-downtime":12345,
807# "duplicate":10,
808# "normal":3333,
809# "normal-bytes":3412992,
810# "dirty-sync-count":15
811# },
812# "xbzrle-cache":{
813# "cache-size":67108864,
814# "bytes":20971520,
815# "pages":2444343,
816# "cache-miss":2244,
817# "cache-miss-rate":0.123,
818# "overflow":34434
819# }
820# }
821# }
822#
791e7c82
LC
823##
824{ 'command': 'query-migrate', 'returns': 'MigrationInfo' }
825
bbf6da32 826##
5072f7b3 827# @MigrationCapability:
bbf6da32
OW
828#
829# Migration capabilities enumeration
830#
831# @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
832# This feature allows us to minimize migration traffic for certain work
833# loads, by sending compressed difference of the pages
834#
41310c68 835# @rdma-pin-all: Controls whether or not the entire VM memory footprint is
60d9222c 836# mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
41310c68 837# Disabled by default. (since 2.0)
60d9222c 838#
323004a3
PL
839# @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
840# essentially saves 1MB of zeroes per block on the wire. Enabling requires
841# source and target VM to support this feature. To enable it is sufficient
842# to enable the capability on the source VM. The feature is disabled by
843# default. (since 1.6)
844#
dde4e694
LL
845# @compress: Use multiple compression threads to accelerate live migration.
846# This feature can help to reduce the migration traffic, by sending
847# compressed pages. Please note that if compress and xbzrle are both
848# on, compress only takes effect in the ram bulk stage, after that,
849# it will be disabled and only xbzrle takes effect, this can help to
850# minimize migration traffic. The feature is disabled by default.
851# (since 2.4 )
852#
b05dc723
JQ
853# @events: generate events for each migration state change
854# (since 2.4 )
855#
9781c371
JQ
856# @auto-converge: If enabled, QEMU will automatically throttle down the guest
857# to speed up convergence of RAM migration. (since 1.6)
858#
32c3db5b 859# @postcopy-ram: Start executing on the migration target before all of RAM has
53dd370c 860# been migrated, pulling the remaining pages along as needed. NOTE: If
32c3db5b 861# the migration fails during postcopy the VM will fail. (since 2.6)
53dd370c 862#
35a6ed4f
HZ
863# @x-colo: If enabled, migration will never end, and the state of the VM on the
864# primary side will be migrated continuously to the VM on secondary
865# side, this process is called COarse-Grain LOck Stepping (COLO) for
866# Non-stop Service. (since 2.8)
867#
53f09a10
PB
868# @release-ram: if enabled, qemu will free the migrated ram pages on the source
869# during postcopy-ram migration. (since 2.9)
870#
bbf6da32
OW
871# Since: 1.2
872##
873{ 'enum': 'MigrationCapability',
dde4e694 874 'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks',
53f09a10 875 'compress', 'events', 'postcopy-ram', 'x-colo', 'release-ram'] }
bbf6da32
OW
876
877##
5072f7b3 878# @MigrationCapabilityStatus:
bbf6da32
OW
879#
880# Migration capability information
881#
882# @capability: capability enum
883#
884# @state: capability state bool
885#
886# Since: 1.2
887##
895a2a80 888{ 'struct': 'MigrationCapabilityStatus',
bbf6da32
OW
889 'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
890
891##
5072f7b3 892# @migrate-set-capabilities:
00458433
OW
893#
894# Enable/Disable the following migration capabilities (like xbzrle)
895#
896# @capabilities: json array of capability modifications to make
897#
898# Since: 1.2
0a0bb964
MAL
899#
900# Example:
901#
902# -> { "execute": "migrate-set-capabilities" , "arguments":
903# { "capabilities": [ { "capability": "xbzrle", "state": true } ] } }
904#
00458433
OW
905##
906{ 'command': 'migrate-set-capabilities',
907 'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
908
909##
5072f7b3 910# @query-migrate-capabilities:
bbf6da32
OW
911#
912# Returns information about the current migration capabilities status
913#
914# Returns: @MigrationCapabilitiesStatus
915#
916# Since: 1.2
135b238e
MAL
917#
918# Example:
919#
920# -> { "execute": "query-migrate-capabilities" }
921# <- { "return": [
922# {"state": false, "capability": "xbzrle"},
923# {"state": false, "capability": "rdma-pin-all"},
924# {"state": false, "capability": "auto-converge"},
925# {"state": false, "capability": "zero-blocks"},
926# {"state": false, "capability": "compress"},
927# {"state": true, "capability": "events"},
928# {"state": false, "capability": "postcopy-ram"},
929# {"state": false, "capability": "x-colo"}
930# ]}
931#
bbf6da32
OW
932##
933{ 'command': 'query-migrate-capabilities', 'returns': ['MigrationCapabilityStatus']}
934
49687ace 935##
5072f7b3 936# @MigrationParameter:
43c60a81
LL
937#
938# Migration parameters enumeration
939#
940# @compress-level: Set the compression level to be used in live migration,
941# the compression level is an integer between 0 and 9, where 0 means
942# no compression, 1 means the best compression speed, and 9 means best
943# compression ratio which will consume more CPU.
944#
945# @compress-threads: Set compression thread count to be used in live migration,
946# the compression thread count is an integer between 1 and 255.
947#
948# @decompress-threads: Set decompression thread count to be used in live
949# migration, the decompression thread count is an integer between 1
950# and 255. Usually, decompression is at least 4 times as fast as
951# compression, so set the decompress-threads to the number about 1/4
952# of compress-threads is adequate.
953#
d85a31d1
JH
954# @cpu-throttle-initial: Initial percentage of time guest cpus are throttled
955# when migration auto-converge is activated. The
956# default value is 20. (Since 2.7)
1626fee3 957#
d85a31d1
JH
958# @cpu-throttle-increment: throttle percentage increase each time
959# auto-converge detects that migration is not making
960# progress. The default value is 10. (Since 2.7)
69ef1f36
DB
961#
962# @tls-creds: ID of the 'tls-creds' object that provides credentials for
963# establishing a TLS connection over the migration data channel.
964# On the outgoing side of the migration, the credentials must
965# be for a 'client' endpoint, while for the incoming side the
966# credentials must be for a 'server' endpoint. Setting this
967# will enable TLS for all migrations. The default is unset,
968# resulting in unsecured migration at the QEMU level. (Since 2.7)
969#
970# @tls-hostname: hostname of the target host for the migration. This is
971# required when using x509 based TLS credentials and the
972# migration URI does not already include a hostname. For
973# example if using fd: or exec: based migration, the
974# hostname must be provided so that the server's x509
bdbba12b 975# certificate identity can be validated. (Since 2.7)
69ef1f36 976#
2ff30257
AA
977# @max-bandwidth: to set maximum speed for migration. maximum speed in
978# bytes per second. (Since 2.8)
979#
980# @downtime-limit: set maximum tolerated downtime for migration. maximum
981# downtime in milliseconds (Since 2.8)
982#
68b53591
HZ
983# @x-checkpoint-delay: The delay time (in ms) between two COLO checkpoints in
984# periodic mode. (Since 2.8)
985#
43c60a81
LL
986# Since: 2.4
987##
988{ 'enum': 'MigrationParameter',
1626fee3 989 'data': ['compress-level', 'compress-threads', 'decompress-threads',
69ef1f36 990 'cpu-throttle-initial', 'cpu-throttle-increment',
2ff30257 991 'tls-creds', 'tls-hostname', 'max-bandwidth',
68b53591 992 'downtime-limit', 'x-checkpoint-delay' ] }
43c60a81 993
49687ace 994##
5072f7b3 995# @migrate-set-parameters:
85de8323 996#
de63ab61 997# Set various migration parameters. See MigrationParameters for details.
69ef1f36 998#
85de8323 999# Since: 2.4
35db41e5
MAL
1000#
1001# Example:
1002#
1003# -> { "execute": "migrate-set-parameters" ,
1004# "arguments": { "compress-level": 1 } }
1005#
85de8323 1006##
7f375e04 1007{ 'command': 'migrate-set-parameters', 'boxed': true,
de63ab61 1008 'data': 'MigrationParameters' }
85de8323 1009
49687ace 1010##
5072f7b3 1011# @MigrationParameters:
85de8323 1012#
de63ab61
EB
1013# Optional members can be omitted on input ('migrate-set-parameters')
1014# but most members will always be present on output
1015# ('query-migrate-parameters'), with the exception of tls-creds and
1016# tls-hostname.
85de8323 1017#
de63ab61 1018# @compress-level: #optional compression level
85de8323 1019#
de63ab61 1020# @compress-threads: #optional compression thread count
85de8323 1021#
de63ab61 1022# @decompress-threads: #optional decompression thread count
1626fee3 1023#
de63ab61
EB
1024# @cpu-throttle-initial: #optional Initial percentage of time guest cpus are
1025# throttledwhen migration auto-converge is activated.
1026# The default value is 20. (Since 2.7)
1027#
1028# @cpu-throttle-increment: #optional throttle percentage increase each time
d85a31d1
JH
1029# auto-converge detects that migration is not making
1030# progress. The default value is 10. (Since 2.7)
1626fee3 1031#
de63ab61
EB
1032# @tls-creds: #optional ID of the 'tls-creds' object that provides credentials
1033# for establishing a TLS connection over the migration data
1034# channel. On the outgoing side of the migration, the credentials
1035# must be for a 'client' endpoint, while for the incoming side the
69ef1f36
DB
1036# credentials must be for a 'server' endpoint. Setting this
1037# will enable TLS for all migrations. The default is unset,
bdbba12b 1038# resulting in unsecured migration at the QEMU level. (Since 2.7)
69ef1f36 1039#
de63ab61
EB
1040# @tls-hostname: #optional hostname of the target host for the migration. This
1041# is required when using x509 based TLS credentials and the
69ef1f36
DB
1042# migration URI does not already include a hostname. For
1043# example if using fd: or exec: based migration, the
1044# hostname must be provided so that the server's x509
bdbba12b 1045# certificate identity can be validated. (Since 2.7)
69ef1f36 1046#
2ff30257
AA
1047# @max-bandwidth: to set maximum speed for migration. maximum speed in
1048# bytes per second. (Since 2.8)
1049#
1050# @downtime-limit: set maximum tolerated downtime for migration. maximum
1051# downtime in milliseconds (Since 2.8)
1052#
68b53591
HZ
1053# @x-checkpoint-delay: the delay time between two COLO checkpoints. (Since 2.8)
1054#
85de8323
LL
1055# Since: 2.4
1056##
1057{ 'struct': 'MigrationParameters',
de63ab61
EB
1058 'data': { '*compress-level': 'int',
1059 '*compress-threads': 'int',
1060 '*decompress-threads': 'int',
1061 '*cpu-throttle-initial': 'int',
1062 '*cpu-throttle-increment': 'int',
1063 '*tls-creds': 'str',
2ff30257
AA
1064 '*tls-hostname': 'str',
1065 '*max-bandwidth': 'int',
68b53591
HZ
1066 '*downtime-limit': 'int',
1067 '*x-checkpoint-delay': 'int'} }
6235b9cd 1068
85de8323 1069##
5072f7b3 1070# @query-migrate-parameters:
85de8323
LL
1071#
1072# Returns information about the current migration parameters
1073#
1074# Returns: @MigrationParameters
1075#
1076# Since: 2.4
cf56cfad
MAL
1077#
1078# Example:
1079#
1080# -> { "execute": "query-migrate-parameters" }
1081# <- { "return": {
1082# "decompress-threads": 2,
1083# "cpu-throttle-increment": 10,
1084# "compress-threads": 8,
1085# "compress-level": 1,
1086# "cpu-throttle-initial": 20,
1087# "max-bandwidth": 33554432,
1088# "downtime-limit": 300
1089# }
1090# }
1091#
85de8323
LL
1092##
1093{ 'command': 'query-migrate-parameters',
1094 'returns': 'MigrationParameters' }
1095
b8a185bc 1096##
5072f7b3 1097# @client_migrate_info:
b8a185bc
MA
1098#
1099# Set migration information for remote display. This makes the server
1100# ask the client to automatically reconnect using the new parameters
1101# once migration finished successfully. Only implemented for SPICE.
1102#
1103# @protocol: must be "spice"
1104# @hostname: migration target hostname
1105# @port: #optional spice tcp port for plaintext channels
1106# @tls-port: #optional spice tcp port for tls-secured channels
1107# @cert-subject: #optional server certificate subject
1108#
1109# Since: 0.14.0
d0d3fc7f
MAL
1110#
1111# Example:
1112#
1113# -> { "execute": "client_migrate_info",
1114# "arguments": { "protocol": "spice",
1115# "hostname": "virt42.lab.kraxel.org",
1116# "port": 1234 } }
1117# <- { "return": {} }
1118#
b8a185bc
MA
1119##
1120{ 'command': 'client_migrate_info',
1121 'data': { 'protocol': 'str', 'hostname': 'str', '*port': 'int',
1122 '*tls-port': 'int', '*cert-subject': 'str' } }
1123
4886a1bc 1124##
5072f7b3 1125# @migrate-start-postcopy:
4886a1bc 1126#
a54d340b 1127# Followup to a migration command to switch the migration to postcopy mode.
32c3db5b 1128# The postcopy-ram capability must be set before the original migration
a54d340b 1129# command.
4886a1bc
DDAG
1130#
1131# Since: 2.5
3c3ea00a
MAL
1132#
1133# Example:
1134#
1135# -> { "execute": "migrate-start-postcopy" }
1136# <- { "return": {} }
1137#
49687ace 1138##
4886a1bc
DDAG
1139{ 'command': 'migrate-start-postcopy' }
1140
e235cec3 1141##
5072f7b3 1142# @COLOMessage:
4f97558e
HZ
1143#
1144# The message transmission between Primary side and Secondary side.
1145#
1146# @checkpoint-ready: Secondary VM (SVM) is ready for checkpointing
1147#
1148# @checkpoint-request: Primary VM (PVM) tells SVM to prepare for checkpointing
1149#
1150# @checkpoint-reply: SVM gets PVM's checkpoint request
1151#
1152# @vmstate-send: VM's state will be sent by PVM.
1153#
1154# @vmstate-size: The total size of VMstate.
1155#
1156# @vmstate-received: VM's state has been received by SVM.
1157#
1158# @vmstate-loaded: VM's state has been loaded by SVM.
1159#
1160# Since: 2.8
1161##
1162{ 'enum': 'COLOMessage',
1163 'data': [ 'checkpoint-ready', 'checkpoint-request', 'checkpoint-reply',
1164 'vmstate-send', 'vmstate-size', 'vmstate-received',
1165 'vmstate-loaded' ] }
1166
d89e666e 1167##
5072f7b3 1168# @COLOMode:
d89e666e
HZ
1169#
1170# The colo mode
1171#
1172# @unknown: unknown mode
1173#
1174# @primary: master side
1175#
1176# @secondary: slave side
1177#
1178# Since: 2.8
1179##
1180{ 'enum': 'COLOMode',
1181 'data': [ 'unknown', 'primary', 'secondary'] }
1182
aef06085 1183##
5072f7b3 1184# @FailoverStatus:
aef06085
HZ
1185#
1186# An enumeration of COLO failover status
1187#
1188# @none: no failover has ever happened
1189#
1190# @require: got failover requirement but not handled
1191#
1192# @active: in the process of doing failover
1193#
1194# @completed: finish the process of failover
1195#
a8664ba5
HZ
1196# @relaunch: restart the failover process, from 'none' -> 'completed' (Since 2.9)
1197#
aef06085
HZ
1198# Since: 2.8
1199##
1200{ 'enum': 'FailoverStatus',
a8664ba5 1201 'data': [ 'none', 'require', 'active', 'completed', 'relaunch' ] }
aef06085 1202
d89e666e 1203##
5072f7b3 1204# @x-colo-lost-heartbeat:
d89e666e
HZ
1205#
1206# Tell qemu that heartbeat is lost, request it to do takeover procedures.
1207# If this command is sent to the PVM, the Primary side will exit COLO mode.
1208# If sent to the Secondary, the Secondary side will run failover work,
1209# then takes over server operation to become the service VM.
1210#
1211# Since: 2.8
c08d6443
MAL
1212#
1213# Example:
1214#
1215# -> { "execute": "x-colo-lost-heartbeat" }
1216# <- { "return": {} }
1217#
d89e666e
HZ
1218##
1219{ 'command': 'x-colo-lost-heartbeat' }
1220
1221##
e235cec3
LC
1222# @MouseInfo:
1223#
1224# Information about a mouse device.
1225#
1226# @name: the name of the mouse device
1227#
1228# @index: the index of the mouse device
1229#
1230# @current: true if this device is currently receiving mouse events
1231#
1232# @absolute: true if this device supports absolute coordinates as input
1233#
1234# Since: 0.14.0
1235##
895a2a80 1236{ 'struct': 'MouseInfo',
e235cec3
LC
1237 'data': {'name': 'str', 'index': 'int', 'current': 'bool',
1238 'absolute': 'bool'} }
1239
1240##
1241# @query-mice:
1242#
1243# Returns information about each active mouse device
1244#
1245# Returns: a list of @MouseInfo for each device
1246#
1247# Since: 0.14.0
60639df5
MAL
1248#
1249# Example:
1250#
1251# -> { "execute": "query-mice" }
1252# <- { "return": [
1253# {
1254# "name":"QEMU Microsoft Mouse",
1255# "index":0,
1256# "current":false,
1257# "absolute":false
1258# },
1259# {
1260# "name":"QEMU PS/2 Mouse",
1261# "index":1,
1262# "current":true,
1263# "absolute":true
1264# }
1265# ]
1266# }
1267#
e235cec3
LC
1268##
1269{ 'command': 'query-mice', 'returns': ['MouseInfo'] }
1270
de0b36b6 1271##
86f4b687 1272# @CpuInfoArch:
de0b36b6 1273#
86f4b687
EB
1274# An enumeration of cpu types that enable additional information during
1275# @query-cpus.
1276#
1277# Since: 2.6
1278##
1279{ 'enum': 'CpuInfoArch',
1280 'data': ['x86', 'sparc', 'ppc', 'mips', 'tricore', 'other' ] }
1281
1282##
3666a97f 1283# @CpuInfo:
86f4b687 1284#
3666a97f 1285# Information about a virtual CPU
de0b36b6
LC
1286#
1287# @CPU: the index of the virtual CPU
1288#
86f4b687 1289# @current: this only exists for backwards compatibility and should be ignored
b80e560b 1290#
de0b36b6
LC
1291# @halted: true if the virtual CPU is in the halt state. Halt usually refers
1292# to a processor specific low power mode.
1293#
58f88d4b
EH
1294# @qom_path: path to the CPU object in the QOM tree (since 2.4)
1295#
de0b36b6
LC
1296# @thread_id: ID of the underlying host thread
1297#
86f4b687
EB
1298# @arch: architecture of the cpu, which determines which additional fields
1299# will be listed (since 2.6)
1300#
de0b36b6
LC
1301# Since: 0.14.0
1302#
1303# Notes: @halted is a transient state that changes frequently. By the time the
1304# data is sent to the client, the guest may no longer be halted.
1305##
3666a97f
EB
1306{ 'union': 'CpuInfo',
1307 'base': {'CPU': 'int', 'current': 'bool', 'halted': 'bool',
1308 'qom_path': 'str', 'thread_id': 'int', 'arch': 'CpuInfoArch' },
1309 'discriminator': 'arch',
86f4b687
EB
1310 'data': { 'x86': 'CpuInfoX86',
1311 'sparc': 'CpuInfoSPARC',
1312 'ppc': 'CpuInfoPPC',
1313 'mips': 'CpuInfoMIPS',
1314 'tricore': 'CpuInfoTricore',
1315 'other': 'CpuInfoOther' } }
1316
1317##
1318# @CpuInfoX86:
1319#
1320# Additional information about a virtual i386 or x86_64 CPU
1321#
1322# @pc: the 64-bit instruction pointer
1323#
5072f7b3 1324# Since: 2.6
86f4b687
EB
1325##
1326{ 'struct': 'CpuInfoX86', 'data': { 'pc': 'int' } }
1327
1328##
1329# @CpuInfoSPARC:
1330#
1331# Additional information about a virtual SPARC CPU
1332#
1333# @pc: the PC component of the instruction pointer
1334#
1335# @npc: the NPC component of the instruction pointer
1336#
5072f7b3 1337# Since: 2.6
86f4b687
EB
1338##
1339{ 'struct': 'CpuInfoSPARC', 'data': { 'pc': 'int', 'npc': 'int' } }
1340
1341##
1342# @CpuInfoPPC:
1343#
1344# Additional information about a virtual PPC CPU
1345#
1346# @nip: the instruction pointer
1347#
5072f7b3 1348# Since: 2.6
86f4b687
EB
1349##
1350{ 'struct': 'CpuInfoPPC', 'data': { 'nip': 'int' } }
1351
1352##
1353# @CpuInfoMIPS:
1354#
1355# Additional information about a virtual MIPS CPU
1356#
1357# @PC: the instruction pointer
1358#
5072f7b3 1359# Since: 2.6
86f4b687
EB
1360##
1361{ 'struct': 'CpuInfoMIPS', 'data': { 'PC': 'int' } }
1362
1363##
1364# @CpuInfoTricore:
1365#
1366# Additional information about a virtual Tricore CPU
1367#
1368# @PC: the instruction pointer
1369#
5072f7b3 1370# Since: 2.6
86f4b687
EB
1371##
1372{ 'struct': 'CpuInfoTricore', 'data': { 'PC': 'int' } }
1373
1374##
1375# @CpuInfoOther:
1376#
1377# No additional information is available about the virtual CPU
1378#
5072f7b3 1379# Since: 2.6
86f4b687
EB
1380#
1381##
1382{ 'struct': 'CpuInfoOther', 'data': { } }
de0b36b6
LC
1383
1384##
1385# @query-cpus:
1386#
1387# Returns a list of information about each virtual CPU.
1388#
1389# Returns: a list of @CpuInfo for each virtual CPU
1390#
1391# Since: 0.14.0
5c5bee64
MAL
1392#
1393# Example:
1394#
1395# -> { "execute": "query-cpus" }
1396# <- { "return": [
1397# {
1398# "CPU":0,
1399# "current":true,
1400# "halted":false,
1401# "qom_path":"/machine/unattached/device[0]",
1402# "arch":"x86",
1403# "pc":3227107138,
1404# "thread_id":3134
1405# },
1406# {
1407# "CPU":1,
1408# "current":false,
1409# "halted":true,
1410# "qom_path":"/machine/unattached/device[2]",
1411# "arch":"x86",
1412# "pc":7108165,
1413# "thread_id":3135
1414# }
1415# ]
1416# }
1417#
de0b36b6
LC
1418##
1419{ 'command': 'query-cpus', 'returns': ['CpuInfo'] }
1420
dc3dd0d2
SH
1421##
1422# @IOThreadInfo:
1423#
1424# Information about an iothread
1425#
1426# @id: the identifier of the iothread
1427#
1428# @thread-id: ID of the underlying host thread
1429#
1430# Since: 2.0
1431##
895a2a80 1432{ 'struct': 'IOThreadInfo',
dc3dd0d2
SH
1433 'data': {'id': 'str', 'thread-id': 'int'} }
1434
1435##
1436# @query-iothreads:
1437#
1438# Returns a list of information about each iothread.
1439#
5072f7b3 1440# Note: this list excludes the QEMU main loop thread, which is not declared
dc3dd0d2
SH
1441# using the -object iothread command-line option. It is always the main thread
1442# of the process.
1443#
1444# Returns: a list of @IOThreadInfo for each iothread
1445#
1446# Since: 2.0
fdf4d34f
MAL
1447#
1448# Example:
1449#
1450# -> { "execute": "query-iothreads" }
1451# <- { "return": [
1452# {
1453# "id":"iothread0",
1454# "thread-id":3134
1455# },
1456# {
1457# "id":"iothread1",
1458# "thread-id":3135
1459# }
1460# ]
1461# }
1462#
dc3dd0d2
SH
1463##
1464{ 'command': 'query-iothreads', 'returns': ['IOThreadInfo'] }
1465
2b54aa87 1466##
5072f7b3 1467# @NetworkAddressFamily:
2b54aa87 1468#
a589569f
WX
1469# The network address family
1470#
1471# @ipv4: IPV4 family
1472#
1473# @ipv6: IPV6 family
1474#
1475# @unix: unix socket
1476#
6a02c806
SH
1477# @vsock: vsock family (since 2.8)
1478#
a589569f
WX
1479# @unknown: otherwise
1480#
1481# Since: 2.1
1482##
1483{ 'enum': 'NetworkAddressFamily',
6a02c806 1484 'data': [ 'ipv4', 'ipv6', 'unix', 'vsock', 'unknown' ] }
a589569f
WX
1485
1486##
5072f7b3 1487# @VncBasicInfo:
2b54aa87 1488#
a589569f 1489# The basic information for vnc network connection
2b54aa87 1490#
a589569f 1491# @host: IP address
2b54aa87 1492#
2f44a08b
WX
1493# @service: The service name of the vnc port. This may depend on the host
1494# system's service database so symbolic names should not be relied
1495# on.
a589569f
WX
1496#
1497# @family: address family
1498#
4478aa76
GH
1499# @websocket: true in case the socket is a websocket (since 2.3).
1500#
a589569f
WX
1501# Since: 2.1
1502##
895a2a80 1503{ 'struct': 'VncBasicInfo',
a589569f
WX
1504 'data': { 'host': 'str',
1505 'service': 'str',
4478aa76
GH
1506 'family': 'NetworkAddressFamily',
1507 'websocket': 'bool' } }
a589569f
WX
1508
1509##
5072f7b3 1510# @VncServerInfo:
2b54aa87 1511#
a589569f 1512# The network connection information for server
2b54aa87 1513#
2a7e6857
DB
1514# @auth: #optional authentication method used for
1515# the plain (non-websocket) VNC server
2b54aa87 1516#
a589569f
WX
1517# Since: 2.1
1518##
895a2a80 1519{ 'struct': 'VncServerInfo',
a589569f
WX
1520 'base': 'VncBasicInfo',
1521 'data': { '*auth': 'str' } }
1522
1523##
1524# @VncClientInfo:
1525#
1526# Information about a connected VNC client.
2b54aa87
LC
1527#
1528# @x509_dname: #optional If x509 authentication is in use, the Distinguished
1529# Name of the client.
1530#
1531# @sasl_username: #optional If SASL authentication is in use, the SASL username
1532# used for authentication.
1533#
1534# Since: 0.14.0
1535##
895a2a80 1536{ 'struct': 'VncClientInfo',
a589569f 1537 'base': 'VncBasicInfo',
2f44a08b 1538 'data': { '*x509_dname': 'str', '*sasl_username': 'str' } }
2b54aa87
LC
1539
1540##
1541# @VncInfo:
1542#
1543# Information about the VNC session.
1544#
1545# @enabled: true if the VNC server is enabled, false otherwise
1546#
1547# @host: #optional The hostname the VNC server is bound to. This depends on
1548# the name resolution on the host and may be an IP address.
1549#
1550# @family: #optional 'ipv6' if the host is listening for IPv6 connections
1551# 'ipv4' if the host is listening for IPv4 connections
1552# 'unix' if the host is listening on a unix domain socket
1553# 'unknown' otherwise
1554#
1555# @service: #optional The service name of the server's port. This may depends
1556# on the host system's service database so symbolic names should not
1557# be relied on.
1558#
1559# @auth: #optional the current authentication type used by the server
1560# 'none' if no authentication is being used
1561# 'vnc' if VNC authentication is being used
1562# 'vencrypt+plain' if VEncrypt is used with plain text authentication
1563# 'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
1564# 'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
1565# 'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
1566# 'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
1567# 'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
1568# 'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
1569# 'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
1570# 'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
1571#
1572# @clients: a list of @VncClientInfo of all currently connected clients
1573#
1574# Since: 0.14.0
1575##
895a2a80 1576{ 'struct': 'VncInfo',
a589569f
WX
1577 'data': {'enabled': 'bool', '*host': 'str',
1578 '*family': 'NetworkAddressFamily',
2b54aa87
LC
1579 '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
1580
df887684 1581##
4d5c8bc4 1582# @VncPrimaryAuth:
df887684
GH
1583#
1584# vnc primary authentication method.
1585#
1586# Since: 2.3
1587##
1588{ 'enum': 'VncPrimaryAuth',
1589 'data': [ 'none', 'vnc', 'ra2', 'ra2ne', 'tight', 'ultra',
1590 'tls', 'vencrypt', 'sasl' ] }
1591
1592##
1593# @VncVencryptSubAuth:
1594#
1595# vnc sub authentication method with vencrypt.
1596#
1597# Since: 2.3
1598##
1599{ 'enum': 'VncVencryptSubAuth',
1600 'data': [ 'plain',
1601 'tls-none', 'x509-none',
1602 'tls-vnc', 'x509-vnc',
1603 'tls-plain', 'x509-plain',
1604 'tls-sasl', 'x509-sasl' ] }
1605
2a7e6857
DB
1606
1607##
1608# @VncServerInfo2:
1609#
1610# The network connection information for server
1611#
1612# @auth: The current authentication type used by the servers
1613#
1614# @vencrypt: #optional The vencrypt sub authentication type used by the
1615# servers, only specified in case auth == vencrypt.
1616#
1617# Since: 2.9
1618##
1619{ 'struct': 'VncServerInfo2',
1620 'base': 'VncBasicInfo',
1621 'data': { 'auth' : 'VncPrimaryAuth',
1622 '*vencrypt' : 'VncVencryptSubAuth' } }
1623
1624
df887684
GH
1625##
1626# @VncInfo2:
1627#
1628# Information about a vnc server
1629#
1630# @id: vnc server name.
1631#
1632# @server: A list of @VncBasincInfo describing all listening sockets.
1633# The list can be empty (in case the vnc server is disabled).
1634# It also may have multiple entries: normal + websocket,
1635# possibly also ipv4 + ipv6 in the future.
1636#
1637# @clients: A list of @VncClientInfo of all currently connected clients.
1638# The list can be empty, for obvious reasons.
1639#
2a7e6857 1640# @auth: The current authentication type used by the non-websockets servers
df887684 1641#
2a7e6857 1642# @vencrypt: #optional The vencrypt authentication type used by the servers,
df887684
GH
1643# only specified in case auth == vencrypt.
1644#
1645# @display: #optional The display device the vnc server is linked to.
1646#
1647# Since: 2.3
1648##
895a2a80 1649{ 'struct': 'VncInfo2',
df887684 1650 'data': { 'id' : 'str',
2a7e6857 1651 'server' : ['VncServerInfo2'],
df887684
GH
1652 'clients' : ['VncClientInfo'],
1653 'auth' : 'VncPrimaryAuth',
1654 '*vencrypt' : 'VncVencryptSubAuth',
1655 '*display' : 'str' } }
1656
2b54aa87
LC
1657##
1658# @query-vnc:
1659#
1660# Returns information about the current VNC server
1661#
1662# Returns: @VncInfo
2b54aa87
LC
1663#
1664# Since: 0.14.0
85f96549
MAL
1665#
1666# Example:
1667#
1668# -> { "execute": "query-vnc" }
1669# <- { "return": {
1670# "enabled":true,
1671# "host":"0.0.0.0",
1672# "service":"50402",
1673# "auth":"vnc",
1674# "family":"ipv4",
1675# "clients":[
1676# {
1677# "host":"127.0.0.1",
1678# "service":"50401",
1679# "family":"ipv4"
1680# }
1681# ]
1682# }
1683# }
1684#
2b54aa87
LC
1685##
1686{ 'command': 'query-vnc', 'returns': 'VncInfo' }
1687
df887684
GH
1688##
1689# @query-vnc-servers:
1690#
1691# Returns a list of vnc servers. The list can be empty.
1692#
1693# Returns: a list of @VncInfo2
1694#
1695# Since: 2.3
1696##
1697{ 'command': 'query-vnc-servers', 'returns': ['VncInfo2'] }
1698
d1f29646 1699##
5072f7b3 1700# @SpiceBasicInfo:
d1f29646 1701#
a589569f
WX
1702# The basic information for SPICE network connection
1703#
1704# @host: IP address
d1f29646 1705#
a589569f 1706# @port: port number
d1f29646 1707#
a589569f 1708# @family: address family
d1f29646 1709#
a589569f
WX
1710# Since: 2.1
1711##
895a2a80 1712{ 'struct': 'SpiceBasicInfo',
a589569f
WX
1713 'data': { 'host': 'str',
1714 'port': 'str',
1715 'family': 'NetworkAddressFamily' } }
1716
1717##
5072f7b3 1718# @SpiceServerInfo:
d1f29646 1719#
a589569f 1720# Information about a SPICE server
d1f29646 1721#
5d0c7f4f 1722# @auth: #optional authentication method
d1f29646 1723#
a589569f
WX
1724# Since: 2.1
1725##
895a2a80 1726{ 'struct': 'SpiceServerInfo',
a589569f
WX
1727 'base': 'SpiceBasicInfo',
1728 'data': { '*auth': 'str' } }
1729
1730##
5072f7b3 1731# @SpiceChannel:
a589569f
WX
1732#
1733# Information about a SPICE client channel.
d1f29646
LC
1734#
1735# @connection-id: SPICE connection id number. All channels with the same id
1736# belong to the same SPICE session.
1737#
7e781c79
CR
1738# @channel-type: SPICE channel type number. "1" is the main control
1739# channel, filter for this one if you want to track spice
1740# sessions only
d1f29646 1741#
419e1bdf
AL
1742# @channel-id: SPICE channel ID number. Usually "0", might be different when
1743# multiple channels of the same type exist, such as multiple
d1f29646
LC
1744# display channels in a multihead setup
1745#
1746# @tls: true if the channel is encrypted, false otherwise.
1747#
1748# Since: 0.14.0
1749##
895a2a80 1750{ 'struct': 'SpiceChannel',
a589569f
WX
1751 'base': 'SpiceBasicInfo',
1752 'data': {'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
d1f29646
LC
1753 'tls': 'bool'} }
1754
4efee029 1755##
5072f7b3 1756# @SpiceQueryMouseMode:
4efee029 1757#
6932a69b 1758# An enumeration of Spice mouse states.
4efee029
AL
1759#
1760# @client: Mouse cursor position is determined by the client.
1761#
1762# @server: Mouse cursor position is determined by the server.
1763#
1764# @unknown: No information is available about mouse mode used by
1765# the spice server.
1766#
1767# Note: spice/enums.h has a SpiceMouseMode already, hence the name.
1768#
1769# Since: 1.1
1770##
1771{ 'enum': 'SpiceQueryMouseMode',
1772 'data': [ 'client', 'server', 'unknown' ] }
1773
d1f29646 1774##
5072f7b3 1775# @SpiceInfo:
d1f29646
LC
1776#
1777# Information about the SPICE session.
b80e560b 1778#
d1f29646
LC
1779# @enabled: true if the SPICE server is enabled, false otherwise
1780#
61c4efe2 1781# @migrated: true if the last guest migration completed and spice
bc7e2602 1782# migration had completed as well. false otherwise. (since 1.4)
61c4efe2 1783#
d1f29646
LC
1784# @host: #optional The hostname the SPICE server is bound to. This depends on
1785# the name resolution on the host and may be an IP address.
1786#
1787# @port: #optional The SPICE server's port number.
1788#
1789# @compiled-version: #optional SPICE server version.
1790#
1791# @tls-port: #optional The SPICE server's TLS port number.
1792#
1793# @auth: #optional the current authentication type used by the server
419e1bdf
AL
1794# 'none' if no authentication is being used
1795# 'spice' uses SASL or direct TLS authentication, depending on command
1796# line options
d1f29646 1797#
4efee029
AL
1798# @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
1799# be determined by the client or the server, or unknown if spice
bc7e2602 1800# server doesn't provide this information. (since: 1.1)
4efee029 1801#
d1f29646
LC
1802# @channels: a list of @SpiceChannel for each active spice channel
1803#
1804# Since: 0.14.0
1805##
895a2a80 1806{ 'struct': 'SpiceInfo',
61c4efe2 1807 'data': {'enabled': 'bool', 'migrated': 'bool', '*host': 'str', '*port': 'int',
d1f29646 1808 '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
4efee029 1809 'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
d1f29646
LC
1810
1811##
5072f7b3 1812# @query-spice:
d1f29646
LC
1813#
1814# Returns information about the current SPICE server
1815#
1816# Returns: @SpiceInfo
1817#
1818# Since: 0.14.0
bc7e2602
MAL
1819#
1820# Example:
1821#
1822# -> { "execute": "query-spice" }
1823# <- { "return": {
1824# "enabled": true,
1825# "auth": "spice",
1826# "port": 5920,
1827# "tls-port": 5921,
1828# "host": "0.0.0.0",
1829# "channels": [
1830# {
1831# "port": "54924",
1832# "family": "ipv4",
1833# "channel-type": 1,
1834# "connection-id": 1804289383,
1835# "host": "127.0.0.1",
1836# "channel-id": 0,
1837# "tls": true
1838# },
1839# {
1840# "port": "36710",
1841# "family": "ipv4",
1842# "channel-type": 4,
1843# "connection-id": 1804289383,
1844# "host": "127.0.0.1",
1845# "channel-id": 0,
1846# "tls": false
1847# },
1848# [ ... more channels follow ... ]
1849# ]
1850# }
1851# }
1852#
d1f29646
LC
1853##
1854{ 'command': 'query-spice', 'returns': 'SpiceInfo' }
1855
96637bcd
LC
1856##
1857# @BalloonInfo:
1858#
1859# Information about the guest balloon device.
1860#
1861# @actual: the number of bytes the balloon currently contains
1862#
96637bcd
LC
1863# Since: 0.14.0
1864#
96637bcd 1865##
895a2a80 1866{ 'struct': 'BalloonInfo', 'data': {'actual': 'int' } }
96637bcd
LC
1867
1868##
1869# @query-balloon:
1870#
1871# Return information about the balloon device.
1872#
1873# Returns: @BalloonInfo on success
f504e3dc 1874#
96637bcd
LC
1875# If the balloon driver is enabled but not functional because the KVM
1876# kernel module cannot support it, KvmMissingCap
f504e3dc 1877#
96637bcd
LC
1878# If no balloon device is present, DeviceNotActive
1879#
1880# Since: 0.14.0
f504e3dc
MAL
1881#
1882# Example:
1883#
1884# -> { "execute": "query-balloon" }
1885# <- { "return": {
1886# "actual": 1073741824,
1887# }
1888# }
1889#
96637bcd
LC
1890##
1891{ 'command': 'query-balloon', 'returns': 'BalloonInfo' }
1892
79627472
LC
1893##
1894# @PciMemoryRange:
1895#
1896# A PCI device memory region
1897#
1898# @base: the starting address (guest physical)
1899#
1900# @limit: the ending address (guest physical)
1901#
1902# Since: 0.14.0
1903##
895a2a80 1904{ 'struct': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
79627472
LC
1905
1906##
5072f7b3 1907# @PciMemoryRegion:
79627472
LC
1908#
1909# Information about a PCI device I/O region.
1910#
1911# @bar: the index of the Base Address Register for this region
1912#
1913# @type: 'io' if the region is a PIO region
1914# 'memory' if the region is a MMIO region
1915#
3fc3aa6d
MAL
1916# @size: memory size
1917#
79627472
LC
1918# @prefetch: #optional if @type is 'memory', true if the memory is prefetchable
1919#
1920# @mem_type_64: #optional if @type is 'memory', true if the BAR is 64-bit
1921#
1922# Since: 0.14.0
1923##
895a2a80 1924{ 'struct': 'PciMemoryRegion',
79627472
LC
1925 'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
1926 '*prefetch': 'bool', '*mem_type_64': 'bool' } }
1927
1928##
9fa02cd1 1929# @PciBusInfo:
79627472 1930#
9fa02cd1 1931# Information about a bus of a PCI Bridge device
79627472 1932#
9fa02cd1
EB
1933# @number: primary bus interface number. This should be the number of the
1934# bus the device resides on.
79627472 1935#
9fa02cd1
EB
1936# @secondary: secondary bus interface number. This is the number of the
1937# main bus for the bridge
79627472 1938#
9fa02cd1
EB
1939# @subordinate: This is the highest number bus that resides below the
1940# bridge.
79627472 1941#
9fa02cd1 1942# @io_range: The PIO range for all devices on this bridge
79627472 1943#
9fa02cd1 1944# @memory_range: The MMIO range for all devices on this bridge
79627472 1945#
9fa02cd1
EB
1946# @prefetchable_range: The range of prefetchable MMIO for all devices on
1947# this bridge
1948#
1949# Since: 2.4
1950##
1951{ 'struct': 'PciBusInfo',
1952 'data': {'number': 'int', 'secondary': 'int', 'subordinate': 'int',
1953 'io_range': 'PciMemoryRange',
1954 'memory_range': 'PciMemoryRange',
1955 'prefetchable_range': 'PciMemoryRange' } }
1956
1957##
1958# @PciBridgeInfo:
1959#
1960# Information about a PCI Bridge device
1961#
1962# @bus: information about the bus the device resides on
79627472
LC
1963#
1964# @devices: a list of @PciDeviceInfo for each device on this bridge
1965#
1966# Since: 0.14.0
1967##
895a2a80 1968{ 'struct': 'PciBridgeInfo',
9fa02cd1
EB
1969 'data': {'bus': 'PciBusInfo', '*devices': ['PciDeviceInfo']} }
1970
1971##
1972# @PciDeviceClass:
1973#
1974# Information about the Class of a PCI device
1975#
1976# @desc: #optional a string description of the device's class
1977#
1978# @class: the class code of the device
1979#
1980# Since: 2.4
1981##
1982{ 'struct': 'PciDeviceClass',
1983 'data': {'*desc': 'str', 'class': 'int'} }
1984
1985##
1986# @PciDeviceId:
1987#
1988# Information about the Id of a PCI device
1989#
1990# @device: the PCI device id
1991#
1992# @vendor: the PCI vendor id
1993#
1994# Since: 2.4
1995##
1996{ 'struct': 'PciDeviceId',
1997 'data': {'device': 'int', 'vendor': 'int'} }
79627472
LC
1998
1999##
2000# @PciDeviceInfo:
2001#
2002# Information about a PCI device
2003#
2004# @bus: the bus number of the device
2005#
2006# @slot: the slot the device is located in
2007#
2008# @function: the function of the slot used by the device
2009#
9fa02cd1 2010# @class_info: the class of the device
79627472 2011#
9fa02cd1 2012# @id: the PCI device id
79627472
LC
2013#
2014# @irq: #optional if an IRQ is assigned to the device, the IRQ number
2015#
2016# @qdev_id: the device name of the PCI device
2017#
2018# @pci_bridge: if the device is a PCI bridge, the bridge information
2019#
2020# @regions: a list of the PCI I/O regions associated with the device
2021#
2022# Notes: the contents of @class_info.desc are not stable and should only be
2023# treated as informational.
2024#
2025# Since: 0.14.0
2026##
895a2a80 2027{ 'struct': 'PciDeviceInfo',
79627472 2028 'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
9fa02cd1 2029 'class_info': 'PciDeviceClass', 'id': 'PciDeviceId',
79627472
LC
2030 '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
2031 'regions': ['PciMemoryRegion']} }
2032
2033##
2034# @PciInfo:
2035#
2036# Information about a PCI bus
2037#
2038# @bus: the bus index
2039#
2040# @devices: a list of devices on this bus
2041#
2042# Since: 0.14.0
2043##
895a2a80 2044{ 'struct': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
79627472
LC
2045
2046##
2047# @query-pci:
2048#
2049# Return information about the PCI bus topology of the guest.
2050#
3fc3aa6d
MAL
2051# Returns: a list of @PciInfo for each PCI bus. Each bus is
2052# represented by a json-object, which has a key with a json-array of
2053# all PCI devices attached to it. Each device is represented by a
2054# json-object.
79627472
LC
2055#
2056# Since: 0.14.0
3fc3aa6d
MAL
2057#
2058# Example:
2059#
2060# -> { "execute": "query-pci" }
2061# <- { "return": [
2062# {
2063# "bus": 0,
2064# "devices": [
2065# {
2066# "bus": 0,
2067# "qdev_id": "",
2068# "slot": 0,
2069# "class_info": {
2070# "class": 1536,
2071# "desc": "Host bridge"
2072# },
2073# "id": {
2074# "device": 32902,
2075# "vendor": 4663
2076# },
2077# "function": 0,
2078# "regions": [
2079# ]
2080# },
2081# {
2082# "bus": 0,
2083# "qdev_id": "",
2084# "slot": 1,
2085# "class_info": {
2086# "class": 1537,
2087# "desc": "ISA bridge"
2088# },
2089# "id": {
2090# "device": 32902,
2091# "vendor": 28672
2092# },
2093# "function": 0,
2094# "regions": [
2095# ]
2096# },
2097# {
2098# "bus": 0,
2099# "qdev_id": "",
2100# "slot": 1,
2101# "class_info": {
2102# "class": 257,
2103# "desc": "IDE controller"
2104# },
2105# "id": {
2106# "device": 32902,
2107# "vendor": 28688
2108# },
2109# "function": 1,
2110# "regions": [
2111# {
2112# "bar": 4,
2113# "size": 16,
2114# "address": 49152,
2115# "type": "io"
2116# }
2117# ]
2118# },
2119# {
2120# "bus": 0,
2121# "qdev_id": "",
2122# "slot": 2,
2123# "class_info": {
2124# "class": 768,
2125# "desc": "VGA controller"
2126# },
2127# "id": {
2128# "device": 4115,
2129# "vendor": 184
2130# },
2131# "function": 0,
2132# "regions": [
2133# {
2134# "prefetch": true,
2135# "mem_type_64": false,
2136# "bar": 0,
2137# "size": 33554432,
2138# "address": 4026531840,
2139# "type": "memory"
2140# },
2141# {
2142# "prefetch": false,
2143# "mem_type_64": false,
2144# "bar": 1,
2145# "size": 4096,
2146# "address": 4060086272,
2147# "type": "memory"
2148# },
2149# {
2150# "prefetch": false,
2151# "mem_type_64": false,
2152# "bar": 6,
2153# "size": 65536,
2154# "address": -1,
2155# "type": "memory"
2156# }
2157# ]
2158# },
2159# {
2160# "bus": 0,
2161# "qdev_id": "",
2162# "irq": 11,
2163# "slot": 4,
2164# "class_info": {
2165# "class": 1280,
2166# "desc": "RAM controller"
2167# },
2168# "id": {
2169# "device": 6900,
2170# "vendor": 4098
2171# },
2172# "function": 0,
2173# "regions": [
2174# {
2175# "bar": 0,
2176# "size": 32,
2177# "address": 49280,
2178# "type": "io"
2179# }
2180# ]
2181# }
2182# ]
2183# }
2184# ]
2185# }
2186#
2187# Note: This example has been shortened as the real response is too long.
2188#
79627472
LC
2189##
2190{ 'command': 'query-pci', 'returns': ['PciInfo'] }
2191
7a7f325e
LC
2192##
2193# @quit:
2194#
2195# This command will cause the QEMU process to exit gracefully. While every
2196# attempt is made to send the QMP response before terminating, this is not
2197# guaranteed. When using this interface, a premature EOF would not be
2198# unexpected.
2199#
2200# Since: 0.14.0
8046bf53
MAL
2201#
2202# Example:
2203#
2204# -> { "execute": "quit" }
2205# <- { "return": {} }
7a7f325e
LC
2206##
2207{ 'command': 'quit' }
5f158f21
LC
2208
2209##
2210# @stop:
2211#
2212# Stop all guest VCPU execution.
2213#
2214# Since: 0.14.0
2215#
2216# Notes: This function will succeed even if the guest is already in the stopped
1e998146
PB
2217# state. In "inmigrate" state, it will ensure that the guest
2218# remains paused once migration finishes, as if the -S option was
2219# passed on the command line.
9787339e
MAL
2220#
2221# Example:
2222#
2223# -> { "execute": "stop" }
2224# <- { "return": {} }
2225#
5f158f21
LC
2226##
2227{ 'command': 'stop' }
38d22653
LC
2228
2229##
2230# @system_reset:
2231#
2232# Performs a hard reset of a guest.
2233#
2234# Since: 0.14.0
cd98e00b
MAL
2235#
2236# Example:
2237#
2238# -> { "execute": "system_reset" }
2239# <- { "return": {} }
2240#
38d22653
LC
2241##
2242{ 'command': 'system_reset' }
5bc465e4
LC
2243
2244##
2245# @system_powerdown:
2246#
2247# Requests that a guest perform a powerdown operation.
2248#
2249# Since: 0.14.0
2250#
2251# Notes: A guest may or may not respond to this command. This command
2252# returning does not indicate that a guest has accepted the request or
2253# that it has shut down. Many guests will respond to this command by
2254# prompting the user in some way.
04fcbabc
MAL
2255# Example:
2256#
2257# -> { "execute": "system_powerdown" }
2258# <- { "return": {} }
2259#
5bc465e4
LC
2260##
2261{ 'command': 'system_powerdown' }
755f1968
LC
2262
2263##
2264# @cpu:
2265#
2266# This command is a nop that is only provided for the purposes of compatibility.
2267#
2268# Since: 0.14.0
2269#
2270# Notes: Do not use this command.
2271##
2272{ 'command': 'cpu', 'data': {'index': 'int'} }
0cfd6a9a 2273
69ca3ea5 2274##
5072f7b3 2275# @cpu-add:
69ca3ea5
IM
2276#
2277# Adds CPU with specified ID
2278#
2279# @id: ID of CPU to be created, valid values [0..max_cpus)
2280#
2281# Returns: Nothing on success
2282#
5072f7b3 2283# Since: 1.5
a7b83754
MAL
2284#
2285# Example:
2286#
2287# -> { "execute": "cpu-add", "arguments": { "id": 2 } }
2288# <- { "return": {} }
2289#
69ca3ea5
IM
2290##
2291{ 'command': 'cpu-add', 'data': {'id': 'int'} }
2292
0cfd6a9a
LC
2293##
2294# @memsave:
2295#
2296# Save a portion of guest memory to a file.
2297#
2298# @val: the virtual address of the guest to start from
2299#
2300# @size: the size of memory region to save
2301#
2302# @filename: the file to save the memory to as binary data
2303#
2304# @cpu-index: #optional the index of the virtual CPU to use for translating the
2305# virtual address (defaults to CPU 0)
2306#
2307# Returns: Nothing on success
0cfd6a9a
LC
2308#
2309# Since: 0.14.0
2310#
2311# Notes: Errors were not reliably returned until 1.1
30831b63
MAL
2312#
2313# Example:
2314#
2315# -> { "execute": "memsave",
2316# "arguments": { "val": 10,
2317# "size": 100,
2318# "filename": "/tmp/virtual-mem-dump" } }
2319# <- { "return": {} }
2320#
0cfd6a9a
LC
2321##
2322{ 'command': 'memsave',
2323 'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
6d3962bf
LC
2324
2325##
2326# @pmemsave:
2327#
2328# Save a portion of guest physical memory to a file.
2329#
2330# @val: the physical address of the guest to start from
2331#
2332# @size: the size of memory region to save
2333#
2334# @filename: the file to save the memory to as binary data
2335#
2336# Returns: Nothing on success
6d3962bf
LC
2337#
2338# Since: 0.14.0
2339#
2340# Notes: Errors were not reliably returned until 1.1
978d4d97
MAL
2341#
2342# Example:
2343#
2344# -> { "execute": "pmemsave",
2345# "arguments": { "val": 10,
2346# "size": 100,
2347# "filename": "/tmp/physical-mem-dump" } }
2348# <- { "return": {} }
2349#
6d3962bf
LC
2350##
2351{ 'command': 'pmemsave',
2352 'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
e42e818b
LC
2353
2354##
2355# @cont:
2356#
2357# Resume guest VCPU execution.
2358#
2359# Since: 0.14.0
2360#
2361# Returns: If successful, nothing
e42e818b
LC
2362# If QEMU was started with an encrypted block device and a key has
2363# not yet been set, DeviceEncrypted.
2364#
1e998146
PB
2365# Notes: This command will succeed if the guest is currently running. It
2366# will also succeed if the guest is in the "inmigrate" state; in
2367# this case, the effect of the command is to make sure the guest
2368# starts once migration finishes, removing the effect of the -S
2369# command line option if it was passed.
3815d0de
MAL
2370#
2371# Example:
2372#
2373# -> { "execute": "cont" }
2374# <- { "return": {} }
2375#
e42e818b
LC
2376##
2377{ 'command': 'cont' }
2378
9b9df25a
GH
2379##
2380# @system_wakeup:
2381#
2382# Wakeup guest from suspend. Does nothing in case the guest isn't suspended.
2383#
2384# Since: 1.1
2385#
2386# Returns: nothing.
253cdee1
MAL
2387#
2388# Example:
2389#
2390# -> { "execute": "system_wakeup" }
2391# <- { "return": {} }
2392#
9b9df25a
GH
2393##
2394{ 'command': 'system_wakeup' }
2395
ab49ab5c
LC
2396##
2397# @inject-nmi:
2398#
9cb805fd 2399# Injects a Non-Maskable Interrupt into the default CPU (x86/s390) or all CPUs (ppc64).
149ea099 2400# The command fails when the guest doesn't support injecting.
ab49ab5c
LC
2401#
2402# Returns: If successful, nothing
ab49ab5c
LC
2403#
2404# Since: 0.14.0
2405#
9cb805fd 2406# Note: prior to 2.1, this command was only supported for x86 and s390 VMs
149ea099
MAL
2407#
2408# Example:
2409#
2410# -> { "execute": "inject-nmi" }
2411# <- { "return": {} }
2412#
ab49ab5c
LC
2413##
2414{ 'command': 'inject-nmi' }
4b37156c
LC
2415
2416##
2417# @set_link:
2418#
2419# Sets the link status of a virtual network adapter.
2420#
2421# @name: the device name of the virtual network adapter
2422#
2423# @up: true to set the link status to be up
2424#
2425# Returns: Nothing on success
2426# If @name is not a valid network device, DeviceNotFound
2427#
2428# Since: 0.14.0
2429#
2430# Notes: Not all network adapters support setting link status. This command
2431# will succeed even if the network adapter does not support link status
2432# notification.
f9cfb8f7
MAL
2433#
2434# Example:
2435#
2436# -> { "execute": "set_link",
2437# "arguments": { "name": "e1000.0", "up": false } }
2438# <- { "return": {} }
2439#
4b37156c
LC
2440##
2441{ 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
a4dea8a9 2442
d72f3264
LC
2443##
2444# @balloon:
2445#
2446# Request the balloon driver to change its balloon size.
2447#
2448# @value: the target size of the balloon in bytes
2449#
2450# Returns: Nothing on success
2451# If the balloon driver is enabled but not functional because the KVM
2452# kernel module cannot support it, KvmMissingCap
2453# If no balloon device is present, DeviceNotActive
2454#
2455# Notes: This command just issues a request to the guest. When it returns,
2456# the balloon size may not have changed. A guest can change the balloon
2457# size independent of this command.
2458#
2459# Since: 0.14.0
7b338db7
MAL
2460#
2461# Example:
2462#
2463# -> { "execute": "balloon", "arguments": { "value": 536870912 } }
2464# <- { "return": {} }
2465#
d72f3264
LC
2466##
2467{ 'command': 'balloon', 'data': {'value': 'int'} }
5e7caacb 2468
78b18b78 2469##
5072f7b3 2470# @Abort:
78b18b78
SH
2471#
2472# This action can be used to test transaction failure.
2473#
2474# Since: 1.6
5072f7b3 2475##
895a2a80 2476{ 'struct': 'Abort',
78b18b78
SH
2477 'data': { } }
2478
94d16a64 2479##
5072f7b3 2480# @ActionCompletionMode:
94d16a64
JS
2481#
2482# An enumeration of Transactional completion modes.
2483#
2484# @individual: Do not attempt to cancel any other Actions if any Actions fail
2485# after the Transaction request succeeds. All Actions that
2486# can complete successfully will do so without waiting on others.
2487# This is the default.
2488#
2489# @grouped: If any Action fails after the Transaction succeeds, cancel all
2490# Actions. Actions do not complete until all Actions are ready to
2491# complete. May be rejected by Actions that do not support this
2492# completion mode.
2493#
2494# Since: 2.5
2495##
2496{ 'enum': 'ActionCompletionMode',
2497 'data': [ 'individual', 'grouped' ] }
2498
8802d1fd 2499##
5072f7b3 2500# @TransactionAction:
8802d1fd 2501#
52e7c241 2502# A discriminated record of operations that can be performed with
41dc1dc0 2503# @transaction. Action @type can be:
b7b9d39a 2504#
41dc1dc0
MAL
2505# - @abort: since 1.6
2506# - @block-dirty-bitmap-add: since 2.5
2507# - @block-dirty-bitmap-clear: since 2.5
2508# - @blockdev-backup: since 2.3
2509# - @blockdev-snapshot: since 2.5
2510# - @blockdev-snapshot-internal-sync: since 1.7
2511# - @blockdev-snapshot-sync: since 1.1
2512# - @drive-backup: since 1.6
b7b9d39a 2513#
41dc1dc0 2514# Since: 1.1
8802d1fd 2515##
c8a83e85 2516{ 'union': 'TransactionAction',
52e7c241 2517 'data': {
bbe86010 2518 'abort': 'Abort',
df9a681d 2519 'block-dirty-bitmap-add': 'BlockDirtyBitmapAdd',
41dc1dc0
MAL
2520 'block-dirty-bitmap-clear': 'BlockDirtyBitmap',
2521 'blockdev-backup': 'BlockdevBackup',
2522 'blockdev-snapshot': 'BlockdevSnapshot',
2523 'blockdev-snapshot-internal-sync': 'BlockdevSnapshotInternal',
2524 'blockdev-snapshot-sync': 'BlockdevSnapshotSync',
2525 'drive-backup': 'DriveBackup'
52e7c241 2526 } }
8802d1fd 2527
94d16a64 2528##
5072f7b3 2529# @TransactionProperties:
94d16a64
JS
2530#
2531# Optional arguments to modify the behavior of a Transaction.
2532#
2533# @completion-mode: #optional Controls how jobs launched asynchronously by
2534# Actions will complete or fail as a group.
2535# See @ActionCompletionMode for details.
2536#
2537# Since: 2.5
2538##
2539{ 'struct': 'TransactionProperties',
2540 'data': {
2541 '*completion-mode': 'ActionCompletionMode'
2542 }
2543}
2544
8802d1fd 2545##
5072f7b3 2546# @transaction:
8802d1fd 2547#
c8a83e85
KW
2548# Executes a number of transactionable QMP commands atomically. If any
2549# operation fails, then the entire set of actions will be abandoned and the
2550# appropriate error returned.
8802d1fd 2551#
5c82b0f1
MAL
2552# For external snapshots, the dictionary contains the device, the file to use for
2553# the new snapshot, and the format. The default format, if not specified, is
2554# qcow2.
2555#
2556# Each new snapshot defaults to being created by QEMU (wiping any
2557# contents if the file already exists), but it is also possible to reuse
2558# an externally-created file. In the latter case, you should ensure that
2559# the new image file has the same contents as the current one; QEMU cannot
2560# perform any meaningful check. Typically this is achieved by using the
2561# current image file as the backing file for the new image.
2562#
2563# On failure, the original disks pre-snapshot attempt will be used.
2564#
2565# For internal snapshots, the dictionary contains the device and the snapshot's
2566# name. If an internal snapshot matching name already exists, the request will
2567# be rejected. Only some image formats support it, for example, qcow2, rbd,
2568# and sheepdog.
2569#
2570# On failure, qemu will try delete the newly created internal snapshot in the
2571# transaction. When an I/O error occurs during deletion, the user needs to fix
2572# it later with qemu-img or other command.
2573#
94d16a64
JS
2574# @actions: List of @TransactionAction;
2575# information needed for the respective operations.
2576#
2577# @properties: #optional structure of additional options to control the
2578# execution of the transaction. See @TransactionProperties
2579# for additional detail.
8802d1fd
JC
2580#
2581# Returns: nothing on success
5c82b0f1 2582#
c8a83e85 2583# Errors depend on the operations of the transaction
8802d1fd 2584#
c8a83e85
KW
2585# Note: The transaction aborts on the first failure. Therefore, there will be
2586# information on only one failed operation returned in an error condition, and
52e7c241
PB
2587# subsequent actions will not have been attempted.
2588#
5072f7b3 2589# Since: 1.1
5c82b0f1
MAL
2590#
2591# Example:
2592#
2593# -> { "execute": "transaction",
2594# "arguments": { "actions": [
2595# { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd0",
2596# "snapshot-file": "/some/place/my-image",
2597# "format": "qcow2" } },
2598# { "type": "blockdev-snapshot-sync", "data" : { "node-name": "myfile",
2599# "snapshot-file": "/some/place/my-image2",
2600# "snapshot-node-name": "node3432",
2601# "mode": "existing",
2602# "format": "qcow2" } },
2603# { "type": "blockdev-snapshot-sync", "data" : { "device": "ide-hd1",
2604# "snapshot-file": "/some/place/my-image2",
2605# "mode": "existing",
2606# "format": "qcow2" } },
2607# { "type": "blockdev-snapshot-internal-sync", "data" : {
2608# "device": "ide-hd2",
2609# "name": "snapshot0" } } ] } }
2610# <- { "return": {} }
2611#
8802d1fd 2612##
52e7c241 2613{ 'command': 'transaction',
94d16a64
JS
2614 'data': { 'actions': [ 'TransactionAction' ],
2615 '*properties': 'TransactionProperties'
2616 }
2617}
8802d1fd 2618
d51a67b4
LC
2619##
2620# @human-monitor-command:
2621#
2622# Execute a command on the human monitor and return the output.
2623#
2624# @command-line: the command to execute in the human monitor
2625#
2626# @cpu-index: #optional The CPU to use for commands that require an implicit CPU
2627#
2628# Returns: the output of the command as a string
2629#
1ad166b6 2630# Since: 0.14.0
08e4ed6c 2631#
1ad166b6 2632# Notes: This command only exists as a stop-gap. Its use is highly
e9ac76ac
MAL
2633# discouraged. The semantics of this command are not
2634# guaranteed: this means that command names, arguments and
2635# responses can change or be removed at ANY time. Applications
2636# that rely on long term stability guarantees should NOT
2637# use this command.
b952b558 2638#
1ad166b6 2639# Known limitations:
b952b558 2640#
3df58d41 2641# * This command is stateless, this means that commands that depend
1ad166b6 2642# on state information (such as getfd) might not work
d9b902db 2643#
3df58d41
MAL
2644# * Commands that prompt the user for data (eg. 'cont' when the block
2645# device is encrypted) don't currently work
e9ac76ac
MAL
2646#
2647# Example:
2648#
2649# -> { "execute": "human-monitor-command",
2650# "arguments": { "command-line": "info kvm" } }
2651# <- { "return": "kvm support: enabled\r\n" }
2652#
d9b902db 2653##
1ad166b6
BC
2654{ 'command': 'human-monitor-command',
2655 'data': {'command-line': 'str', '*cpu-index': 'int'},
2656 'returns': 'str' }
d9b902db
PB
2657
2658##
5072f7b3 2659# @migrate_cancel:
6cdedb07
LC
2660#
2661# Cancel the current executing migration process.
2662#
2663# Returns: nothing on success
2664#
2665# Notes: This command succeeds even if there is no migration process running.
2666#
2667# Since: 0.14.0
92dcfb43
MAL
2668#
2669# Example:
2670#
2671# -> { "execute": "migrate_cancel" }
2672# <- { "return": {} }
2673#
6cdedb07
LC
2674##
2675{ 'command': 'migrate_cancel' }
4f0a993b
LC
2676
2677##
5072f7b3 2678# @migrate_set_downtime:
4f0a993b
LC
2679#
2680# Set maximum tolerated downtime for migration.
2681#
2682# @value: maximum downtime in seconds
2683#
2684# Returns: nothing on success
2685#
2ff30257
AA
2686# Notes: This command is deprecated in favor of 'migrate-set-parameters'
2687#
4f0a993b 2688# Since: 0.14.0
de0b45ea
MAL
2689#
2690# Example:
2691#
2692# -> { "execute": "migrate_set_downtime", "arguments": { "value": 0.1 } }
2693# <- { "return": {} }
2694#
4f0a993b
LC
2695##
2696{ 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
3dc85383
LC
2697
2698##
5072f7b3 2699# @migrate_set_speed:
3dc85383
LC
2700#
2701# Set maximum speed for migration.
2702#
ab989533 2703# @value: maximum speed in bytes per second.
3dc85383
LC
2704#
2705# Returns: nothing on success
2706#
2ff30257 2707# Notes: This command is deprecated in favor of 'migrate-set-parameters'
3dc85383
LC
2708#
2709# Since: 0.14.0
ab989533
MAL
2710#
2711# Example:
2712#
2713# -> { "execute": "migrate_set_speed", "arguments": { "value": 1024 } }
2714# <- { "return": {} }
2715#
3dc85383
LC
2716##
2717{ 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
b4b12c62 2718
9e1ba4cc 2719##
5072f7b3 2720# @migrate-set-cache-size:
9e1ba4cc 2721#
8f457b67 2722# Set cache size to be used by XBZRLE migration
9e1ba4cc
OW
2723#
2724# @value: cache size in bytes
2725#
2726# The size will be rounded down to the nearest power of 2.
2727# The cache size can be modified before and during ongoing migration
2728#
2729# Returns: nothing on success
2730#
2731# Since: 1.2
8f457b67
MAL
2732#
2733# Example:
2734#
2735# -> { "execute": "migrate-set-cache-size",
2736# "arguments": { "value": 536870912 } }
2737# <- { "return": {} }
2738#
9e1ba4cc
OW
2739##
2740{ 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
2741
2742##
5072f7b3 2743# @query-migrate-cache-size:
9e1ba4cc 2744#
b953601b 2745# Query migration XBZRLE cache size
9e1ba4cc
OW
2746#
2747# Returns: XBZRLE cache size in bytes
2748#
2749# Since: 1.2
b953601b
MAL
2750#
2751# Example:
2752#
2753# -> { "execute": "query-migrate-cache-size" }
2754# <- { "return": 67108864 }
2755#
9e1ba4cc
OW
2756##
2757{ 'command': 'query-migrate-cache-size', 'returns': 'int' }
2758
b4b12c62 2759##
d03ee401 2760# @ObjectPropertyInfo:
b4b12c62
AL
2761#
2762# @name: the name of the property
2763#
2764# @type: the type of the property. This will typically come in one of four
2765# forms:
2766#
2767# 1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
2768# These types are mapped to the appropriate JSON type.
2769#
33b23b4b 2770# 2) A child type in the form 'child<subtype>' where subtype is a qdev
b4b12c62
AL
2771# device type name. Child properties create the composition tree.
2772#
33b23b4b 2773# 3) A link type in the form 'link<subtype>' where subtype is a qdev
b4b12c62
AL
2774# device type name. Link properties form the device model graph.
2775#
51920820 2776# Since: 1.2
b4b12c62 2777##
895a2a80 2778{ 'struct': 'ObjectPropertyInfo',
b4b12c62
AL
2779 'data': { 'name': 'str', 'type': 'str' } }
2780
2781##
2782# @qom-list:
2783#
57c9fafe 2784# This command will list any properties of a object given a path in the object
b4b12c62
AL
2785# model.
2786#
57c9fafe 2787# @path: the path within the object model. See @qom-get for a description of
b4b12c62
AL
2788# this parameter.
2789#
57c9fafe
AL
2790# Returns: a list of @ObjectPropertyInfo that describe the properties of the
2791# object.
b4b12c62 2792#
51920820 2793# Since: 1.2
b4b12c62
AL
2794##
2795{ 'command': 'qom-list',
2796 'data': { 'path': 'str' },
57c9fafe 2797 'returns': [ 'ObjectPropertyInfo' ] }
eb6e8ea5
AL
2798
2799##
2800# @qom-get:
2801#
57c9fafe 2802# This command will get a property from a object model path and return the
eb6e8ea5
AL
2803# value.
2804#
57c9fafe 2805# @path: The path within the object model. There are two forms of supported
eb6e8ea5
AL
2806# paths--absolute and partial paths.
2807#
57c9fafe 2808# Absolute paths are derived from the root object and can follow child<>
eb6e8ea5
AL
2809# or link<> properties. Since they can follow link<> properties, they
2810# can be arbitrarily long. Absolute paths look like absolute filenames
2811# and are prefixed with a leading slash.
2812#
2813# Partial paths look like relative filenames. They do not begin
2814# with a prefix. The matching rules for partial paths are subtle but
57c9fafe 2815# designed to make specifying objects easy. At each level of the
eb6e8ea5
AL
2816# composition tree, the partial path is matched as an absolute path.
2817# The first match is not returned. At least two matches are searched
2818# for. A successful result is only returned if only one match is
2819# found. If more than one match is found, a flag is return to
2820# indicate that the match was ambiguous.
2821#
2822# @property: The property name to read
2823#
33b23b4b
MAL
2824# Returns: The property value. The type depends on the property
2825# type. child<> and link<> properties are returned as #str
2826# pathnames. All integer property types (u8, u16, etc) are
2827# returned as #int.
eb6e8ea5 2828#
51920820 2829# Since: 1.2
eb6e8ea5
AL
2830##
2831{ 'command': 'qom-get',
2832 'data': { 'path': 'str', 'property': 'str' },
6eb3937e 2833 'returns': 'any' }
eb6e8ea5
AL
2834
2835##
2836# @qom-set:
2837#
57c9fafe 2838# This command will set a property from a object model path.
eb6e8ea5
AL
2839#
2840# @path: see @qom-get for a description of this parameter
2841#
2842# @property: the property name to set
2843#
2844# @value: a value who's type is appropriate for the property type. See @qom-get
2845# for a description of type mapping.
2846#
51920820 2847# Since: 1.2
eb6e8ea5
AL
2848##
2849{ 'command': 'qom-set',
6eb3937e 2850 'data': { 'path': 'str', 'property': 'str', 'value': 'any' } }
fbf796fd
LC
2851
2852##
2853# @set_password:
2854#
2855# Sets the password of a remote display session.
2856#
2857# @protocol: `vnc' to modify the VNC server password
2858# `spice' to modify the Spice server password
2859#
2860# @password: the new password
2861#
2862# @connected: #optional how to handle existing clients when changing the
b80e560b 2863# password. If nothing is specified, defaults to `keep'
fbf796fd
LC
2864# `fail' to fail the command if clients are connected
2865# `disconnect' to disconnect existing clients
2866# `keep' to maintain existing clients
2867#
2868# Returns: Nothing on success
2869# If Spice is not enabled, DeviceNotFound
fbf796fd
LC
2870#
2871# Since: 0.14.0
4d8a374e
MAL
2872#
2873# Example:
2874#
2875# -> { "execute": "set_password", "arguments": { "protocol": "vnc",
2876# "password": "secret" } }
2877# <- { "return": {} }
2878#
fbf796fd
LC
2879##
2880{ 'command': 'set_password',
2881 'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
9ad5372d
LC
2882
2883##
2884# @expire_password:
2885#
2886# Expire the password of a remote display server.
2887#
2888# @protocol: the name of the remote display protocol `vnc' or `spice'
2889#
2890# @time: when to expire the password.
2891# `now' to expire the password immediately
2892# `never' to cancel password expiration
2893# `+INT' where INT is the number of seconds from now (integer)
2894# `INT' where INT is the absolute time in seconds
2895#
2896# Returns: Nothing on success
2897# If @protocol is `spice' and Spice is not active, DeviceNotFound
9ad5372d
LC
2898#
2899# Since: 0.14.0
2900#
2901# Notes: Time is relative to the server and currently there is no way to
2902# coordinate server time with client time. It is not recommended to
2903# use the absolute time version of the @time parameter unless you're
2904# sure you are on the same machine as the QEMU instance.
342816b9
MAL
2905#
2906# Example:
2907#
2908# -> { "execute": "expire_password", "arguments": { "protocol": "vnc",
2909# "time": "+60" } }
2910# <- { "return": {} }
2911#
9ad5372d
LC
2912##
2913{ 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
c245b6a3 2914
270b243f
LC
2915##
2916# @change-vnc-password:
2917#
2918# Change the VNC server password.
2919#
1c854067 2920# @password: the new password to use with VNC authentication
270b243f
LC
2921#
2922# Since: 1.1
2923#
2924# Notes: An empty password in this command will set the password to the empty
2925# string. Existing clients are unaffected by executing this command.
2926##
2927{ 'command': 'change-vnc-password', 'data': {'password': 'str'} }
333a96ec
LC
2928
2929##
2930# @change:
2931#
2932# This command is multiple commands multiplexed together.
2933#
2934# @device: This is normally the name of a block device but it may also be 'vnc'.
2935# when it's 'vnc', then sub command depends on @target
2936#
2937# @target: If @device is a block device, then this is the new filename.
2938# If @device is 'vnc', then if the value 'password' selects the vnc
2939# change password command. Otherwise, this specifies a new server URI
2940# address to listen to for VNC connections.
2941#
2942# @arg: If @device is a block device, then this is an optional format to open
2943# the device with.
2944# If @device is 'vnc' and @target is 'password', this is the new VNC
2945# password to set. If this argument is an empty string, then no future
2946# logins will be allowed.
2947#
2948# Returns: Nothing on success.
2949# If @device is not a valid block device, DeviceNotFound
333a96ec
LC
2950# If the new block device is encrypted, DeviceEncrypted. Note that
2951# if this error is returned, the device has been opened successfully
2952# and an additional call to @block_passwd is required to set the
2953# device's password. The behavior of reads and writes to the block
2954# device between when these calls are executed is undefined.
2955#
24fb4133
HR
2956# Notes: This interface is deprecated, and it is strongly recommended that you
2957# avoid using it. For changing block devices, use
2958# blockdev-change-medium; for changing VNC parameters, use
2959# change-vnc-password.
333a96ec
LC
2960#
2961# Since: 0.14.0
01387ae5
MAL
2962#
2963# Example:
2964#
2965# 1. Change a removable medium
2966#
2967# -> { "execute": "change",
2968# "arguments": { "device": "ide1-cd0",
2969# "target": "/srv/images/Fedora-12-x86_64-DVD.iso" } }
2970# <- { "return": {} }
2971#
2972# 2. Change VNC password
2973#
2974# -> { "execute": "change",
2975# "arguments": { "device": "vnc", "target": "password",
2976# "arg": "foobar1" } }
2977# <- { "return": {} }
2978#
333a96ec
LC
2979##
2980{ 'command': 'change',
2981 'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
80047da5 2982
5eeee3fa
AL
2983##
2984# @ObjectTypeInfo:
2985#
2986# This structure describes a search result from @qom-list-types
2987#
2988# @name: the type name found in the search
2989#
2990# Since: 1.1
2991#
2992# Notes: This command is experimental and may change syntax in future releases.
2993##
895a2a80 2994{ 'struct': 'ObjectTypeInfo',
5eeee3fa
AL
2995 'data': { 'name': 'str' } }
2996
2997##
2998# @qom-list-types:
2999#
3000# This command will return a list of types given search parameters
3001#
3002# @implements: if specified, only return types that implement this type name
3003#
3004# @abstract: if true, include abstract types in the results
3005#
3006# Returns: a list of @ObjectTypeInfo or an empty list if no results are found
3007#
3008# Since: 1.1
5eeee3fa
AL
3009##
3010{ 'command': 'qom-list-types',
3011 'data': { '*implements': 'str', '*abstract': 'bool' },
3012 'returns': [ 'ObjectTypeInfo' ] }
e1c37d0e 3013
1daa31b9
AL
3014##
3015# @DevicePropertyInfo:
3016#
3017# Information about device properties.
3018#
3019# @name: the name of the property
3020# @type: the typename of the property
07d09c58
GA
3021# @description: #optional if specified, the description of the property.
3022# (since 2.2)
1daa31b9
AL
3023#
3024# Since: 1.2
3025##
895a2a80 3026{ 'struct': 'DevicePropertyInfo',
07d09c58 3027 'data': { 'name': 'str', 'type': 'str', '*description': 'str' } }
1daa31b9
AL
3028
3029##
3030# @device-list-properties:
3031#
3032# List properties associated with a device.
3033#
3034# @typename: the type name of a device
3035#
3036# Returns: a list of DevicePropertyInfo describing a devices properties
3037#
3038# Since: 1.2
3039##
3040{ 'command': 'device-list-properties',
3041 'data': { 'typename': 'str'},
3042 'returns': [ 'DevicePropertyInfo' ] }
3043
e1c37d0e 3044##
5072f7b3 3045# @migrate:
e1c37d0e
LC
3046#
3047# Migrates the current running guest to another Virtual Machine.
3048#
3049# @uri: the Uniform Resource Identifier of the destination VM
3050#
3051# @blk: #optional do block migration (full disk copy)
3052#
3053# @inc: #optional incremental disk copy migration
3054#
3055# @detach: this argument exists only for compatibility reasons and
3056# is ignored by QEMU
3057#
3058# Returns: nothing on success
3059#
3060# Since: 0.14.0
b3ac5a0d
MAL
3061#
3062# Notes:
3063#
3064# 1. The 'query-migrate' command should be used to check migration's progress
3065# and final result (this information is provided by the 'status' member)
3066#
3067# 2. All boolean arguments default to false
3068#
3069# 3. The user Monitor's "detach" argument is invalid in QMP and should not
3070# be used
3071#
3072# Example:
3073#
3074# -> { "execute": "migrate", "arguments": { "uri": "tcp:0:4446" } }
3075# <- { "return": {} }
3076#
e1c37d0e
LC
3077##
3078{ 'command': 'migrate',
3079 'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
33cf629a 3080
bf1ae1f4 3081##
5072f7b3 3082# @migrate-incoming:
bf1ae1f4
DDAG
3083#
3084# Start an incoming migration, the qemu must have been started
3085# with -incoming defer
3086#
3087# @uri: The Uniform Resource Identifier identifying the source or
3088# address to listen on
3089#
3090# Returns: nothing on success
3091#
3092# Since: 2.3
dbdbddb9
MAL
3093#
3094# Notes:
3095#
3096# 1. It's a bad idea to use a string for the uri, but it needs to stay
3097# compatible with -incoming and the format of the uri is already exposed
3098# above libvirt.
3099#
3100# 2. QEMU must be started with -incoming defer to allow migrate-incoming to
3101# be used.
3102#
3103# 3. The uri format is the same as for -incoming
3104#
3105# Example:
3106#
3107# -> { "execute": "migrate-incoming",
3108# "arguments": { "uri": "tcp::4446" } }
3109# <- { "return": {} }
3110#
bf1ae1f4
DDAG
3111##
3112{ 'command': 'migrate-incoming', 'data': {'uri': 'str' } }
3113
49687ace 3114##
a7ae8355
SS
3115# @xen-save-devices-state:
3116#
3117# Save the state of all devices to file. The RAM and the block devices
3118# of the VM are not saved by this command.
3119#
3120# @filename: the file to save the state of the devices to as binary
3121# data. See xen-save-devices-state.txt for a description of the binary
3122# format.
3123#
3124# Returns: Nothing on success
a7ae8355
SS
3125#
3126# Since: 1.1
2ea72beb
MAL
3127#
3128# Example:
3129#
3130# -> { "execute": "xen-save-devices-state",
3131# "arguments": { "filename": "/tmp/save" } }
3132# <- { "return": {} }
3133#
a7ae8355
SS
3134##
3135{ 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
a15fef21 3136
39f42439 3137##
5072f7b3 3138# @xen-set-global-dirty-log:
39f42439
AP
3139#
3140# Enable or disable the global dirty log mode.
3141#
3142# @enable: true to enable, false to disable.
3143#
3144# Returns: nothing
3145#
3146# Since: 1.3
a4df6eff
MAL
3147#
3148# Example:
3149#
3150# -> { "execute": "xen-set-global-dirty-log",
3151# "arguments": { "enable": true } }
3152# <- { "return": {} }
3153#
39f42439
AP
3154##
3155{ 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
3156
94cfd07f
MAL
3157##
3158# @device_add:
3159#
3160# @driver: the name of the new device's driver
3161#
3162# @bus: #optional the device's parent bus (device tree path)
3163#
b780e9c3 3164# @id: #optional the device's ID, must be unique
94cfd07f
MAL
3165#
3166# Additional arguments depend on the type.
3167#
3168# Add a device.
3169#
3170# Notes:
3171# 1. For detailed information about this command, please refer to the
3172# 'docs/qdev-device-use.txt' file.
3173#
3174# 2. It's possible to list device properties by running QEMU with the
3175# "-device DEVICE,help" command-line argument, where DEVICE is the
3176# device's name
3177#
3178# Example:
3179#
3180# -> { "execute": "device_add",
3181# "arguments": { "driver": "e1000", "id": "net1",
3182# "bus": "pci.0",
3183# "mac": "52:54:00:12:34:56" } }
3184# <- { "return": {} }
3185#
e22da431 3186# TODO: This command effectively bypasses QAPI completely due to its
94cfd07f
MAL
3187# "additional arguments" business. It shouldn't have been added to
3188# the schema in this form. It should be qapified properly, or
3189# replaced by a properly qapified command.
3190#
3191# Since: 0.13
3192##
3193{ 'command': 'device_add',
b780e9c3 3194 'data': {'driver': 'str', '*bus': 'str', '*id': 'str'},
94cfd07f
MAL
3195 'gen': false } # so we can get the additional arguments
3196
a15fef21
LC
3197##
3198# @device_del:
3199#
3200# Remove a device from a guest
3201#
e389c004 3202# @id: the device's ID or QOM path
a15fef21
LC
3203#
3204# Returns: Nothing on success
3205# If @id is not a valid device, DeviceNotFound
a15fef21
LC
3206#
3207# Notes: When this command completes, the device may not be removed from the
3208# guest. Hot removal is an operation that requires guest cooperation.
3209# This command merely requests that the guest begin the hot removal
0402a5d6
MT
3210# process. Completion of the device removal process is signaled with a
3211# DEVICE_DELETED event. Guest reset will automatically complete removal
3212# for all devices.
a15fef21
LC
3213#
3214# Since: 0.14.0
e389c004
MAL
3215#
3216# Example:
3217#
3218# -> { "execute": "device_del",
3219# "arguments": { "id": "net1" } }
3220# <- { "return": {} }
3221#
3222# -> { "execute": "device_del",
3223# "arguments": { "id": "/machine/peripheral-anon/device[0]" } }
3224# <- { "return": {} }
3225#
a15fef21
LC
3226##
3227{ 'command': 'device_del', 'data': {'id': 'str'} }
783e9b48 3228
b53ccc30
QN
3229##
3230# @DumpGuestMemoryFormat:
3231#
3232# An enumeration of guest-memory-dump's format.
3233#
3234# @elf: elf format
3235#
3236# @kdump-zlib: kdump-compressed format with zlib-compressed
3237#
3238# @kdump-lzo: kdump-compressed format with lzo-compressed
3239#
3240# @kdump-snappy: kdump-compressed format with snappy-compressed
3241#
3242# Since: 2.0
3243##
3244{ 'enum': 'DumpGuestMemoryFormat',
3245 'data': [ 'elf', 'kdump-zlib', 'kdump-lzo', 'kdump-snappy' ] }
3246
783e9b48 3247##
5072f7b3 3248# @dump-guest-memory:
783e9b48
WC
3249#
3250# Dump guest's memory to vmcore. It is a synchronous operation that can take
f1cd4830 3251# very long depending on the amount of guest memory.
f5b0d93b
LC
3252#
3253# @paging: if true, do paging to get guest's memory mapping. This allows
d691180e 3254# using gdb to process the core file.
f5b0d93b 3255#
d691180e
LC
3256# IMPORTANT: this option can make QEMU allocate several gigabytes
3257# of RAM. This can happen for a large guest, or a
3258# malicious guest pretending to be large.
3259#
3260# Also, paging=true has the following limitations:
3261#
3262# 1. The guest may be in a catastrophic state or can have corrupted
3263# memory, which cannot be trusted
3264# 2. The guest can be in real-mode even if paging is enabled. For
3265# example, the guest uses ACPI to sleep, and ACPI sleep state
3266# goes in real-mode
f1cd4830 3267# 3. Currently only supported on i386 and x86_64.
f5b0d93b 3268#
783e9b48 3269# @protocol: the filename or file descriptor of the vmcore. The supported
d691180e 3270# protocols are:
f5b0d93b 3271#
d691180e
LC
3272# 1. file: the protocol starts with "file:", and the following
3273# string is the file's path.
3274# 2. fd: the protocol starts with "fd:", and the following string
3275# is the fd's name.
f5b0d93b 3276#
228de9cf 3277# @detach: #optional if true, QMP will return immediately rather than
39ba2ea6
PX
3278# waiting for the dump to finish. The user can track progress
3279# using "query-dump". (since 2.6).
228de9cf 3280#
783e9b48 3281# @begin: #optional if specified, the starting physical address.
f5b0d93b 3282#
783e9b48 3283# @length: #optional if specified, the memory size, in bytes. If you don't
d691180e
LC
3284# want to dump all guest's memory, please specify the start @begin
3285# and @length
783e9b48 3286#
b53ccc30
QN
3287# @format: #optional if specified, the format of guest memory dump. But non-elf
3288# format is conflict with paging and filter, ie. @paging, @begin and
3289# @length is not allowed to be specified with non-elf @format at the
3290# same time (since 2.0)
3291#
58e4300a
MAL
3292# Note: All boolean arguments default to false
3293#
783e9b48 3294# Returns: nothing on success
783e9b48
WC
3295#
3296# Since: 1.2
58e4300a
MAL
3297#
3298# Example:
3299#
3300# -> { "execute": "dump-guest-memory",
3301# "arguments": { "protocol": "fd:dump" } }
3302# <- { "return": {} }
3303#
783e9b48
WC
3304##
3305{ 'command': 'dump-guest-memory',
228de9cf
PX
3306 'data': { 'paging': 'bool', 'protocol': 'str', '*detach': 'bool',
3307 '*begin': 'int', '*length': 'int',
3308 '*format': 'DumpGuestMemoryFormat'} }
d691180e 3309
baf28f57 3310##
5072f7b3 3311# @DumpStatus:
baf28f57
PX
3312#
3313# Describe the status of a long-running background guest memory dump.
3314#
3315# @none: no dump-guest-memory has started yet.
3316#
3317# @active: there is one dump running in background.
3318#
3319# @completed: the last dump has finished successfully.
3320#
3321# @failed: the last dump has failed.
3322#
5072f7b3 3323# Since: 2.6
baf28f57
PX
3324##
3325{ 'enum': 'DumpStatus',
3326 'data': [ 'none', 'active', 'completed', 'failed' ] }
3327
39ba2ea6 3328##
5072f7b3 3329# @DumpQueryResult:
39ba2ea6
PX
3330#
3331# The result format for 'query-dump'.
3332#
3333# @status: enum of @DumpStatus, which shows current dump status
3334#
3335# @completed: bytes written in latest dump (uncompressed)
3336#
3337# @total: total bytes to be written in latest dump (uncompressed)
3338#
5072f7b3 3339# Since: 2.6
39ba2ea6
PX
3340##
3341{ 'struct': 'DumpQueryResult',
3342 'data': { 'status': 'DumpStatus',
3343 'completed': 'int',
3344 'total': 'int' } }
3345
3346##
5072f7b3 3347# @query-dump:
39ba2ea6
PX
3348#
3349# Query latest dump status.
3350#
3351# Returns: A @DumpStatus object showing the dump status.
3352#
3353# Since: 2.6
926dce5c
MAL
3354#
3355# Example:
3356#
3357# -> { "execute": "query-dump" }
3358# <- { "return": { "status": "active", "completed": 1024000,
3359# "total": 2048000 } }
3360#
39ba2ea6
PX
3361##
3362{ 'command': 'query-dump', 'returns': 'DumpQueryResult' }
3363
7d6dc7f3
QN
3364##
3365# @DumpGuestMemoryCapability:
3366#
3367# A list of the available formats for dump-guest-memory
3368#
3369# Since: 2.0
3370##
895a2a80 3371{ 'struct': 'DumpGuestMemoryCapability',
7d6dc7f3
QN
3372 'data': {
3373 'formats': ['DumpGuestMemoryFormat'] } }
3374
3375##
3376# @query-dump-guest-memory-capability:
3377#
3378# Returns the available formats for dump-guest-memory
3379#
3380# Returns: A @DumpGuestMemoryCapability object listing available formats for
3381# dump-guest-memory
3382#
3383# Since: 2.0
2ccb9803
MAL
3384#
3385# Example:
3386#
3387# -> { "execute": "query-dump-guest-memory-capability" }
3388# <- { "return": { "formats":
3389# ["elf", "kdump-zlib", "kdump-lzo", "kdump-snappy"] }
3390#
7d6dc7f3
QN
3391##
3392{ 'command': 'query-dump-guest-memory-capability',
3393 'returns': 'DumpGuestMemoryCapability' }
d691180e 3394
7ee0c3e3 3395##
5072f7b3 3396# @dump-skeys:
7ee0c3e3
JH
3397#
3398# Dump guest's storage keys
3399#
3400# @filename: the path to the file to dump to
3401#
3402# This command is only supported on s390 architecture.
3403#
3404# Since: 2.5
ee332b51
MAL
3405#
3406# Example:
3407#
3408# -> { "execute": "dump-skeys",
3409# "arguments": { "filename": "/tmp/skeys" } }
3410# <- { "return": {} }
3411#
7ee0c3e3
JH
3412##
3413{ 'command': 'dump-skeys',
3414 'data': { 'filename': 'str' } }
3415
928059a3
LC
3416##
3417# @netdev_add:
3418#
3419# Add a network backend.
3420#
3421# @type: the type of network backend. Current valid values are 'user', 'tap',
3422# 'vde', 'socket', 'dump' and 'bridge'
3423#
3424# @id: the name of the new network backend
3425#
b8a98326 3426# Additional arguments depend on the type.
928059a3 3427#
e22da431 3428# TODO: This command effectively bypasses QAPI completely due to its
b8a98326
MA
3429# "additional arguments" business. It shouldn't have been added to
3430# the schema in this form. It should be qapified properly, or
3431# replaced by a properly qapified command.
928059a3
LC
3432#
3433# Since: 0.14.0
3434#
3435# Returns: Nothing on success
3436# If @type is not a valid network backend, DeviceNotFound
aa72941b
MAL
3437#
3438# Example:
3439#
3440# -> { "execute": "netdev_add",
3441# "arguments": { "type": "user", "id": "netdev1",
3442# "dnssearch": "example.org" } }
3443# <- { "return": {} }
3444#
928059a3
LC
3445##
3446{ 'command': 'netdev_add',
b8a98326
MA
3447 'data': {'type': 'str', 'id': 'str'},
3448 'gen': false } # so we can get the additional arguments
5f964155
LC
3449
3450##
3451# @netdev_del:
3452#
3453# Remove a network backend.
3454#
3455# @id: the name of the network backend to remove
3456#
3457# Returns: Nothing on success
3458# If @id is not a valid network backend, DeviceNotFound
3459#
3460# Since: 0.14.0
d071f6be
MAL
3461#
3462# Example:
3463#
3464# -> { "execute": "netdev_del", "arguments": { "id": "netdev1" } }
3465# <- { "return": {} }
3466#
5f964155
LC
3467##
3468{ 'command': 'netdev_del', 'data': {'id': 'str'} }
208c9d1b 3469
cff8b2c6
PB
3470##
3471# @object-add:
3472#
3473# Create a QOM object.
3474#
3475# @qom-type: the class name for the object to be created
3476#
3477# @id: the name of the new object
3478#
3479# @props: #optional a dictionary of properties to be passed to the backend
3480#
3481# Returns: Nothing on success
3482# Error if @qom-type is not a valid class name
3483#
3484# Since: 2.0
6517192b
MAL
3485#
3486# Example:
3487#
3488# -> { "execute": "object-add",
3489# "arguments": { "qom-type": "rng-random", "id": "rng1",
3490# "props": { "filename": "/dev/hwrng" } } }
3491# <- { "return": {} }
3492#
cff8b2c6
PB
3493##
3494{ 'command': 'object-add',
6eb3937e 3495 'data': {'qom-type': 'str', 'id': 'str', '*props': 'any'} }
cff8b2c6 3496
ab2d0531
PB
3497##
3498# @object-del:
3499#
3500# Remove a QOM object.
3501#
3502# @id: the name of the QOM object to remove
3503#
3504# Returns: Nothing on success
3505# Error if @id is not a valid id for a QOM object
3506#
3507# Since: 2.0
de0ba662
MAL
3508#
3509# Example:
3510#
3511# -> { "execute": "object-del", "arguments": { "id": "rng1" } }
3512# <- { "return": {} }
3513#
ab2d0531
PB
3514##
3515{ 'command': 'object-del', 'data': {'id': 'str'} }
3516
14aa0c2d 3517##
5072f7b3 3518# @NetdevNoneOptions:
14aa0c2d
LE
3519#
3520# Use it alone to have zero network devices.
3521#
5072f7b3 3522# Since: 1.2
14aa0c2d 3523##
895a2a80 3524{ 'struct': 'NetdevNoneOptions',
14aa0c2d
LE
3525 'data': { } }
3526
3527##
5072f7b3 3528# @NetLegacyNicOptions:
14aa0c2d
LE
3529#
3530# Create a new Network Interface Card.
3531#
3532# @netdev: #optional id of -netdev to connect to
3533#
3534# @macaddr: #optional MAC address
3535#
3536# @model: #optional device model (e1000, rtl8139, virtio etc.)
3537#
3538# @addr: #optional PCI device address
3539#
3540# @vectors: #optional number of MSI-x vectors, 0 to disable MSI-X
3541#
5072f7b3 3542# Since: 1.2
14aa0c2d 3543##
895a2a80 3544{ 'struct': 'NetLegacyNicOptions',
14aa0c2d
LE
3545 'data': {
3546 '*netdev': 'str',
3547 '*macaddr': 'str',
3548 '*model': 'str',
3549 '*addr': 'str',
3550 '*vectors': 'uint32' } }
3551
3552##
5072f7b3 3553# @String:
14aa0c2d
LE
3554#
3555# A fat type wrapping 'str', to be embedded in lists.
3556#
5072f7b3 3557# Since: 1.2
14aa0c2d 3558##
895a2a80 3559{ 'struct': 'String',
14aa0c2d
LE
3560 'data': {
3561 'str': 'str' } }
3562
3563##
5072f7b3 3564# @NetdevUserOptions:
14aa0c2d
LE
3565#
3566# Use the user mode network stack which requires no administrator privilege to
3567# run.
3568#
3569# @hostname: #optional client hostname reported by the builtin DHCP server
3570#
3571# @restrict: #optional isolate the guest from the host
3572#
0b11c036
ST
3573# @ipv4: #optional whether to support IPv4, default true for enabled
3574# (since 2.6)
3575#
3576# @ipv6: #optional whether to support IPv6, default true for enabled
3577# (since 2.6)
3578#
14aa0c2d
LE
3579# @ip: #optional legacy parameter, use net= instead
3580#
d8eb3864
ST
3581# @net: #optional IP network address that the guest will see, in the
3582# form addr[/netmask] The netmask is optional, and can be
3583# either in the form a.b.c.d or as a number of valid top-most
3584# bits. Default is 10.0.2.0/24.
14aa0c2d
LE
3585#
3586# @host: #optional guest-visible address of the host
3587#
3588# @tftp: #optional root directory of the built-in TFTP server
3589#
3590# @bootfile: #optional BOOTP filename, for use with tftp=
3591#
3592# @dhcpstart: #optional the first of the 16 IPs the built-in DHCP server can
3593# assign
3594#
3595# @dns: #optional guest-visible address of the virtual nameserver
3596#
63d2960b
KS
3597# @dnssearch: #optional list of DNS suffixes to search, passed as DHCP option
3598# to the guest
3599#
d8eb3864
ST
3600# @ipv6-prefix: #optional IPv6 network prefix (default is fec0::) (since
3601# 2.6). The network prefix is given in the usual
3602# hexadecimal IPv6 address notation.
7aac531e 3603#
d8eb3864
ST
3604# @ipv6-prefixlen: #optional IPv6 network prefix length (default is 64)
3605# (since 2.6)
7aac531e 3606#
d8eb3864 3607# @ipv6-host: #optional guest-visible IPv6 address of the host (since 2.6)
7aac531e 3608#
d8eb3864
ST
3609# @ipv6-dns: #optional guest-visible IPv6 address of the virtual
3610# nameserver (since 2.6)
7aac531e 3611#
14aa0c2d
LE
3612# @smb: #optional root directory of the built-in SMB server
3613#
3614# @smbserver: #optional IP address of the built-in SMB server
3615#
3616# @hostfwd: #optional redirect incoming TCP or UDP host connections to guest
3617# endpoints
3618#
3619# @guestfwd: #optional forward guest TCP connections
3620#
5072f7b3 3621# Since: 1.2
14aa0c2d 3622##
895a2a80 3623{ 'struct': 'NetdevUserOptions',
14aa0c2d
LE
3624 'data': {
3625 '*hostname': 'str',
3626 '*restrict': 'bool',
0b11c036
ST
3627 '*ipv4': 'bool',
3628 '*ipv6': 'bool',
14aa0c2d
LE
3629 '*ip': 'str',
3630 '*net': 'str',
3631 '*host': 'str',
3632 '*tftp': 'str',
3633 '*bootfile': 'str',
3634 '*dhcpstart': 'str',
3635 '*dns': 'str',
63d2960b 3636 '*dnssearch': ['String'],
d8eb3864
ST
3637 '*ipv6-prefix': 'str',
3638 '*ipv6-prefixlen': 'int',
3639 '*ipv6-host': 'str',
3640 '*ipv6-dns': 'str',
14aa0c2d
LE
3641 '*smb': 'str',
3642 '*smbserver': 'str',
3643 '*hostfwd': ['String'],
3644 '*guestfwd': ['String'] } }
3645
3646##
5072f7b3 3647# @NetdevTapOptions:
14aa0c2d
LE
3648#
3649# Connect the host TAP network interface name to the VLAN.
3650#
3651# @ifname: #optional interface name
3652#
3653# @fd: #optional file descriptor of an already opened tap
3654#
2ca81baa
JW
3655# @fds: #optional multiple file descriptors of already opened multiqueue capable
3656# tap
3657#
14aa0c2d
LE
3658# @script: #optional script to initialize the interface
3659#
3660# @downscript: #optional script to shut down the interface
3661#
584613ea
AK
3662# @br: #optional bridge name (since 2.8)
3663#
14aa0c2d
LE
3664# @helper: #optional command to execute to configure bridge
3665#
3666# @sndbuf: #optional send buffer limit. Understands [TGMKkb] suffixes.
3667#
3668# @vnet_hdr: #optional enable the IFF_VNET_HDR flag on the tap interface
3669#
3670# @vhost: #optional enable vhost-net network accelerator
3671#
3672# @vhostfd: #optional file descriptor of an already opened vhost net device
3673#
2ca81baa
JW
3674# @vhostfds: #optional file descriptors of multiple already opened vhost net
3675# devices
3676#
14aa0c2d
LE
3677# @vhostforce: #optional vhost on for non-MSIX virtio guests
3678#
ec396014
JW
3679# @queues: #optional number of queues to be created for multiqueue capable tap
3680#
69e87b32
JW
3681# @poll-us: #optional maximum number of microseconds that could
3682# be spent on busy polling for tap (since 2.7)
3683#
5072f7b3 3684# Since: 1.2
14aa0c2d 3685##
895a2a80 3686{ 'struct': 'NetdevTapOptions',
14aa0c2d
LE
3687 'data': {
3688 '*ifname': 'str',
3689 '*fd': 'str',
264986e2 3690 '*fds': 'str',
14aa0c2d
LE
3691 '*script': 'str',
3692 '*downscript': 'str',
584613ea 3693 '*br': 'str',
14aa0c2d
LE
3694 '*helper': 'str',
3695 '*sndbuf': 'size',
3696 '*vnet_hdr': 'bool',
3697 '*vhost': 'bool',
3698 '*vhostfd': 'str',
264986e2
JW
3699 '*vhostfds': 'str',
3700 '*vhostforce': 'bool',
69e87b32
JW
3701 '*queues': 'uint32',
3702 '*poll-us': 'uint32'} }
14aa0c2d
LE
3703
3704##
5072f7b3 3705# @NetdevSocketOptions:
14aa0c2d
LE
3706#
3707# Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP
3708# socket connection.
3709#
3710# @fd: #optional file descriptor of an already opened socket
3711#
3712# @listen: #optional port number, and optional hostname, to listen on
3713#
3714# @connect: #optional port number, and optional hostname, to connect to
3715#
3716# @mcast: #optional UDP multicast address and port number
3717#
3718# @localaddr: #optional source address and port for multicast and udp packets
3719#
3720# @udp: #optional UDP unicast address and port number
3721#
5072f7b3 3722# Since: 1.2
14aa0c2d 3723##
895a2a80 3724{ 'struct': 'NetdevSocketOptions',
14aa0c2d
LE
3725 'data': {
3726 '*fd': 'str',
3727 '*listen': 'str',
3728 '*connect': 'str',
3729 '*mcast': 'str',
3730 '*localaddr': 'str',
3731 '*udp': 'str' } }
3732
3fb69aa1 3733##
5072f7b3 3734# @NetdevL2TPv3Options:
3fb69aa1
AI
3735#
3736# Connect the VLAN to Ethernet over L2TPv3 Static tunnel
3737#
3738# @src: source address
3739#
3740# @dst: destination address
3741#
3742# @srcport: #optional source port - mandatory for udp, optional for ip
3743#
3744# @dstport: #optional destination port - mandatory for udp, optional for ip
3745#
3746# @ipv6: #optional - force the use of ipv6
3747#
3748# @udp: #optional - use the udp version of l2tpv3 encapsulation
3749#
3750# @cookie64: #optional - use 64 bit coookies
3751#
3752# @counter: #optional have sequence counter
3753#
3754# @pincounter: #optional pin sequence counter to zero -
3755# workaround for buggy implementations or
3756# networks with packet reorder
3757#
3758# @txcookie: #optional 32 or 64 bit transmit cookie
3759#
3760# @rxcookie: #optional 32 or 64 bit receive cookie
3761#
3762# @txsession: 32 bit transmit session
3763#
3764# @rxsession: #optional 32 bit receive session - if not specified
3765# set to the same value as transmit
3766#
3767# @offset: #optional additional offset - allows the insertion of
3768# additional application-specific data before the packet payload
3769#
5072f7b3 3770# Since: 2.1
3fb69aa1 3771##
895a2a80 3772{ 'struct': 'NetdevL2TPv3Options',
3fb69aa1
AI
3773 'data': {
3774 'src': 'str',
3775 'dst': 'str',
3776 '*srcport': 'str',
3777 '*dstport': 'str',
3778 '*ipv6': 'bool',
3779 '*udp': 'bool',
3780 '*cookie64': 'bool',
3781 '*counter': 'bool',
3782 '*pincounter': 'bool',
3783 '*txcookie': 'uint64',
3784 '*rxcookie': 'uint64',
3785 'txsession': 'uint32',
3786 '*rxsession': 'uint32',
3787 '*offset': 'uint32' } }
3788
14aa0c2d 3789##
5072f7b3 3790# @NetdevVdeOptions:
14aa0c2d
LE
3791#
3792# Connect the VLAN to a vde switch running on the host.
3793#
3794# @sock: #optional socket path
3795#
3796# @port: #optional port number
3797#
3798# @group: #optional group owner of socket
3799#
3800# @mode: #optional permissions for socket
3801#
5072f7b3 3802# Since: 1.2
14aa0c2d 3803##
895a2a80 3804{ 'struct': 'NetdevVdeOptions',
14aa0c2d
LE
3805 'data': {
3806 '*sock': 'str',
3807 '*port': 'uint16',
3808 '*group': 'str',
3809 '*mode': 'uint16' } }
3810
3811##
5072f7b3 3812# @NetdevDumpOptions:
14aa0c2d
LE
3813#
3814# Dump VLAN network traffic to a file.
3815#
3816# @len: #optional per-packet size limit (64k default). Understands [TGMKkb]
3817# suffixes.
3818#
3819# @file: #optional dump file path (default is qemu-vlan0.pcap)
3820#
5072f7b3 3821# Since: 1.2
14aa0c2d 3822##
895a2a80 3823{ 'struct': 'NetdevDumpOptions',
14aa0c2d
LE
3824 'data': {
3825 '*len': 'size',
3826 '*file': 'str' } }
3827
3828##
5072f7b3 3829# @NetdevBridgeOptions:
14aa0c2d
LE
3830#
3831# Connect a host TAP network interface to a host bridge device.
3832#
3833# @br: #optional bridge name
3834#
3835# @helper: #optional command to execute to configure bridge
3836#
5072f7b3 3837# Since: 1.2
14aa0c2d 3838##
895a2a80 3839{ 'struct': 'NetdevBridgeOptions',
14aa0c2d
LE
3840 'data': {
3841 '*br': 'str',
3842 '*helper': 'str' } }
3843
f6c874e3 3844##
5072f7b3 3845# @NetdevHubPortOptions:
f6c874e3
SH
3846#
3847# Connect two or more net clients through a software hub.
3848#
3849# @hubid: hub identifier number
3850#
5072f7b3 3851# Since: 1.2
f6c874e3 3852##
895a2a80 3853{ 'struct': 'NetdevHubPortOptions',
f6c874e3
SH
3854 'data': {
3855 'hubid': 'int32' } }
3856
58952137 3857##
5072f7b3 3858# @NetdevNetmapOptions:
58952137
VM
3859#
3860# Connect a client to a netmap-enabled NIC or to a VALE switch port
3861#
3862# @ifname: Either the name of an existing network interface supported by
3863# netmap, or the name of a VALE port (created on the fly).
3864# A VALE port name is in the form 'valeXXX:YYY', where XXX and
3865# YYY are non-negative integers. XXX identifies a switch and
3866# YYY identifies a port of the switch. VALE ports having the
3867# same XXX are therefore connected to the same switch.
3868#
3869# @devname: #optional path of the netmap device (default: '/dev/netmap').
3870#
5072f7b3 3871# Since: 2.0
58952137 3872##
895a2a80 3873{ 'struct': 'NetdevNetmapOptions',
58952137
VM
3874 'data': {
3875 'ifname': 'str',
3876 '*devname': 'str' } }
3877
03ce5744 3878##
5072f7b3 3879# @NetdevVhostUserOptions:
03ce5744
NN
3880#
3881# Vhost-user network backend
3882#
3883# @chardev: name of a unix socket chardev
3884#
3885# @vhostforce: #optional vhost on for non-MSIX virtio guests (default: false).
3886#
b931bfbf
CO
3887# @queues: #optional number of queues to be created for multiqueue vhost-user
3888# (default: 1) (Since 2.5)
3889#
5072f7b3 3890# Since: 2.1
03ce5744 3891##
895a2a80 3892{ 'struct': 'NetdevVhostUserOptions',
03ce5744
NN
3893 'data': {
3894 'chardev': 'str',
b931bfbf
CO
3895 '*vhostforce': 'bool',
3896 '*queues': 'int' } }
03ce5744 3897
14aa0c2d 3898##
5072f7b3 3899# @NetClientDriver:
14aa0c2d 3900#
f394b2e2
EB
3901# Available netdev drivers.
3902#
5072f7b3 3903# Since: 2.7
f394b2e2
EB
3904##
3905{ 'enum': 'NetClientDriver',
3906 'data': [ 'none', 'nic', 'user', 'tap', 'l2tpv3', 'socket', 'vde', 'dump',
3907 'bridge', 'hubport', 'netmap', 'vhost-user' ] }
3908
3909##
5072f7b3 3910# @Netdev:
f394b2e2
EB
3911#
3912# Captures the configuration of a network device.
3913#
3914# @id: identifier for monitor commands.
3915#
3916# @type: Specify the driver used for interpreting remaining arguments.
14aa0c2d 3917#
5072f7b3 3918# Since: 1.2
3fb69aa1
AI
3919#
3920# 'l2tpv3' - since 2.1
14aa0c2d 3921##
f394b2e2
EB
3922{ 'union': 'Netdev',
3923 'base': { 'id': 'str', 'type': 'NetClientDriver' },
3924 'discriminator': 'type',
14aa0c2d 3925 'data': {
f6c874e3
SH
3926 'none': 'NetdevNoneOptions',
3927 'nic': 'NetLegacyNicOptions',
3928 'user': 'NetdevUserOptions',
3929 'tap': 'NetdevTapOptions',
3fb69aa1 3930 'l2tpv3': 'NetdevL2TPv3Options',
f6c874e3
SH
3931 'socket': 'NetdevSocketOptions',
3932 'vde': 'NetdevVdeOptions',
3933 'dump': 'NetdevDumpOptions',
3934 'bridge': 'NetdevBridgeOptions',
58952137 3935 'hubport': 'NetdevHubPortOptions',
03ce5744
NN
3936 'netmap': 'NetdevNetmapOptions',
3937 'vhost-user': 'NetdevVhostUserOptions' } }
14aa0c2d
LE
3938
3939##
5072f7b3 3940# @NetLegacy:
14aa0c2d
LE
3941#
3942# Captures the configuration of a network device; legacy.
3943#
3944# @vlan: #optional vlan number
3945#
3946# @id: #optional identifier for monitor commands
3947#
3948# @name: #optional identifier for monitor commands, ignored if @id is present
3949#
3950# @opts: device type specific properties (legacy)
3951#
5072f7b3 3952# Since: 1.2
14aa0c2d 3953##
895a2a80 3954{ 'struct': 'NetLegacy',
14aa0c2d
LE
3955 'data': {
3956 '*vlan': 'int32',
3957 '*id': 'str',
3958 '*name': 'str',
f394b2e2 3959 'opts': 'NetLegacyOptions' } }
14aa0c2d
LE
3960
3961##
5072f7b3 3962# @NetLegacyOptions:
14aa0c2d 3963#
f394b2e2 3964# Like Netdev, but for use only by the legacy command line options
14aa0c2d 3965#
5072f7b3 3966# Since: 1.2
14aa0c2d 3967##
f394b2e2 3968{ 'union': 'NetLegacyOptions',
14aa0c2d 3969 'data': {
f394b2e2
EB
3970 'none': 'NetdevNoneOptions',
3971 'nic': 'NetLegacyNicOptions',
3972 'user': 'NetdevUserOptions',
3973 'tap': 'NetdevTapOptions',
3974 'l2tpv3': 'NetdevL2TPv3Options',
3975 'socket': 'NetdevSocketOptions',
3976 'vde': 'NetdevVdeOptions',
3977 'dump': 'NetdevDumpOptions',
3978 'bridge': 'NetdevBridgeOptions',
3979 'netmap': 'NetdevNetmapOptions',
3980 'vhost-user': 'NetdevVhostUserOptions' } }
14aa0c2d 3981
fdccce45 3982##
5072f7b3 3983# @NetFilterDirection:
fdccce45
YH
3984#
3985# Indicates whether a netfilter is attached to a netdev's transmit queue or
3986# receive queue or both.
3987#
3988# @all: the filter is attached both to the receive and the transmit
3989# queue of the netdev (default).
3990#
3991# @rx: the filter is attached to the receive queue of the netdev,
3992# where it will receive packets sent to the netdev.
3993#
3994# @tx: the filter is attached to the transmit queue of the netdev,
3995# where it will receive packets sent by the netdev.
3996#
5072f7b3 3997# Since: 2.5
fdccce45
YH
3998##
3999{ 'enum': 'NetFilterDirection',
4000 'data': [ 'all', 'rx', 'tx' ] }
4001
5be8c759 4002##
5072f7b3 4003# @InetSocketAddress:
5be8c759
PB
4004#
4005# Captures a socket address or address range in the Internet namespace.
4006#
4007# @host: host part of the address
4008#
2ea1793b 4009# @port: port part of the address, or lowest port if @to is present
5be8c759 4010#
6979a813
DB
4011# @numeric: #optional true if the host/port are guaranteed to be numeric,
4012# false if name resolution should be attempted. Defaults to false.
4013# (Since 2.9)
4014#
5be8c759
PB
4015# @to: highest port to try
4016#
4017# @ipv4: whether to accept IPv4 addresses, default try both IPv4 and IPv6
4018# #optional
4019#
4020# @ipv6: whether to accept IPv6 addresses, default try both IPv4 and IPv6
4021# #optional
4022#
5072f7b3 4023# Since: 1.3
5be8c759 4024##
895a2a80 4025{ 'struct': 'InetSocketAddress',
5be8c759
PB
4026 'data': {
4027 'host': 'str',
2ea1793b 4028 'port': 'str',
6979a813 4029 '*numeric': 'bool',
5be8c759
PB
4030 '*to': 'uint16',
4031 '*ipv4': 'bool',
4032 '*ipv6': 'bool' } }
4033
4034##
5072f7b3 4035# @UnixSocketAddress:
5be8c759
PB
4036#
4037# Captures a socket address in the local ("Unix socket") namespace.
4038#
4039# @path: filesystem path to use
4040#
5072f7b3 4041# Since: 1.3
5be8c759 4042##
895a2a80 4043{ 'struct': 'UnixSocketAddress',
5be8c759
PB
4044 'data': {
4045 'path': 'str' } }
4046
6a02c806 4047##
5072f7b3 4048# @VsockSocketAddress:
6a02c806
SH
4049#
4050# Captures a socket address in the vsock namespace.
4051#
4052# @cid: unique host identifier
4053# @port: port
4054#
5072f7b3 4055# Note: string types are used to allow for possible future hostname or
6a02c806
SH
4056# service resolution support.
4057#
5072f7b3 4058# Since: 2.8
6a02c806
SH
4059##
4060{ 'struct': 'VsockSocketAddress',
4061 'data': {
4062 'cid': 'str',
4063 'port': 'str' } }
4064
5be8c759 4065##
5072f7b3 4066# @SocketAddress:
5be8c759
PB
4067#
4068# Captures the address of a socket, which could also be a named file descriptor
4069#
5072f7b3 4070# Since: 1.3
5be8c759
PB
4071##
4072{ 'union': 'SocketAddress',
4073 'data': {
4074 'inet': 'InetSocketAddress',
4075 'unix': 'UnixSocketAddress',
6a02c806 4076 'vsock': 'VsockSocketAddress',
5be8c759
PB
4077 'fd': 'String' } }
4078
208c9d1b
CB
4079##
4080# @getfd:
4081#
4082# Receive a file descriptor via SCM rights and assign it a name
4083#
4084# @fdname: file descriptor name
4085#
4086# Returns: Nothing on success
208c9d1b
CB
4087#
4088# Since: 0.14.0
4089#
4090# Notes: If @fdname already exists, the file descriptor assigned to
4091# it will be closed and replaced by the received file
4092# descriptor.
179bf59a 4093#
208c9d1b
CB
4094# The 'closefd' command can be used to explicitly close the
4095# file descriptor when it is no longer needed.
179bf59a
MAL
4096#
4097# Example:
4098#
4099# -> { "execute": "getfd", "arguments": { "fdname": "fd1" } }
4100# <- { "return": {} }
4101#
208c9d1b
CB
4102##
4103{ 'command': 'getfd', 'data': {'fdname': 'str'} }
4104
4105##
4106# @closefd:
4107#
4108# Close a file descriptor previously passed via SCM rights
4109#
4110# @fdname: file descriptor name
4111#
4112# Returns: Nothing on success
208c9d1b
CB
4113#
4114# Since: 0.14.0
f5ad8e87
MAL
4115#
4116# Example:
4117#
4118# -> { "execute": "closefd", "arguments": { "fdname": "fd1" } }
4119# <- { "return": {} }
4120#
208c9d1b
CB
4121##
4122{ 'command': 'closefd', 'data': {'fdname': 'str'} }
01d3c80d
AL
4123
4124##
4125# @MachineInfo:
4126#
4127# Information describing a machine.
4128#
4129# @name: the name of the machine
4130#
4131# @alias: #optional an alias for the machine name
4132#
4d5c8bc4 4133# @is-default: #optional whether the machine is default
01d3c80d 4134#
c72e7688
MN
4135# @cpu-max: maximum number of CPUs supported by the machine type
4136# (since 1.5.0)
4137#
62c9467d
PK
4138# @hotpluggable-cpus: cpu hotplug via -device is supported (since 2.7.0)
4139#
01d3c80d
AL
4140# Since: 1.2.0
4141##
895a2a80 4142{ 'struct': 'MachineInfo',
01d3c80d 4143 'data': { 'name': 'str', '*alias': 'str',
62c9467d
PK
4144 '*is-default': 'bool', 'cpu-max': 'int',
4145 'hotpluggable-cpus': 'bool'} }
01d3c80d
AL
4146
4147##
4148# @query-machines:
4149#
4150# Return a list of supported machines
4151#
4152# Returns: a list of MachineInfo
4153#
4154# Since: 1.2.0
4155##
4156{ 'command': 'query-machines', 'returns': ['MachineInfo'] }
e4e31c63
AL
4157
4158##
4159# @CpuDefinitionInfo:
4160#
4161# Virtual CPU definition.
4162#
4163# @name: the name of the CPU definition
4164#
fc4b84b1
DH
4165# @migration-safe: #optional whether a CPU definition can be safely used for
4166# migration in combination with a QEMU compatibility machine
4167# when migrating between different QMU versions and between
4168# hosts with different sets of (hardware or software)
4169# capabilities. If not provided, information is not available
4170# and callers should not assume the CPU definition to be
4171# migration-safe. (since 2.8)
4172#
4173# @static: whether a CPU definition is static and will not change depending on
4174# QEMU version, machine type, machine options and accelerator options.
4175# A static model is always migration-safe. (since 2.8)
4176#
9504e710
EH
4177# @unavailable-features: #optional List of properties that prevent
4178# the CPU model from running in the current
4179# host. (since 2.8)
8ed877b7
EH
4180# @typename: Type name that can be used as argument to @device-list-properties,
4181# to introspect properties configurable using -cpu or -global.
4182# (since 2.9)
9504e710
EH
4183#
4184# @unavailable-features is a list of QOM property names that
4185# represent CPU model attributes that prevent the CPU from running.
4186# If the QOM property is read-only, that means there's no known
4187# way to make the CPU model run in the current host. Implementations
4188# that choose not to provide specific information return the
4189# property name "type".
4190# If the property is read-write, it means that it MAY be possible
4191# to run the CPU model in the current host if that property is
4192# changed. Management software can use it as hints to suggest or
4193# choose an alternative for the user, or just to generate meaningful
4194# error messages explaining why the CPU model can't be used.
4195# If @unavailable-features is an empty list, the CPU model is
4196# runnable using the current host and machine-type.
4197# If @unavailable-features is not present, runnability
4198# information for the CPU is not available.
4199#
e4e31c63
AL
4200# Since: 1.2.0
4201##
895a2a80 4202{ 'struct': 'CpuDefinitionInfo',
9504e710 4203 'data': { 'name': 'str', '*migration-safe': 'bool', 'static': 'bool',
8ed877b7 4204 '*unavailable-features': [ 'str' ], 'typename': 'str' } }
e4e31c63
AL
4205
4206##
4207# @query-cpu-definitions:
4208#
4209# Return a list of supported virtual CPU definitions
4210#
4211# Returns: a list of CpuDefInfo
4212#
4213# Since: 1.2.0
4214##
4215{ 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
ba1c048a 4216
e09484ef
DH
4217##
4218# @CpuModelInfo:
4219#
4220# Virtual CPU model.
4221#
4222# A CPU model consists of the name of a CPU definition, to which
4223# delta changes are applied (e.g. features added/removed). Most magic values
4224# that an architecture might require should be hidden behind the name.
4225# However, if required, architectures can expose relevant properties.
4226#
4227# @name: the name of the CPU definition the model is based on
4228# @props: #optional a dictionary of QOM properties to be applied
4229#
4230# Since: 2.8.0
4231##
4232{ 'struct': 'CpuModelInfo',
4233 'data': { 'name': 'str',
4234 '*props': 'any' } }
4235
4236##
5072f7b3 4237# @CpuModelExpansionType:
e09484ef
DH
4238#
4239# An enumeration of CPU model expansion types.
4240#
4241# @static: Expand to a static CPU model, a combination of a static base
4242# model name and property delta changes. As the static base model will
4243# never change, the expanded CPU model will be the same, independant of
4244# independent of QEMU version, machine type, machine options, and
4245# accelerator options. Therefore, the resulting model can be used by
4246# tooling without having to specify a compatibility machine - e.g. when
4247# displaying the "host" model. static CPU models are migration-safe.
4248#
4249# @full: Expand all properties. The produced model is not guaranteed to be
4250# migration-safe, but allows tooling to get an insight and work with
4251# model details.
4252#
4253# Since: 2.8.0
4254##
4255{ 'enum': 'CpuModelExpansionType',
4256 'data': [ 'static', 'full' ] }
4257
4258
4259##
5072f7b3 4260# @CpuModelExpansionInfo:
e09484ef
DH
4261#
4262# The result of a cpu model expansion.
4263#
4264# @model: the expanded CpuModelInfo.
4265#
4266# Since: 2.8.0
4267##
4268{ 'struct': 'CpuModelExpansionInfo',
4269 'data': { 'model': 'CpuModelInfo' } }
4270
4271
4272##
4273# @query-cpu-model-expansion:
4274#
4275# Expands a given CPU model (or a combination of CPU model + additional options)
4276# to different granularities, allowing tooling to get an understanding what a
4277# specific CPU model looks like in QEMU under a certain configuration.
4278#
4279# This interface can be used to query the "host" CPU model.
4280#
4281# The data returned by this command may be affected by:
4282#
4283# * QEMU version: CPU models may look different depending on the QEMU version.
4284# (Except for CPU models reported as "static" in query-cpu-definitions.)
4285# * machine-type: CPU model may look different depending on the machine-type.
4286# (Except for CPU models reported as "static" in query-cpu-definitions.)
4287# * machine options (including accelerator): in some architectures, CPU models
4288# may look different depending on machine and accelerator options. (Except for
4289# CPU models reported as "static" in query-cpu-definitions.)
4290# * "-cpu" arguments and global properties: arguments to the -cpu option and
4291# global properties may affect expansion of CPU models. Using
4292# query-cpu-model-expansion while using these is not advised.
4293#
137974ce
DH
4294# Some architectures may not support all expansion types. s390x supports
4295# "full" and "static".
e09484ef
DH
4296#
4297# Returns: a CpuModelExpansionInfo. Returns an error if expanding CPU models is
4298# not supported, if the model cannot be expanded, if the model contains
4299# an unknown CPU definition name, unknown properties or properties
4300# with a wrong type. Also returns an error if an expansion type is
4301# not supported.
4302#
4303# Since: 2.8.0
4304##
4305{ 'command': 'query-cpu-model-expansion',
4306 'data': { 'type': 'CpuModelExpansionType',
4307 'model': 'CpuModelInfo' },
4308 'returns': 'CpuModelExpansionInfo' }
4309
0031e0d6
DH
4310##
4311# @CpuModelCompareResult:
4312#
4313# An enumeration of CPU model comparation results. The result is usually
4d4ccabd 4314# calculated using e.g. CPU features or CPU generations.
0031e0d6
DH
4315#
4316# @incompatible: If model A is incompatible to model B, model A is not
4317# guaranteed to run where model B runs and the other way around.
4318#
4319# @identical: If model A is identical to model B, model A is guaranteed to run
4320# where model B runs and the other way around.
4321#
4322# @superset: If model A is a superset of model B, model B is guaranteed to run
4323# where model A runs. There are no guarantees about the other way.
4324#
4325# @subset: If model A is a subset of model B, model A is guaranteed to run
4326# where model B runs. There are no guarantees about the other way.
4327#
4328# Since: 2.8.0
4329##
4330{ 'enum': 'CpuModelCompareResult',
4331 'data': [ 'incompatible', 'identical', 'superset', 'subset' ] }
4332
4333##
5072f7b3 4334# @CpuModelCompareInfo:
0031e0d6
DH
4335#
4336# The result of a CPU model comparison.
4337#
4338# @result: The result of the compare operation.
4339# @responsible-properties: List of properties that led to the comparison result
4340# not being identical.
4341#
4342# @responsible-properties is a list of QOM property names that led to
4343# both CPUs not being detected as identical. For identical models, this
4344# list is empty.
4345# If a QOM property is read-only, that means there's no known way to make the
4346# CPU models identical. If the special property name "type" is included, the
4347# models are by definition not identical and cannot be made identical.
4348#
4349# Since: 2.8.0
4350##
4351{ 'struct': 'CpuModelCompareInfo',
4352 'data': {'result': 'CpuModelCompareResult',
4353 'responsible-properties': ['str']
4354 }
4355}
4356
4357##
4358# @query-cpu-model-comparison:
4359#
4360# Compares two CPU models, returning how they compare in a specific
4361# configuration. The results indicates how both models compare regarding
4362# runnability. This result can be used by tooling to make decisions if a
4363# certain CPU model will run in a certain configuration or if a compatible
4364# CPU model has to be created by baselining.
4365#
4366# Usually, a CPU model is compared against the maximum possible CPU model
4d4ccabd 4367# of a certain configuration (e.g. the "host" model for KVM). If that CPU
0031e0d6
DH
4368# model is identical or a subset, it will run in that configuration.
4369#
4370# The result returned by this command may be affected by:
4371#
4372# * QEMU version: CPU models may look different depending on the QEMU version.
4373# (Except for CPU models reported as "static" in query-cpu-definitions.)
4d4ccabd 4374# * machine-type: CPU model may look different depending on the machine-type.
0031e0d6
DH
4375# (Except for CPU models reported as "static" in query-cpu-definitions.)
4376# * machine options (including accelerator): in some architectures, CPU models
4377# may look different depending on machine and accelerator options. (Except for
4378# CPU models reported as "static" in query-cpu-definitions.)
4379# * "-cpu" arguments and global properties: arguments to the -cpu option and
4380# global properties may affect expansion of CPU models. Using
4381# query-cpu-model-expansion while using these is not advised.
4382#
4e82ef05
DH
4383# Some architectures may not support comparing CPU models. s390x supports
4384# comparing CPU models.
0031e0d6
DH
4385#
4386# Returns: a CpuModelBaselineInfo. Returns an error if comparing CPU models is
4387# not supported, if a model cannot be used, if a model contains
4388# an unknown cpu definition name, unknown properties or properties
4389# with wrong types.
4390#
4391# Since: 2.8.0
4392##
4393{ 'command': 'query-cpu-model-comparison',
4394 'data': { 'modela': 'CpuModelInfo', 'modelb': 'CpuModelInfo' },
4395 'returns': 'CpuModelCompareInfo' }
4396
b18b6043 4397##
5072f7b3 4398# @CpuModelBaselineInfo:
b18b6043
DH
4399#
4400# The result of a CPU model baseline.
4401#
4402# @model: the baselined CpuModelInfo.
4403#
4404# Since: 2.8.0
4405##
4406{ 'struct': 'CpuModelBaselineInfo',
4407 'data': { 'model': 'CpuModelInfo' } }
4408
4409##
4410# @query-cpu-model-baseline:
4411#
4412# Baseline two CPU models, creating a compatible third model. The created
4413# model will always be a static, migration-safe CPU model (see "static"
4414# CPU model expansion for details).
4415#
4416# This interface can be used by tooling to create a compatible CPU model out
4417# two CPU models. The created CPU model will be identical to or a subset of
4418# both CPU models when comparing them. Therefore, the created CPU model is
4419# guaranteed to run where the given CPU models run.
4420#
4421# The result returned by this command may be affected by:
4422#
4423# * QEMU version: CPU models may look different depending on the QEMU version.
4424# (Except for CPU models reported as "static" in query-cpu-definitions.)
4d4ccabd 4425# * machine-type: CPU model may look different depending on the machine-type.
b18b6043
DH
4426# (Except for CPU models reported as "static" in query-cpu-definitions.)
4427# * machine options (including accelerator): in some architectures, CPU models
4428# may look different depending on machine and accelerator options. (Except for
4429# CPU models reported as "static" in query-cpu-definitions.)
4430# * "-cpu" arguments and global properties: arguments to the -cpu option and
4431# global properties may affect expansion of CPU models. Using
4432# query-cpu-model-expansion while using these is not advised.
4433#
f1a47d08
DH
4434# Some architectures may not support baselining CPU models. s390x supports
4435# baselining CPU models.
b18b6043
DH
4436#
4437# Returns: a CpuModelBaselineInfo. Returns an error if baselining CPU models is
4438# not supported, if a model cannot be used, if a model contains
4439# an unknown cpu definition name, unknown properties or properties
4440# with wrong types.
4441#
4442# Since: 2.8.0
4443##
4444{ 'command': 'query-cpu-model-baseline',
4445 'data': { 'modela': 'CpuModelInfo',
4446 'modelb': 'CpuModelInfo' },
4447 'returns': 'CpuModelBaselineInfo' }
4448
49687ace 4449##
ba1c048a
CB
4450# @AddfdInfo:
4451#
4452# Information about a file descriptor that was added to an fd set.
4453#
4454# @fdset-id: The ID of the fd set that @fd was added to.
4455#
4456# @fd: The file descriptor that was received via SCM rights and
4457# added to the fd set.
4458#
4459# Since: 1.2.0
4460##
895a2a80 4461{ 'struct': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
ba1c048a
CB
4462
4463##
4464# @add-fd:
4465#
4466# Add a file descriptor, that was passed via SCM rights, to an fd set.
4467#
4468# @fdset-id: #optional The ID of the fd set to add the file descriptor to.
4469#
4470# @opaque: #optional A free-form string that can be used to describe the fd.
4471#
4472# Returns: @AddfdInfo on success
43fef34a 4473#
ba1c048a 4474# If file descriptor was not received, FdNotSupplied
43fef34a 4475#
9ac54af0 4476# If @fdset-id is a negative value, InvalidParameterValue
ba1c048a
CB
4477#
4478# Notes: The list of fd sets is shared by all monitor connections.
4479#
4480# If @fdset-id is not specified, a new fd set will be created.
4481#
4482# Since: 1.2.0
43fef34a
MAL
4483#
4484# Example:
4485#
4486# -> { "execute": "add-fd", "arguments": { "fdset-id": 1 } }
4487# <- { "return": { "fdset-id": 1, "fd": 3 } }
4488#
ba1c048a
CB
4489##
4490{ 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
4491 'returns': 'AddfdInfo' }
4492
4493##
4494# @remove-fd:
4495#
4496# Remove a file descriptor from an fd set.
4497#
4498# @fdset-id: The ID of the fd set that the file descriptor belongs to.
4499#
4500# @fd: #optional The file descriptor that is to be removed.
4501#
4502# Returns: Nothing on success
4503# If @fdset-id or @fd is not found, FdNotFound
4504#
4505# Since: 1.2.0
4506#
4507# Notes: The list of fd sets is shared by all monitor connections.
4508#
4509# If @fd is not specified, all file descriptors in @fdset-id
4510# will be removed.
4503e4b3
MAL
4511#
4512# Example:
4513#
4514# -> { "execute": "remove-fd", "arguments": { "fdset-id": 1, "fd": 3 } }
4515# <- { "return": {} }
4516#
ba1c048a
CB
4517##
4518{ 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
4519
4520##
4521# @FdsetFdInfo:
4522#
4523# Information about a file descriptor that belongs to an fd set.
4524#
4525# @fd: The file descriptor value.
4526#
4527# @opaque: #optional A free-form string that can be used to describe the fd.
4528#
4529# Since: 1.2.0
4530##
895a2a80 4531{ 'struct': 'FdsetFdInfo',
ba1c048a
CB
4532 'data': {'fd': 'int', '*opaque': 'str'} }
4533
4534##
4535# @FdsetInfo:
4536#
4537# Information about an fd set.
4538#
4539# @fdset-id: The ID of the fd set.
4540#
4541# @fds: A list of file descriptors that belong to this fd set.
4542#
4543# Since: 1.2.0
4544##
895a2a80 4545{ 'struct': 'FdsetInfo',
ba1c048a
CB
4546 'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
4547
4548##
4549# @query-fdsets:
4550#
4551# Return information describing all fd sets.
4552#
4553# Returns: A list of @FdsetInfo
4554#
4555# Since: 1.2.0
4556#
4557# Note: The list of fd sets is shared by all monitor connections.
4558#
d71ca35d
MAL
4559# Example:
4560#
4561# -> { "execute": "query-fdsets" }
4562# <- { "return": [
4563# {
4564# "fds": [
4565# {
4566# "fd": 30,
4567# "opaque": "rdonly:/path/to/file"
4568# },
4569# {
4570# "fd": 24,
4571# "opaque": "rdwr:/path/to/file"
4572# }
4573# ],
4574# "fdset-id": 1
4575# },
4576# {
4577# "fds": [
4578# {
4579# "fd": 28
4580# },
4581# {
4582# "fd": 29
4583# }
4584# ],
4585# "fdset-id": 0
4586# }
4587# ]
4588# }
4589#
ba1c048a
CB
4590##
4591{ 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
99afc91d 4592
99afc91d
DB
4593##
4594# @TargetInfo:
4595#
4596# Information describing the QEMU target.
4597#
4598# @arch: the target architecture (eg "x86_64", "i386", etc)
4599#
4600# Since: 1.2.0
4601##
895a2a80 4602{ 'struct': 'TargetInfo',
c02a9552 4603 'data': { 'arch': 'str' } }
99afc91d
DB
4604
4605##
4606# @query-target:
4607#
4608# Return information about the target for this QEMU
4609#
4610# Returns: TargetInfo
4611#
4612# Since: 1.2.0
4613##
4614{ 'command': 'query-target', 'returns': 'TargetInfo' }
411656f4
AK
4615
4616##
4617# @QKeyCode:
4618#
515b17c2
MAL
4619# An enumeration of key name.
4620#
4621# This is used by the @send-key command.
4622#
9f2a70e4
MAL
4623# @unmapped: since 2.0
4624# @pause: since 2.0
4625# @ro: since 2.4
4626# @kp_comma: since 2.4
4627# @kp_equals: since 2.6
4628# @power: since 2.6
e9346441
OH
4629# @hiragana: since 2.9
4630# @henkan: since 2.9
4631# @yen: since 2.9
9f2a70e4 4632#
411656f4 4633# Since: 1.3.0
bbd1b1cc 4634#
411656f4
AK
4635##
4636{ 'enum': 'QKeyCode',
bbd1b1cc
GH
4637 'data': [ 'unmapped',
4638 'shift', 'shift_r', 'alt', 'alt_r', 'altgr', 'altgr_r', 'ctrl',
411656f4
AK
4639 'ctrl_r', 'menu', 'esc', '1', '2', '3', '4', '5', '6', '7', '8',
4640 '9', '0', 'minus', 'equal', 'backspace', 'tab', 'q', 'w', 'e',
4641 'r', 't', 'y', 'u', 'i', 'o', 'p', 'bracket_left', 'bracket_right',
4642 'ret', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'semicolon',
4643 'apostrophe', 'grave_accent', 'backslash', 'z', 'x', 'c', 'v', 'b',
4644 'n', 'm', 'comma', 'dot', 'slash', 'asterisk', 'spc', 'caps_lock',
4645 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10',
4646 'num_lock', 'scroll_lock', 'kp_divide', 'kp_multiply',
4647 'kp_subtract', 'kp_add', 'kp_enter', 'kp_decimal', 'sysrq', 'kp_0',
4648 'kp_1', 'kp_2', 'kp_3', 'kp_4', 'kp_5', 'kp_6', 'kp_7', 'kp_8',
4649 'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
4650 'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
4651 'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
e9346441
OH
4652 'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause',
4653 'ro', 'hiragana', 'henkan', 'yen',
a3541278 4654 'kp_comma', 'kp_equals', 'power' ] }
e4c8f004 4655
9f328977 4656##
5072f7b3 4657# @KeyValue:
9f328977
LC
4658#
4659# Represents a keyboard key.
4660#
4661# Since: 1.3.0
4662##
4663{ 'union': 'KeyValue',
4664 'data': {
4665 'number': 'int',
4666 'qcode': 'QKeyCode' } }
4667
e4c8f004
AK
4668##
4669# @send-key:
4670#
4671# Send keys to guest.
4672#
9f328977
LC
4673# @keys: An array of @KeyValue elements. All @KeyValues in this array are
4674# simultaneously sent to the guest. A @KeyValue.number value is sent
4675# directly to the guest, while @KeyValue.qcode must be a valid
4676# @QKeyCode value
e4c8f004
AK
4677#
4678# @hold-time: #optional time to delay key up events, milliseconds. Defaults
4679# to 100
4680#
4681# Returns: Nothing on success
4682# If key is unknown or redundant, InvalidParameter
4683#
4684# Since: 1.3.0
4685#
f45fd52c
MAL
4686# Example:
4687#
4688# -> { "execute": "send-key",
4689# "arguments": { "keys": [ { "type": "qcode", "data": "ctrl" },
4690# { "type": "qcode", "data": "alt" },
4691# { "type": "qcode", "data": "delete" } ] } }
4692# <- { "return": {} }
4693#
e4c8f004
AK
4694##
4695{ 'command': 'send-key',
9f328977 4696 'data': { 'keys': ['KeyValue'], '*hold-time': 'int' } }
ad39cf6d
LC
4697
4698##
4699# @screendump:
4700#
4701# Write a PPM of the VGA screen to a file.
4702#
4703# @filename: the path of a new PPM file to store the image
4704#
4705# Returns: Nothing on success
4706#
4707# Since: 0.14.0
77b6681e
MAL
4708#
4709# Example:
4710#
4711# -> { "execute": "screendump",
4712# "arguments": { "filename": "/tmp/image" } }
4713# <- { "return": {} }
4714#
ad39cf6d
LC
4715##
4716{ 'command': 'screendump', 'data': {'filename': 'str'} }
6dd844db 4717
d0d7708b
DB
4718
4719##
4720# @ChardevCommon:
4721#
4722# Configuration shared across all chardev backends
4723#
4724# @logfile: #optional The name of a logfile to save output
4725# @logappend: #optional true to append instead of truncate
4726# (default to false to truncate)
4727#
4728# Since: 2.6
4729##
4730{ 'struct': 'ChardevCommon', 'data': { '*logfile': 'str',
4731 '*logappend': 'bool' } }
4732
ffbdbe59
GH
4733##
4734# @ChardevFile:
4735#
4736# Configuration info for file chardevs.
4737#
4738# @in: #optional The name of the input file
4739# @out: The name of the output file
31e38a22
OK
4740# @append: #optional Open the file in append mode (default false to
4741# truncate) (Since 2.6)
ffbdbe59
GH
4742#
4743# Since: 1.4
4744##
895a2a80 4745{ 'struct': 'ChardevFile', 'data': { '*in' : 'str',
31e38a22 4746 'out' : 'str',
d0d7708b
DB
4747 '*append': 'bool' },
4748 'base': 'ChardevCommon' }
ffbdbe59 4749
d59044ef 4750##
d36b2b90 4751# @ChardevHostdev:
d59044ef 4752#
548cbb36 4753# Configuration info for device and pipe chardevs.
d59044ef
GH
4754#
4755# @device: The name of the special file for the device,
4756# i.e. /dev/ttyS0 on Unix or COM1: on Windows
d59044ef
GH
4757#
4758# Since: 1.4
4759##
d0d7708b
DB
4760{ 'struct': 'ChardevHostdev', 'data': { 'device' : 'str' },
4761 'base': 'ChardevCommon' }
d59044ef 4762
f6bd5d6e
GH
4763##
4764# @ChardevSocket:
4765#
3ecc059d 4766# Configuration info for (stream) socket chardevs.
f6bd5d6e
GH
4767#
4768# @addr: socket address to listen on (server=true)
4769# or connect to (server=false)
a8fb5427 4770# @tls-creds: #optional the ID of the TLS credentials object (since 2.6)
f6bd5d6e 4771# @server: #optional create server socket (default: true)
ef993ba7
GH
4772# @wait: #optional wait for incoming connection on server
4773# sockets (default: false).
f6bd5d6e 4774# @nodelay: #optional set TCP_NODELAY socket option (default: false)
ef993ba7
GH
4775# @telnet: #optional enable telnet protocol on server
4776# sockets (default: false)
5dd1f02b
CM
4777# @reconnect: #optional For a client socket, if a socket is disconnected,
4778# then attempt a reconnect after the given number of seconds.
4779# Setting this to zero disables this function. (default: 0)
4780# (Since: 2.2)
f6bd5d6e
GH
4781#
4782# Since: 1.4
4783##
895a2a80 4784{ 'struct': 'ChardevSocket', 'data': { 'addr' : 'SocketAddress',
a8fb5427 4785 '*tls-creds' : 'str',
5dd1f02b
CM
4786 '*server' : 'bool',
4787 '*wait' : 'bool',
4788 '*nodelay' : 'bool',
4789 '*telnet' : 'bool',
d0d7708b
DB
4790 '*reconnect' : 'int' },
4791 'base': 'ChardevCommon' }
f6bd5d6e 4792
3ecc059d 4793##
08d0ab3f 4794# @ChardevUdp:
3ecc059d
GH
4795#
4796# Configuration info for datagram socket chardevs.
4797#
4798# @remote: remote address
4799# @local: #optional local address
4800#
4801# Since: 1.5
4802##
895a2a80 4803{ 'struct': 'ChardevUdp', 'data': { 'remote' : 'SocketAddress',
d0d7708b
DB
4804 '*local' : 'SocketAddress' },
4805 'base': 'ChardevCommon' }
3ecc059d 4806
edb2fb3c
GH
4807##
4808# @ChardevMux:
4809#
4810# Configuration info for mux chardevs.
4811#
4812# @chardev: name of the base chardev.
4813#
4814# Since: 1.5
4815##
d0d7708b
DB
4816{ 'struct': 'ChardevMux', 'data': { 'chardev' : 'str' },
4817 'base': 'ChardevCommon' }
edb2fb3c 4818
7c358031
GH
4819##
4820# @ChardevStdio:
4821#
4822# Configuration info for stdio chardevs.
4823#
4824# @signal: #optional Allow signals (such as SIGINT triggered by ^C)
4825# be delivered to qemu. Default: true in -nographic mode,
4826# false otherwise.
4827#
4828# Since: 1.5
4829##
d0d7708b
DB
4830{ 'struct': 'ChardevStdio', 'data': { '*signal' : 'bool' },
4831 'base': 'ChardevCommon' }
4832
7c358031 4833
cd153e2a
GH
4834##
4835# @ChardevSpiceChannel:
4836#
4837# Configuration info for spice vm channel chardevs.
4838#
4839# @type: kind of channel (for example vdagent).
4840#
4841# Since: 1.5
4842##
d0d7708b
DB
4843{ 'struct': 'ChardevSpiceChannel', 'data': { 'type' : 'str' },
4844 'base': 'ChardevCommon' }
cd153e2a
GH
4845
4846##
4847# @ChardevSpicePort:
4848#
4849# Configuration info for spice port chardevs.
4850#
4851# @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
4852#
4853# Since: 1.5
4854##
d0d7708b
DB
4855{ 'struct': 'ChardevSpicePort', 'data': { 'fqdn' : 'str' },
4856 'base': 'ChardevCommon' }
cd153e2a 4857
702ec69c
GH
4858##
4859# @ChardevVC:
4860#
4861# Configuration info for virtual console chardevs.
4862#
4863# @width: console width, in pixels
4864# @height: console height, in pixels
4865# @cols: console width, in chars
4866# @rows: console height, in chars
4867#
4868# Since: 1.5
4869##
895a2a80 4870{ 'struct': 'ChardevVC', 'data': { '*width' : 'int',
702ec69c
GH
4871 '*height' : 'int',
4872 '*cols' : 'int',
d0d7708b
DB
4873 '*rows' : 'int' },
4874 'base': 'ChardevCommon' }
702ec69c 4875
1da48c65 4876##
4f57378f 4877# @ChardevRingbuf:
1da48c65 4878#
3a1da42e 4879# Configuration info for ring buffer chardevs.
1da48c65 4880#
3a1da42e 4881# @size: #optional ring buffer size, must be power of two, default is 65536
1da48c65
GH
4882#
4883# Since: 1.5
4884##
d0d7708b
DB
4885{ 'struct': 'ChardevRingbuf', 'data': { '*size' : 'int' },
4886 'base': 'ChardevCommon' }
1da48c65 4887
f1a1a356
GH
4888##
4889# @ChardevBackend:
4890#
4891# Configuration info for the new chardev backend.
4892#
378af961 4893# Since: 1.4 (testdev since 2.2, wctablet since 2.9)
f1a1a356 4894##
f6bd5d6e 4895{ 'union': 'ChardevBackend', 'data': { 'file' : 'ChardevFile',
d36b2b90
MA
4896 'serial' : 'ChardevHostdev',
4897 'parallel': 'ChardevHostdev',
548cbb36 4898 'pipe' : 'ChardevHostdev',
f6bd5d6e 4899 'socket' : 'ChardevSocket',
08d0ab3f 4900 'udp' : 'ChardevUdp',
b1918fbb
EB
4901 'pty' : 'ChardevCommon',
4902 'null' : 'ChardevCommon',
f5a51cab 4903 'mux' : 'ChardevMux',
b1918fbb 4904 'msmouse': 'ChardevCommon',
378af961 4905 'wctablet' : 'ChardevCommon',
b1918fbb
EB
4906 'braille': 'ChardevCommon',
4907 'testdev': 'ChardevCommon',
d9ac374f 4908 'stdio' : 'ChardevStdio',
b1918fbb 4909 'console': 'ChardevCommon',
cd153e2a 4910 'spicevmc' : 'ChardevSpiceChannel',
702ec69c 4911 'spiceport' : 'ChardevSpicePort',
1da48c65 4912 'vc' : 'ChardevVC',
3a1da42e
MA
4913 'ringbuf': 'ChardevRingbuf',
4914 # next one is just for compatibility
4f57378f 4915 'memory' : 'ChardevRingbuf' } }
f1a1a356
GH
4916
4917##
4918# @ChardevReturn:
4919#
4920# Return info about the chardev backend just created.
4921#
58fa4325
MA
4922# @pty: #optional name of the slave pseudoterminal device, present if
4923# and only if a chardev of type 'pty' was created
4924#
f1a1a356
GH
4925# Since: 1.4
4926##
895a2a80 4927{ 'struct' : 'ChardevReturn', 'data': { '*pty' : 'str' } }
f1a1a356
GH
4928
4929##
4930# @chardev-add:
4931#
58fa4325 4932# Add a character device backend
f1a1a356
GH
4933#
4934# @id: the chardev's ID, must be unique
4935# @backend: backend type and parameters
4936#
58fa4325 4937# Returns: ChardevReturn.
f1a1a356
GH
4938#
4939# Since: 1.4
2212092e
MAL
4940#
4941# Example:
4942#
4943# -> { "execute" : "chardev-add",
4944# "arguments" : { "id" : "foo",
4945# "backend" : { "type" : "null", "data" : {} } } }
4946# <- { "return": {} }
4947#
4948# -> { "execute" : "chardev-add",
4949# "arguments" : { "id" : "bar",
4950# "backend" : { "type" : "file",
4951# "data" : { "out" : "/tmp/bar.log" } } } }
4952# <- { "return": {} }
4953#
4954# -> { "execute" : "chardev-add",
4955# "arguments" : { "id" : "baz",
4956# "backend" : { "type" : "pty", "data" : {} } } }
4957# <- { "return": { "pty" : "/dev/pty/42" } }
4958#
f1a1a356
GH
4959##
4960{ 'command': 'chardev-add', 'data': {'id' : 'str',
4961 'backend' : 'ChardevBackend' },
4962 'returns': 'ChardevReturn' }
4963
4964##
4965# @chardev-remove:
4966#
58fa4325 4967# Remove a character device backend
f1a1a356
GH
4968#
4969# @id: the chardev's ID, must exist and not be in use
4970#
4971# Returns: Nothing on success
4972#
4973# Since: 1.4
7cfee8d9
MAL
4974#
4975# Example:
4976#
4977# -> { "execute": "chardev-remove", "arguments": { "id" : "foo" } }
4978# <- { "return": {} }
4979#
f1a1a356
GH
4980##
4981{ 'command': 'chardev-remove', 'data': {'id': 'str'} }
d1a0cf73
SB
4982
4983##
4984# @TpmModel:
4985#
4986# An enumeration of TPM models
4987#
4988# @tpm-tis: TPM TIS model
4989#
4990# Since: 1.5
4991##
4992{ 'enum': 'TpmModel', 'data': [ 'tpm-tis' ] }
4993
4994##
4995# @query-tpm-models:
4996#
4997# Return a list of supported TPM models
4998#
4999# Returns: a list of TpmModel
5000#
5001# Since: 1.5
b7c7941b
MAL
5002#
5003# Example:
5004#
5005# -> { "execute": "query-tpm-models" }
5006# <- { "return": [ "tpm-tis" ] }
5007#
d1a0cf73
SB
5008##
5009{ 'command': 'query-tpm-models', 'returns': ['TpmModel'] }
5010
5011##
5012# @TpmType:
5013#
5014# An enumeration of TPM types
5015#
5016# @passthrough: TPM passthrough type
5017#
5018# Since: 1.5
5019##
5020{ 'enum': 'TpmType', 'data': [ 'passthrough' ] }
5021
5022##
5023# @query-tpm-types:
5024#
5025# Return a list of supported TPM types
5026#
5027# Returns: a list of TpmType
5028#
5029# Since: 1.5
5a4c0316
MAL
5030#
5031# Example:
5032#
5033# -> { "execute": "query-tpm-types" }
5034# <- { "return": [ "passthrough" ] }
5035#
d1a0cf73
SB
5036##
5037{ 'command': 'query-tpm-types', 'returns': ['TpmType'] }
5038
5039##
5040# @TPMPassthroughOptions:
5041#
5042# Information about the TPM passthrough type
5043#
5044# @path: #optional string describing the path used for accessing the TPM device
5045#
5046# @cancel-path: #optional string showing the TPM's sysfs cancel file
5047# for cancellation of TPM commands while they are executing
5048#
5049# Since: 1.5
5050##
895a2a80 5051{ 'struct': 'TPMPassthroughOptions', 'data': { '*path' : 'str',
d1a0cf73
SB
5052 '*cancel-path' : 'str'} }
5053
5054##
5055# @TpmTypeOptions:
5056#
5057# A union referencing different TPM backend types' configuration options
5058#
4d5c8bc4 5059# @type: 'passthrough' The configuration options for the TPM passthrough type
d1a0cf73
SB
5060#
5061# Since: 1.5
5062##
5063{ 'union': 'TpmTypeOptions',
88ca7bcf 5064 'data': { 'passthrough' : 'TPMPassthroughOptions' } }
d1a0cf73
SB
5065
5066##
4d5c8bc4 5067# @TPMInfo:
d1a0cf73
SB
5068#
5069# Information about the TPM
5070#
5071# @id: The Id of the TPM
5072#
5073# @model: The TPM frontend model
5074#
88ca7bcf 5075# @options: The TPM (backend) type configuration options
d1a0cf73
SB
5076#
5077# Since: 1.5
5078##
895a2a80 5079{ 'struct': 'TPMInfo',
d1a0cf73
SB
5080 'data': {'id': 'str',
5081 'model': 'TpmModel',
88ca7bcf 5082 'options': 'TpmTypeOptions' } }
d1a0cf73
SB
5083
5084##
5085# @query-tpm:
5086#
5087# Return information about the TPM device
5088#
5089# Returns: @TPMInfo on success
5090#
5091# Since: 1.5
4e022d01
MAL
5092#
5093# Example:
5094#
5095# -> { "execute": "query-tpm" }
5096# <- { "return":
5097# [
5098# { "model": "tpm-tis",
5099# "options":
5100# { "type": "passthrough",
5101# "data":
5102# { "cancel-path": "/sys/class/misc/tpm0/device/cancel",
5103# "path": "/dev/tpm0"
5104# }
5105# },
5106# "id": "tpm0"
5107# }
5108# ]
5109# }
5110#
d1a0cf73
SB
5111##
5112{ 'command': 'query-tpm', 'returns': ['TPMInfo'] }
8ccbad5c
LE
5113
5114##
5072f7b3 5115# @AcpiTableOptions:
8ccbad5c
LE
5116#
5117# Specify an ACPI table on the command line to load.
5118#
5119# At most one of @file and @data can be specified. The list of files specified
5120# by any one of them is loaded and concatenated in order. If both are omitted,
5121# @data is implied.
5122#
5123# Other fields / optargs can be used to override fields of the generic ACPI
5124# table header; refer to the ACPI specification 5.0, section 5.2.6 System
5125# Description Table Header. If a header field is not overridden, then the
5126# corresponding value from the concatenated blob is used (in case of @file), or
5127# it is filled in with a hard-coded value (in case of @data).
5128#
5129# String fields are copied into the matching ACPI member from lowest address
5130# upwards, and silently truncated / NUL-padded to length.
5131#
5132# @sig: #optional table signature / identifier (4 bytes)
5133#
5134# @rev: #optional table revision number (dependent on signature, 1 byte)
5135#
5136# @oem_id: #optional OEM identifier (6 bytes)
5137#
5138# @oem_table_id: #optional OEM table identifier (8 bytes)
5139#
5140# @oem_rev: #optional OEM-supplied revision number (4 bytes)
5141#
5142# @asl_compiler_id: #optional identifier of the utility that created the table
5143# (4 bytes)
5144#
5145# @asl_compiler_rev: #optional revision number of the utility that created the
5146# table (4 bytes)
5147#
5148# @file: #optional colon (:) separated list of pathnames to load and
5149# concatenate as table data. The resultant binary blob is expected to
5150# have an ACPI table header. At least one file is required. This field
5151# excludes @data.
5152#
5153# @data: #optional colon (:) separated list of pathnames to load and
5154# concatenate as table data. The resultant binary blob must not have an
5155# ACPI table header. At least one file is required. This field excludes
5156# @file.
5157#
5072f7b3 5158# Since: 1.5
8ccbad5c 5159##
895a2a80 5160{ 'struct': 'AcpiTableOptions',
8ccbad5c
LE
5161 'data': {
5162 '*sig': 'str',
5163 '*rev': 'uint8',
5164 '*oem_id': 'str',
5165 '*oem_table_id': 'str',
5166 '*oem_rev': 'uint32',
5167 '*asl_compiler_id': 'str',
5168 '*asl_compiler_rev': 'uint32',
5169 '*file': 'str',
5170 '*data': 'str' }}
1f8f987d
AK
5171
5172##
5173# @CommandLineParameterType:
5174#
5175# Possible types for an option parameter.
5176#
5177# @string: accepts a character string
5178#
5179# @boolean: accepts "on" or "off"
5180#
5181# @number: accepts a number
5182#
5183# @size: accepts a number followed by an optional suffix (K)ilo,
5184# (M)ega, (G)iga, (T)era
5185#
5072f7b3 5186# Since: 1.5
1f8f987d
AK
5187##
5188{ 'enum': 'CommandLineParameterType',
5189 'data': ['string', 'boolean', 'number', 'size'] }
5190
5191##
5192# @CommandLineParameterInfo:
5193#
5194# Details about a single parameter of a command line option.
5195#
5196# @name: parameter name
5197#
5198# @type: parameter @CommandLineParameterType
5199#
5200# @help: #optional human readable text string, not suitable for parsing.
5201#
e36af94f
CL
5202# @default: #optional default value string (since 2.1)
5203#
5072f7b3 5204# Since: 1.5
1f8f987d 5205##
895a2a80 5206{ 'struct': 'CommandLineParameterInfo',
1f8f987d
AK
5207 'data': { 'name': 'str',
5208 'type': 'CommandLineParameterType',
e36af94f
CL
5209 '*help': 'str',
5210 '*default': 'str' } }
1f8f987d
AK
5211
5212##
5213# @CommandLineOptionInfo:
5214#
5215# Details about a command line option, including its list of parameter details
5216#
5217# @option: option name
5218#
5219# @parameters: an array of @CommandLineParameterInfo
5220#
5072f7b3 5221# Since: 1.5
1f8f987d 5222##
895a2a80 5223{ 'struct': 'CommandLineOptionInfo',
1f8f987d
AK
5224 'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
5225
5226##
5227# @query-command-line-options:
5228#
5229# Query command line option schema.
5230#
5231# @option: #optional option name
5232#
5233# Returns: list of @CommandLineOptionInfo for all options (or for the given
5234# @option). Returns an error if the given @option doesn't exist.
5235#
5072f7b3 5236# Since: 1.5
e26a0d00
MAL
5237#
5238# Example:
5239#
5240# -> { "execute": "query-command-line-options",
5241# "arguments": { "option": "option-rom" } }
5242# <- { "return": [
5243# {
5244# "parameters": [
5245# {
5246# "name": "romfile",
5247# "type": "string"
5248# },
5249# {
5250# "name": "bootindex",
5251# "type": "number"
5252# }
5253# ],
5254# "option": "option-rom"
5255# }
5256# ]
5257# }
5258#
1f8f987d
AK
5259##
5260{'command': 'query-command-line-options', 'data': { '*option': 'str' },
5261 'returns': ['CommandLineOptionInfo'] }
8e8aba50
EH
5262
5263##
5072f7b3 5264# @X86CPURegister32:
8e8aba50
EH
5265#
5266# A X86 32-bit register
5267#
5268# Since: 1.5
5269##
5270{ 'enum': 'X86CPURegister32',
5271 'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
5272
5273##
5072f7b3 5274# @X86CPUFeatureWordInfo:
8e8aba50
EH
5275#
5276# Information about a X86 CPU feature word
5277#
5278# @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
5279#
5280# @cpuid-input-ecx: #optional Input ECX value for CPUID instruction for that
5281# feature word
5282#
5283# @cpuid-register: Output register containing the feature bits
5284#
5285# @features: value of output register, containing the feature bits
5286#
5287# Since: 1.5
5288##
895a2a80 5289{ 'struct': 'X86CPUFeatureWordInfo',
8e8aba50
EH
5290 'data': { 'cpuid-input-eax': 'int',
5291 '*cpuid-input-ecx': 'int',
5292 'cpuid-register': 'X86CPURegister32',
5293 'features': 'int' } }
b1be4280 5294
9f08c8ec 5295##
5072f7b3 5296# @DummyForceArrays:
9f08c8ec
EB
5297#
5298# Not used by QMP; hack to let us use X86CPUFeatureWordInfoList internally
5299#
5072f7b3 5300# Since: 2.5
9f08c8ec
EB
5301##
5302{ 'struct': 'DummyForceArrays',
5303 'data': { 'unused': ['X86CPUFeatureWordInfo'] } }
5304
5305
b1be4280
AK
5306##
5307# @RxState:
5308#
5309# Packets receiving state
5310#
5311# @normal: filter assigned packets according to the mac-table
5312#
5313# @none: don't receive any assigned packet
5314#
5315# @all: receive all assigned packets
5316#
5317# Since: 1.6
5318##
5319{ 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
5320
5321##
5322# @RxFilterInfo:
5323#
5324# Rx-filter information for a NIC.
5325#
5326# @name: net client name
5327#
5328# @promiscuous: whether promiscuous mode is enabled
5329#
5330# @multicast: multicast receive state
5331#
5332# @unicast: unicast receive state
5333#
f7bc8ef8
AK
5334# @vlan: vlan receive state (Since 2.0)
5335#
b1be4280
AK
5336# @broadcast-allowed: whether to receive broadcast
5337#
5338# @multicast-overflow: multicast table is overflowed or not
5339#
5340# @unicast-overflow: unicast table is overflowed or not
5341#
5342# @main-mac: the main macaddr string
5343#
5344# @vlan-table: a list of active vlan id
5345#
5346# @unicast-table: a list of unicast macaddr string
5347#
5348# @multicast-table: a list of multicast macaddr string
5349#
5072f7b3 5350# Since: 1.6
b1be4280 5351##
895a2a80 5352{ 'struct': 'RxFilterInfo',
b1be4280
AK
5353 'data': {
5354 'name': 'str',
5355 'promiscuous': 'bool',
5356 'multicast': 'RxState',
5357 'unicast': 'RxState',
f7bc8ef8 5358 'vlan': 'RxState',
b1be4280
AK
5359 'broadcast-allowed': 'bool',
5360 'multicast-overflow': 'bool',
5361 'unicast-overflow': 'bool',
5362 'main-mac': 'str',
5363 'vlan-table': ['int'],
5364 'unicast-table': ['str'],
5365 'multicast-table': ['str'] }}
5366
5367##
5368# @query-rx-filter:
5369#
5370# Return rx-filter information for all NICs (or for the given NIC).
5371#
5372# @name: #optional net client name
5373#
5374# Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
5375# Returns an error if the given @name doesn't exist, or given
5376# NIC doesn't support rx-filter querying, or given net client
5377# isn't a NIC.
5378#
5379# Since: 1.6
043ea312
MAL
5380#
5381# Example:
5382#
5383# -> { "execute": "query-rx-filter", "arguments": { "name": "vnet0" } }
5384# <- { "return": [
5385# {
5386# "promiscuous": true,
5387# "name": "vnet0",
5388# "main-mac": "52:54:00:12:34:56",
5389# "unicast": "normal",
5390# "vlan": "normal",
5391# "vlan-table": [
5392# 4,
5393# 0
5394# ],
5395# "unicast-table": [
5396# ],
5397# "multicast": "normal",
5398# "multicast-overflow": false,
5399# "unicast-overflow": false,
5400# "multicast-table": [
5401# "01:00:5e:00:00:01",
5402# "33:33:00:00:00:01",
5403# "33:33:ff:12:34:56"
5404# ],
5405# "broadcast-allowed": false
5406# }
5407# ]
5408# }
5409#
b1be4280
AK
5410##
5411{ 'command': 'query-rx-filter', 'data': { '*name': 'str' },
5412 'returns': ['RxFilterInfo'] }
d26c9a15 5413
031fa964 5414##
5072f7b3 5415# @InputButton:
031fa964
GH
5416#
5417# Button of a pointer input device (mouse, tablet).
5418#
0095cc62
FL
5419# @side: front side button of a 5-button mouse (since 2.9)
5420#
5421# @extra: rear side button of a 5-button mouse (since 2.9)
5422#
031fa964
GH
5423# Since: 2.0
5424##
5425{ 'enum' : 'InputButton',
0095cc62
FL
5426 'data' : [ 'left', 'middle', 'right', 'wheel-up', 'wheel-down', 'side',
5427 'extra' ] }
031fa964
GH
5428
5429##
5072f7b3 5430# @InputAxis:
031fa964
GH
5431#
5432# Position axis of a pointer input device (mouse, tablet).
5433#
5434# Since: 2.0
5435##
5436{ 'enum' : 'InputAxis',
01df5143 5437 'data' : [ 'x', 'y' ] }
031fa964
GH
5438
5439##
5072f7b3 5440# @InputKeyEvent:
031fa964
GH
5441#
5442# Keyboard input event.
5443#
5444# @key: Which key this event is for.
5445# @down: True for key-down and false for key-up events.
5446#
5447# Since: 2.0
5448##
895a2a80 5449{ 'struct' : 'InputKeyEvent',
031fa964
GH
5450 'data' : { 'key' : 'KeyValue',
5451 'down' : 'bool' } }
5452
5453##
5072f7b3 5454# @InputBtnEvent:
031fa964
GH
5455#
5456# Pointer button input event.
5457#
5458# @button: Which button this event is for.
5459# @down: True for key-down and false for key-up events.
5460#
5461# Since: 2.0
5462##
895a2a80 5463{ 'struct' : 'InputBtnEvent',
031fa964
GH
5464 'data' : { 'button' : 'InputButton',
5465 'down' : 'bool' } }
5466
5467##
5072f7b3 5468# @InputMoveEvent:
031fa964
GH
5469#
5470# Pointer motion input event.
5471#
5472# @axis: Which axis is referenced by @value.
5473# @value: Pointer position. For absolute coordinates the
5474# valid range is 0 -> 0x7ffff
5475#
5476# Since: 2.0
5477##
895a2a80 5478{ 'struct' : 'InputMoveEvent',
031fa964
GH
5479 'data' : { 'axis' : 'InputAxis',
5480 'value' : 'int' } }
5481
5482##
5072f7b3 5483# @InputEvent:
031fa964
GH
5484#
5485# Input event union.
5486#
4d5c8bc4
MAL
5487# @type: the input type, one of:
5488# - 'key': Input event of Keyboard
5489# - 'btn': Input event of pointer buttons
5490# - 'rel': Input event of relative pointer motion
5491# - 'abs': Input event of absolute pointer motion
935fb915 5492#
031fa964
GH
5493# Since: 2.0
5494##
5495{ 'union' : 'InputEvent',
5496 'data' : { 'key' : 'InputKeyEvent',
5497 'btn' : 'InputBtnEvent',
5498 'rel' : 'InputMoveEvent',
5499 'abs' : 'InputMoveEvent' } }
0042109a 5500
50c6617f 5501##
5072f7b3 5502# @input-send-event:
50c6617f
MT
5503#
5504# Send input event(s) to guest.
5505#
b98d26e3
GH
5506# @device: #optional display device to send event(s) to.
5507# @head: #optional head to send event(s) to, in case the
5508# display device supports multiple scanouts.
50c6617f
MT
5509# @events: List of InputEvent union.
5510#
5511# Returns: Nothing on success.
5512#
70d5b0c2
MAL
5513# The @device and @head parameters can be used to send the input event
5514# to specific input devices in case (a) multiple input devices of the
5515# same kind are added to the virtual machine and (b) you have
b98d26e3
GH
5516# configured input routing (see docs/multiseat.txt) for those input
5517# devices. The parameters work exactly like the device and head
5518# properties of input devices. If @device is missing, only devices
5519# that have no input routing config are admissible. If @device is
5520# specified, both input devices with and without input routing config
5521# are admissible, but devices with input routing config take
5522# precedence.
df5b2adb 5523#
6575ccdd 5524# Since: 2.6
70d5b0c2
MAL
5525#
5526# Note: The consoles are visible in the qom tree, under
5527# /backend/console[$index]. They have a device link and head property,
5528# so it is possible to map which console belongs to which device and
5529# display.
5530#
5531# Example:
5532#
5533# 1. Press left mouse button.
5534#
5535# -> { "execute": "input-send-event",
5536# "arguments": { "device": "video0",
5537# "events": [ { "type": "btn",
5538# "data" : { "down": true, "button": "left" } } ] } }
5539# <- { "return": {} }
5540#
5541# -> { "execute": "input-send-event",
5542# "arguments": { "device": "video0",
5543# "events": [ { "type": "btn",
5544# "data" : { "down": false, "button": "left" } } ] } }
5545# <- { "return": {} }
5546#
5547# 2. Press ctrl-alt-del.
5548#
5549# -> { "execute": "input-send-event",
5550# "arguments": { "events": [
5551# { "type": "key", "data" : { "down": true,
5552# "key": {"type": "qcode", "data": "ctrl" } } },
5553# { "type": "key", "data" : { "down": true,
5554# "key": {"type": "qcode", "data": "alt" } } },
5555# { "type": "key", "data" : { "down": true,
5556# "key": {"type": "qcode", "data": "delete" } } } ] } }
5557# <- { "return": {} }
5558#
5559# 3. Move mouse pointer to absolute coordinates (20000, 400).
5560#
5561# -> { "execute": "input-send-event" ,
5562# "arguments": { "events": [
5563# { "type": "abs", "data" : { "axis": "x", "value" : 20000 } },
5564# { "type": "abs", "data" : { "axis": "y", "value" : 400 } } ] } }
5565# <- { "return": {} }
5566#
50c6617f 5567##
6575ccdd 5568{ 'command': 'input-send-event',
b98d26e3
GH
5569 'data': { '*device': 'str',
5570 '*head' : 'int',
5571 'events' : [ 'InputEvent' ] } }
50c6617f 5572
0042109a 5573##
5072f7b3 5574# @NumaOptions:
0042109a
WG
5575#
5576# A discriminated record of NUMA options. (for OptsVisitor)
5577#
5072f7b3 5578# Since: 2.1
0042109a
WG
5579##
5580{ 'union': 'NumaOptions',
5581 'data': {
5582 'node': 'NumaNodeOptions' }}
5583
5584##
5072f7b3 5585# @NumaNodeOptions:
0042109a
WG
5586#
5587# Create a guest NUMA node. (for OptsVisitor)
5588#
5589# @nodeid: #optional NUMA node ID (increase by 1 from 0 if omitted)
5590#
5591# @cpus: #optional VCPUs belonging to this node (assign VCPUS round-robin
5592# if omitted)
5593#
7febe36f
PB
5594# @mem: #optional memory size of this node; mutually exclusive with @memdev.
5595# Equally divide total memory among nodes if both @mem and @memdev are
5596# omitted.
5597#
5598# @memdev: #optional memory backend object. If specified for one node,
5599# it must be specified for all nodes.
0042109a
WG
5600#
5601# Since: 2.1
5602##
895a2a80 5603{ 'struct': 'NumaNodeOptions',
0042109a
WG
5604 'data': {
5605 '*nodeid': 'uint16',
5606 '*cpus': ['uint16'],
7febe36f
PB
5607 '*mem': 'size',
5608 '*memdev': 'str' }}
4cf1b76b
HT
5609
5610##
5072f7b3 5611# @HostMemPolicy:
4cf1b76b
HT
5612#
5613# Host memory policy types
5614#
5615# @default: restore default policy, remove any nondefault policy
5616#
5617# @preferred: set the preferred host nodes for allocation
5618#
5619# @bind: a strict policy that restricts memory allocation to the
5620# host nodes specified
5621#
5622# @interleave: memory allocations are interleaved across the set
5623# of host nodes specified
5624#
5072f7b3 5625# Since: 2.1
4cf1b76b
HT
5626##
5627{ 'enum': 'HostMemPolicy',
5628 'data': [ 'default', 'preferred', 'bind', 'interleave' ] }
76b5d850
HT
5629
5630##
5631# @Memdev:
5632#
8f4e5ac3 5633# Information about memory backend
76b5d850 5634#
e1ff3c67
IM
5635# @id: #optional backend's ID if backend has 'id' property (since 2.9)
5636#
8f4e5ac3 5637# @size: memory backend size
76b5d850
HT
5638#
5639# @merge: enables or disables memory merge support
5640#
8f4e5ac3 5641# @dump: includes memory backend's memory in a core dump or not
76b5d850
HT
5642#
5643# @prealloc: enables or disables memory preallocation
5644#
5645# @host-nodes: host nodes for its memory policy
5646#
8f4e5ac3 5647# @policy: memory policy of memory backend
76b5d850
HT
5648#
5649# Since: 2.1
5650##
895a2a80 5651{ 'struct': 'Memdev',
76b5d850 5652 'data': {
e1ff3c67 5653 '*id': 'str',
76b5d850
HT
5654 'size': 'size',
5655 'merge': 'bool',
5656 'dump': 'bool',
5657 'prealloc': 'bool',
5658 'host-nodes': ['uint16'],
5659 'policy': 'HostMemPolicy' }}
5660
5661##
5662# @query-memdev:
5663#
8f4e5ac3 5664# Returns information for all memory backends.
76b5d850
HT
5665#
5666# Returns: a list of @Memdev.
5667#
5668# Since: 2.1
cfc84c8b
MAL
5669#
5670# Example:
5671#
5672# -> { "execute": "query-memdev" }
5673# <- { "return": [
5674# {
5675# "id": "mem1",
5676# "size": 536870912,
5677# "merge": false,
5678# "dump": true,
5679# "prealloc": false,
5680# "host-nodes": [0, 1],
5681# "policy": "bind"
5682# },
5683# {
5684# "size": 536870912,
5685# "merge": false,
5686# "dump": true,
5687# "prealloc": true,
5688# "host-nodes": [2, 3],
5689# "policy": "preferred"
5690# }
5691# ]
5692# }
5693#
76b5d850
HT
5694##
5695{ 'command': 'query-memdev', 'returns': ['Memdev'] }
8f4e5ac3
IM
5696
5697##
6f2e2730
IM
5698# @PCDIMMDeviceInfo:
5699#
5700# PCDIMMDevice state information
5701#
5702# @id: #optional device's ID
5703#
5704# @addr: physical address, where device is mapped
5705#
5706# @size: size of memory that the device provides
5707#
5708# @slot: slot number at which device is plugged in
5709#
5710# @node: NUMA node number where device is plugged in
5711#
5712# @memdev: memory backend linked with device
5713#
5714# @hotplugged: true if device was hotplugged
5715#
5716# @hotpluggable: true if device if could be added/removed while machine is running
5717#
5718# Since: 2.1
5719##
895a2a80 5720{ 'struct': 'PCDIMMDeviceInfo',
6f2e2730
IM
5721 'data': { '*id': 'str',
5722 'addr': 'int',
5723 'size': 'int',
5724 'slot': 'int',
5725 'node': 'int',
5726 'memdev': 'str',
5727 'hotplugged': 'bool',
5728 'hotpluggable': 'bool'
5729 }
5730}
5731
5732##
5733# @MemoryDeviceInfo:
5734#
5735# Union containing information about a memory device
5736#
5737# Since: 2.1
5738##
5739{ 'union': 'MemoryDeviceInfo', 'data': {'dimm': 'PCDIMMDeviceInfo'} }
5740
5741##
5072f7b3 5742# @query-memory-devices:
6f2e2730
IM
5743#
5744# Lists available memory devices and their state
5745#
5746# Since: 2.1
22f9a094
MAL
5747#
5748# Example:
5749#
5750# -> { "execute": "query-memory-devices" }
5751# <- { "return": [ { "data":
5752# { "addr": 5368709120,
5753# "hotpluggable": true,
5754# "hotplugged": true,
5755# "id": "d1",
5756# "memdev": "/objects/memX",
5757# "node": 0,
5758# "size": 1073741824,
5759# "slot": 0},
5760# "type": "dimm"
5761# } ] }
5762#
6f2e2730
IM
5763##
5764{ 'command': 'query-memory-devices', 'returns': ['MemoryDeviceInfo'] }
521b3673 5765
49687ace 5766##
5072f7b3 5767# @ACPISlotType:
521b3673
IM
5768#
5769# @DIMM: memory slot
76623d00 5770# @CPU: logical CPU slot (since 2.7)
49687ace 5771##
76623d00 5772{ 'enum': 'ACPISlotType', 'data': [ 'DIMM', 'CPU' ] }
521b3673 5773
49687ace 5774##
5072f7b3 5775# @ACPIOSTInfo:
521b3673
IM
5776#
5777# OSPM Status Indication for a device
5778# For description of possible values of @source and @status fields
5779# see "_OST (OSPM Status Indication)" chapter of ACPI5.0 spec.
5780#
5781# @device: #optional device ID associated with slot
5782#
5783# @slot: slot ID, unique per slot of a given @slot-type
5784#
5785# @slot-type: type of the slot
5786#
5787# @source: an integer containing the source event
5788#
5789# @status: an integer containing the status code
5790#
5791# Since: 2.1
5792##
895a2a80 5793{ 'struct': 'ACPIOSTInfo',
521b3673
IM
5794 'data' : { '*device': 'str',
5795 'slot': 'str',
5796 'slot-type': 'ACPISlotType',
5797 'source': 'int',
5798 'status': 'int' } }
02419bcb
IM
5799
5800##
5072f7b3 5801# @query-acpi-ospm-status:
02419bcb 5802#
18b43003
MAL
5803# Return a list of ACPIOSTInfo for devices that support status
5804# reporting via ACPI _OST method.
02419bcb
IM
5805#
5806# Since: 2.1
18b43003
MAL
5807#
5808# Example:
5809#
5810# -> { "execute": "query-acpi-ospm-status" }
5811# <- { "return": [ { "device": "d1", "slot": "0", "slot-type": "DIMM", "source": 1, "status": 0},
5812# { "slot": "1", "slot-type": "DIMM", "source": 0, "status": 0},
5813# { "slot": "2", "slot-type": "DIMM", "source": 0, "status": 0},
5814# { "slot": "3", "slot-type": "DIMM", "source": 0, "status": 0}
5815# ]}
5816#
02419bcb
IM
5817##
5818{ 'command': 'query-acpi-ospm-status', 'returns': ['ACPIOSTInfo'] }
f668470f 5819
99eaf09c 5820##
5072f7b3 5821# @WatchdogExpirationAction:
99eaf09c
WX
5822#
5823# An enumeration of the actions taken when the watchdog device's timer is
5824# expired
5825#
5826# @reset: system resets
5827#
5828# @shutdown: system shutdown, note that it is similar to @powerdown, which
5829# tries to set to system status and notify guest
5830#
5831# @poweroff: system poweroff, the emulator program exits
5832#
5833# @pause: system pauses, similar to @stop
5834#
5835# @debug: system enters debug state
5836#
5837# @none: nothing is done
5838#
795dc6e4
MCL
5839# @inject-nmi: a non-maskable interrupt is injected into the first VCPU (all
5840# VCPUS on x86) (since 2.4)
5841#
99eaf09c
WX
5842# Since: 2.1
5843##
5844{ 'enum': 'WatchdogExpirationAction',
795dc6e4
MCL
5845 'data': [ 'reset', 'shutdown', 'poweroff', 'pause', 'debug', 'none',
5846 'inject-nmi' ] }
99eaf09c 5847
5a2d2cbd 5848##
5072f7b3 5849# @IoOperationType:
5a2d2cbd
WX
5850#
5851# An enumeration of the I/O operation types
5852#
5853# @read: read operation
5854#
5855# @write: write operation
5856#
5857# Since: 2.1
5858##
5859{ 'enum': 'IoOperationType',
5860 'data': [ 'read', 'write' ] }
5861
3a449690 5862##
5072f7b3 5863# @GuestPanicAction:
3a449690
WX
5864#
5865# An enumeration of the actions taken when guest OS panic is detected
5866#
5867# @pause: system pauses
5868#
864111f4 5869# Since: 2.1 (poweroff since 2.8)
3a449690
WX
5870##
5871{ 'enum': 'GuestPanicAction',
864111f4 5872 'data': [ 'pause', 'poweroff' ] }
f2ae8abf 5873
d187e08d
AN
5874##
5875# @GuestPanicInformation:
5876#
5877# Information about a guest panic
5878#
5879# Since: 2.9
5880##
5881{'union': 'GuestPanicInformation',
5882 'data': { 'hyper-v': 'GuestPanicInformationHyperV' } }
5883
5884##
5885# @GuestPanicInformationHyperV:
5886#
5887# Hyper-V specific guest panic information (HV crash MSRs)
5888#
5889# Since: 2.9
5890##
5891{'struct': 'GuestPanicInformationHyperV',
5892 'data': { 'arg1': 'uint64',
5893 'arg2': 'uint64',
5894 'arg3': 'uint64',
5895 'arg4': 'uint64',
5896 'arg5': 'uint64' } }
5897
f2ae8abf 5898##
5072f7b3 5899# @rtc-reset-reinjection:
f2ae8abf
MT
5900#
5901# This command will reset the RTC interrupt reinjection backlog.
5902# Can be used if another mechanism to synchronize guest time
5903# is in effect, for example QEMU guest agent's guest-set-time
5904# command.
5905#
5906# Since: 2.1
5c32b4cc
MAL
5907#
5908# Example:
5909#
5910# -> { "execute": "rtc-reset-reinjection" }
5911# <- { "return": {} }
5912#
f2ae8abf
MT
5913##
5914{ 'command': 'rtc-reset-reinjection' }
fafa4d50
SF
5915
5916# Rocker ethernet network switch
5917{ 'include': 'qapi/rocker.json' }
d73abd6d
PD
5918
5919##
c5927e7a 5920# @ReplayMode:
d73abd6d
PD
5921#
5922# Mode of the replay subsystem.
5923#
5924# @none: normal execution mode. Replay or record are not enabled.
5925#
5926# @record: record mode. All non-deterministic data is written into the
5927# replay log.
5928#
5929# @play: replay mode. Non-deterministic data required for system execution
5930# is read from the log.
5931#
5932# Since: 2.5
5933##
5934{ 'enum': 'ReplayMode',
5935 'data': [ 'none', 'record', 'play' ] }
ae50a770 5936
88c16567
WC
5937##
5938# @xen-load-devices-state:
5939#
5940# Load the state of all devices from file. The RAM and the block devices
5941# of the VM are not loaded by this command.
5942#
5943# @filename: the file to load the state of the devices from as binary
5944# data. See xen-save-devices-state.txt for a description of the binary
5945# format.
5946#
5947# Since: 2.7
7d1182d9
MAL
5948#
5949# Example:
5950#
5951# -> { "execute": "xen-load-devices-state",
5952# "arguments": { "filename": "/tmp/resume" } }
5953# <- { "return": {} }
5954#
88c16567
WC
5955##
5956{ 'command': 'xen-load-devices-state', 'data': {'filename': 'str'} }
5957
ae50a770
PX
5958##
5959# @GICCapability:
5960#
5961# The struct describes capability for a specific GIC (Generic
5962# Interrupt Controller) version. These bits are not only decided by
5963# QEMU/KVM software version, but also decided by the hardware that
5964# the program is running upon.
5965#
5966# @version: version of GIC to be described. Currently, only 2 and 3
5967# are supported.
5968#
5969# @emulated: whether current QEMU/hardware supports emulated GIC
5970# device in user space.
5971#
5972# @kernel: whether current QEMU/hardware supports hardware
5973# accelerated GIC device in kernel.
5974#
5975# Since: 2.6
5976##
5977{ 'struct': 'GICCapability',
5978 'data': { 'version': 'int',
5979 'emulated': 'bool',
5980 'kernel': 'bool' } }
5981
5982##
5983# @query-gic-capabilities:
5984#
5985# This command is ARM-only. It will return a list of GICCapability
5986# objects that describe its capability bits.
5987#
5988# Returns: a list of GICCapability objects.
5989#
5990# Since: 2.6
1965e98d
MAL
5991#
5992# Example:
5993#
5994# -> { "execute": "query-gic-capabilities" }
5995# <- { "return": [{ "version": 2, "emulated": true, "kernel": false },
5996# { "version": 3, "emulated": false, "kernel": true } ] }
5997#
ae50a770
PX
5998##
5999{ 'command': 'query-gic-capabilities', 'returns': ['GICCapability'] }
d4633541
IM
6000
6001##
5072f7b3 6002# @CpuInstanceProperties:
d4633541
IM
6003#
6004# List of properties to be used for hotplugging a CPU instance,
6005# it should be passed by management with device_add command when
6006# a CPU is being hotplugged.
6007#
5807ff88
MAL
6008# @node-id: #optional NUMA node ID the CPU belongs to
6009# @socket-id: #optional socket number within node/board the CPU belongs to
6010# @core-id: #optional core number within socket the CPU belongs to
6011# @thread-id: #optional thread number within core the CPU belongs to
6012#
d4633541
IM
6013# Note: currently there are 4 properties that could be present
6014# but management should be prepared to pass through other
6015# properties with device_add command to allow for future
27393c33
PK
6016# interface extension. This also requires the filed names to be kept in
6017# sync with the properties passed to -device/device_add.
d4633541 6018#
d4633541
IM
6019# Since: 2.7
6020##
6021{ 'struct': 'CpuInstanceProperties',
27393c33
PK
6022 'data': { '*node-id': 'int',
6023 '*socket-id': 'int',
6024 '*core-id': 'int',
6025 '*thread-id': 'int'
d4633541
IM
6026 }
6027}
6028
6029##
5072f7b3 6030# @HotpluggableCPU:
d4633541
IM
6031#
6032# @type: CPU object type for usage with device_add command
6033# @props: list of properties to be used for hotplugging CPU
6034# @vcpus-count: number of logical VCPU threads @HotpluggableCPU provides
6035# @qom-path: #optional link to existing CPU object if CPU is present or
6036# omitted if CPU is not present.
6037#
6038# Since: 2.7
6039##
6040{ 'struct': 'HotpluggableCPU',
6041 'data': { 'type': 'str',
6042 'vcpus-count': 'int',
6043 'props': 'CpuInstanceProperties',
6044 '*qom-path': 'str'
6045 }
6046}
6047
6048##
5072f7b3 6049# @query-hotpluggable-cpus:
d4633541
IM
6050#
6051# Returns: a list of HotpluggableCPU objects.
6052#
6053# Since: 2.7
7e31d1ae
MAL
6054#
6055# Example:
6056#
6057# For pseries machine type started with -smp 2,cores=2,maxcpus=4 -cpu POWER8:
6058#
6059# -> { "execute": "query-hotpluggable-cpus" }
6060# <- {"return": [
6061# { "props": { "core": 8 }, "type": "POWER8-spapr-cpu-core",
6062# "vcpus-count": 1 },
6063# { "props": { "core": 0 }, "type": "POWER8-spapr-cpu-core",
6064# "vcpus-count": 1, "qom-path": "/machine/unattached/device[0]"}
6065# ]}'
6066#
6067# For pc machine type started with -smp 1,maxcpus=2:
6068#
6069# -> { "execute": "query-hotpluggable-cpus" }
6070# <- {"return": [
6071# {
6072# "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
6073# "props": {"core-id": 0, "socket-id": 1, "thread-id": 0}
6074# },
6075# {
6076# "qom-path": "/machine/unattached/device[0]",
6077# "type": "qemu64-x86_64-cpu", "vcpus-count": 1,
6078# "props": {"core-id": 0, "socket-id": 0, "thread-id": 0}
6079# }
6080# ]}
6081#
d4633541
IM
6082##
6083{ 'command': 'query-hotpluggable-cpus', 'returns': ['HotpluggableCPU'] }