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