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