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