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