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