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