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