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