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