]> git.proxmox.com Git - mirror_qemu.git/blame - qapi-schema.json
slirp/arp: do not special-case bogus IP addresses
[mirror_qemu.git] / qapi-schema.json
CommitLineData
e3193601
AL
1# -*- Mode: Python -*-
2#
3# QAPI Schema
48a32bed 4
dcafd323
LC
5##
6# @ErrorClass
7#
8# QEMU error classes
9#
10# @GenericError: this is used for errors that don't require a specific error
11# class. This should be the default case for most errors
12#
13# @CommandNotFound: the requested command has not been found
14#
15# @DeviceEncrypted: the requested operation can't be fulfilled because the
16# selected device is encrypted
17#
18# @DeviceNotActive: a device has failed to be become active
19#
20# @DeviceNotFound: the requested device has not been found
21#
22# @KVMMissingCap: the requested operation can't be fulfilled because a
23# required KVM capability is missing
24#
dcafd323
LC
25# Since: 1.2
26##
27{ 'enum': 'ErrorClass',
28 'data': [ 'GenericError', 'CommandNotFound', 'DeviceEncrypted',
1e998146 29 'DeviceNotActive', 'DeviceNotFound', 'KVMMissingCap' ] }
dcafd323 30
104059da
PB
31
32##
33# LostTickPolicy:
34#
35# Policy for handling lost ticks in timer devices.
36#
37# @discard: throw away the missed tick(s) and continue with future injection
38# normally. Guest time may be delayed, unless the OS has explicit
39# handling of lost ticks
40#
41# @delay: continue to deliver ticks at the normal rate. Guest time will be
42# delayed due to the late tick
43#
44# @merge: merge the missed tick(s) into one tick and inject. Guest time
45# may be delayed, depending on how the OS reacts to the merging
46# of ticks
47#
48# @slew: deliver ticks at a higher rate to catch up with the missed tick. The
49# guest time should not be delayed once catchup is complete.
50#
51# Since: 2.0
52##
53{ 'enum': 'LostTickPolicy',
54 'data': ['discard', 'delay', 'merge', 'slew' ] }
55
b224e5e2 56##
104059da
PB
57# BiosAtaTranslation:
58#
59# Policy that BIOS should use to interpret cylinder/head/sector
60# addresses. Note that Bochs BIOS and SeaBIOS will not actually
61# translate logical CHS to physical; instead, they will use logical
62# block addressing.
63#
64# @auto: If cylinder/heads/sizes are passed, choose between none and LBA
65# depending on the size of the disk. If they are not passed,
66# choose none if QEMU can guess that the disk had 16 or fewer
67# heads, large if QEMU can guess that the disk had 131072 or
68# fewer tracks across all heads (i.e. cylinders*heads<131072),
69# otherwise LBA.
70#
71# @none: The physical disk geometry is equal to the logical geometry.
72#
73# @lba: Assume 63 sectors per track and one of 16, 32, 64, 128 or 255
74# heads (if fewer than 255 are enough to cover the whole disk
75# with 1024 cylinders/head). The number of cylinders/head is
76# then computed based on the number of sectors and heads.
77#
78# @large: The number of cylinders per head is scaled down to 1024
79# by correspondingly scaling up the number of heads.
80#
81# @rechs: Same as @large, but first convert a 16-head geometry to
82# 15-head, by proportionally scaling up the number of
83# cylinders/head.
84#
85# Since: 2.0
86##
87{ 'enum': 'BiosAtaTranslation',
88 'data': ['auto', 'none', 'lba', 'large', 'rechs']}
89
b224e5e2
LC
90# @add_client
91#
92# Allow client connections for VNC, Spice and socket based
93# character devices to be passed in to QEMU via SCM_RIGHTS.
94#
95# @protocol: protocol name. Valid names are "vnc", "spice" or the
96# name of a character device (eg. from -chardev id=XXXX)
97#
98# @fdname: file descriptor name previously passed via 'getfd' command
99#
100# @skipauth: #optional whether to skip authentication. Only applies
101# to "vnc" and "spice" protocols
102#
103# @tls: #optional whether to perform TLS. Only applies to the "spice"
104# protocol
105#
106# Returns: nothing on success.
107#
108# Since: 0.14.0
109##
110{ 'command': 'add_client',
111 'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
112 '*tls': 'bool' } }
113
48a32bed
AL
114##
115# @NameInfo:
116#
117# Guest name information.
118#
119# @name: #optional The name of the guest
120#
121# Since 0.14.0
122##
123{ 'type': 'NameInfo', 'data': {'*name': 'str'} }
124
125##
126# @query-name:
127#
128# Return the name information of a guest.
129#
130# Returns: @NameInfo of the guest
131#
132# Since 0.14.0
133##
134{ 'command': 'query-name', 'returns': 'NameInfo' }
b9c15f16
LC
135
136##
137# @VersionInfo:
138#
139# A description of QEMU's version.
140#
141# @qemu.major: The major version of QEMU
142#
143# @qemu.minor: The minor version of QEMU
144#
145# @qemu.micro: The micro version of QEMU. By current convention, a micro
146# version of 50 signifies a development branch. A micro version
147# greater than or equal to 90 signifies a release candidate for
148# the next minor version. A micro version of less than 50
149# signifies a stable release.
150#
151# @package: QEMU will always set this field to an empty string. Downstream
152# versions of QEMU should set this to a non-empty string. The
153# exact format depends on the downstream however it highly
154# recommended that a unique name is used.
155#
156# Since: 0.14.0
157##
158{ 'type': 'VersionInfo',
159 'data': {'qemu': {'major': 'int', 'minor': 'int', 'micro': 'int'},
160 'package': 'str'} }
161
162##
163# @query-version:
164#
165# Returns the current version of QEMU.
166#
167# Returns: A @VersionInfo object describing the current version of QEMU.
168#
169# Since: 0.14.0
170##
171{ 'command': 'query-version', 'returns': 'VersionInfo' }
292a2602
LC
172
173##
174# @KvmInfo:
175#
176# Information about support for KVM acceleration
177#
178# @enabled: true if KVM acceleration is active
179#
180# @present: true if KVM acceleration is built into this executable
181#
182# Since: 0.14.0
183##
184{ 'type': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
185
186##
187# @query-kvm:
188#
189# Returns information about KVM acceleration
190#
191# Returns: @KvmInfo
192#
193# Since: 0.14.0
194##
195{ 'command': 'query-kvm', 'returns': 'KvmInfo' }
196
1fa9a5e4
LC
197##
198# @RunState
199#
6932a69b 200# An enumeration of VM run states.
1fa9a5e4
LC
201#
202# @debug: QEMU is running on a debugger
203#
0a24c7b1
LC
204# @finish-migrate: guest is paused to finish the migration process
205#
1e998146
PB
206# @inmigrate: guest is paused waiting for an incoming migration. Note
207# that this state does not tell whether the machine will start at the
208# end of the migration. This depends on the command-line -S option and
209# any invocation of 'stop' or 'cont' that has happened since QEMU was
210# started.
1fa9a5e4
LC
211#
212# @internal-error: An internal error that prevents further guest execution
213# has occurred
214#
215# @io-error: the last IOP has failed and the device is configured to pause
216# on I/O errors
217#
218# @paused: guest has been paused via the 'stop' command
219#
220# @postmigrate: guest is paused following a successful 'migrate'
221#
222# @prelaunch: QEMU was started with -S and guest has not started
223#
1fa9a5e4
LC
224# @restore-vm: guest is paused to restore VM state
225#
226# @running: guest is actively running
227#
228# @save-vm: guest is paused to save the VM state
229#
230# @shutdown: guest is shut down (and -no-shutdown is in use)
231#
ad02b96a
LC
232# @suspended: guest is suspended (ACPI S3)
233#
1fa9a5e4 234# @watchdog: the watchdog action is configured to pause and has been triggered
ede085b3
HT
235#
236# @guest-panicked: guest has been panicked as a result of guest OS panic
1fa9a5e4
LC
237##
238{ 'enum': 'RunState',
239 'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused',
240 'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm',
ede085b3
HT
241 'running', 'save-vm', 'shutdown', 'suspended', 'watchdog',
242 'guest-panicked' ] }
1fa9a5e4 243
c249ee68
BC
244##
245# @SnapshotInfo
246#
247# @id: unique snapshot id
248#
249# @name: user chosen name
250#
251# @vm-state-size: size of the VM state
252#
253# @date-sec: UTC date of the snapshot in seconds
254#
255# @date-nsec: fractional part in nano seconds to be used with date-sec
256#
257# @vm-clock-sec: VM clock relative to boot in seconds
258#
259# @vm-clock-nsec: fractional part in nano seconds to be used with vm-clock-sec
260#
261# Since: 1.3
262#
263##
264
265{ 'type': 'SnapshotInfo',
266 'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int',
267 'date-sec': 'int', 'date-nsec': 'int',
268 'vm-clock-sec': 'int', 'vm-clock-nsec': 'int' } }
269
37764dfb
HR
270##
271# @ImageInfoSpecificQCow2:
272#
273# @compat: compatibility level
274#
275# @lazy-refcounts: #optional on or off; only valid for compat >= 1.1
276#
277# Since: 1.7
278##
279{ 'type': 'ImageInfoSpecificQCow2',
280 'data': {
281 'compat': 'str',
282 '*lazy-refcounts': 'bool'
283 } }
284
f4c129a3
FZ
285##
286# @ImageInfoSpecificVmdk:
287#
a9a443c8 288# @create-type: The create type of VMDK image
f4c129a3
FZ
289#
290# @cid: Content id of image
291#
292# @parent-cid: Parent VMDK image's cid
293#
294# @extents: List of extent files
295#
296# Since: 1.7
297##
298{ 'type': 'ImageInfoSpecificVmdk',
299 'data': {
300 'create-type': 'str',
301 'cid': 'int',
302 'parent-cid': 'int',
303 'extents': ['ImageInfo']
304 } }
305
f2bb8a8a
HR
306##
307# @ImageInfoSpecific:
308#
309# A discriminated record of image format specific information structures.
310#
311# Since: 1.7
312##
313
314{ 'union': 'ImageInfoSpecific',
315 'data': {
f4c129a3
FZ
316 'qcow2': 'ImageInfoSpecificQCow2',
317 'vmdk': 'ImageInfoSpecificVmdk'
f2bb8a8a
HR
318 } }
319
c249ee68
BC
320##
321# @ImageInfo:
322#
323# Information about a QEMU image file
324#
325# @filename: name of the image file
326#
327# @format: format of the image file
328#
329# @virtual-size: maximum capacity in bytes of the image
330#
331# @actual-size: #optional actual size on disk in bytes of the image
332#
333# @dirty-flag: #optional true if image is not cleanly closed
334#
335# @cluster-size: #optional size of a cluster in bytes
336#
337# @encrypted: #optional true if the image is encrypted
338#
cbe82d7f
FZ
339# @compressed: #optional true if the image is compressed (Since 1.7)
340#
c249ee68
BC
341# @backing-filename: #optional name of the backing file
342#
343# @full-backing-filename: #optional full path of the backing file
344#
345# @backing-filename-format: #optional the format of the backing file
346#
347# @snapshots: #optional list of VM snapshots
348#
553a7e87
WX
349# @backing-image: #optional info of the backing image (since 1.6)
350#
f2bb8a8a
HR
351# @format-specific: #optional structure supplying additional format-specific
352# information (since 1.7)
353#
c249ee68
BC
354# Since: 1.3
355#
356##
357
358{ 'type': 'ImageInfo',
359 'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
360 '*actual-size': 'int', 'virtual-size': 'int',
cbe82d7f 361 '*cluster-size': 'int', '*encrypted': 'bool', '*compressed': 'bool',
c249ee68 362 '*backing-filename': 'str', '*full-backing-filename': 'str',
553a7e87 363 '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'],
f2bb8a8a
HR
364 '*backing-image': 'ImageInfo',
365 '*format-specific': 'ImageInfoSpecific' } }
c249ee68 366
8599ea4c
FS
367##
368# @ImageCheck:
369#
370# Information about a QEMU image file check
371#
372# @filename: name of the image file checked
373#
374# @format: format of the image file checked
375#
376# @check-errors: number of unexpected errors occurred during check
377#
378# @image-end-offset: #optional offset (in bytes) where the image ends, this
379# field is present if the driver for the image format
380# supports it
381#
382# @corruptions: #optional number of corruptions found during the check if any
383#
384# @leaks: #optional number of leaks found during the check if any
385#
386# @corruptions-fixed: #optional number of corruptions fixed during the check
387# if any
388#
389# @leaks-fixed: #optional number of leaks fixed during the check if any
390#
391# @total-clusters: #optional total number of clusters, this field is present
392# if the driver for the image format supports it
393#
394# @allocated-clusters: #optional total number of allocated clusters, this
395# field is present if the driver for the image format
396# supports it
397#
398# @fragmented-clusters: #optional total number of fragmented clusters, this
399# field is present if the driver for the image format
400# supports it
401#
e6439d78
SH
402# @compressed-clusters: #optional total number of compressed clusters, this
403# field is present if the driver for the image format
404# supports it
405#
8599ea4c
FS
406# Since: 1.4
407#
408##
409
410{ 'type': 'ImageCheck',
411 'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
412 '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
413 '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
414 '*total-clusters': 'int', '*allocated-clusters': 'int',
e6439d78 415 '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
8599ea4c 416
1fa9a5e4
LC
417##
418# @StatusInfo:
419#
420# Information about VCPU run state
421#
422# @running: true if all VCPUs are runnable, false if not runnable
423#
424# @singlestep: true if VCPUs are in single-step mode
425#
426# @status: the virtual machine @RunState
427#
428# Since: 0.14.0
429#
430# Notes: @singlestep is enabled through the GDB stub
431##
432{ 'type': 'StatusInfo',
433 'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
434
435##
436# @query-status:
437#
438# Query the run status of all VCPUs
439#
440# Returns: @StatusInfo reflecting all VCPUs
441#
442# Since: 0.14.0
443##
444{ 'command': 'query-status', 'returns': 'StatusInfo' }
445
efab767e
LC
446##
447# @UuidInfo:
448#
449# Guest UUID information.
450#
451# @UUID: the UUID of the guest
452#
453# Since: 0.14.0
454#
455# Notes: If no UUID was specified for the guest, a null UUID is returned.
456##
457{ 'type': 'UuidInfo', 'data': {'UUID': 'str'} }
458
459##
460# @query-uuid:
461#
462# Query the guest UUID information.
463#
464# Returns: The @UuidInfo for the guest
465#
466# Since 0.14.0
467##
468{ 'command': 'query-uuid', 'returns': 'UuidInfo' }
469
c5a415a0
LC
470##
471# @ChardevInfo:
472#
473# Information about a character device.
474#
475# @label: the label of the character device
476#
477# @filename: the filename of the character device
478#
479# Notes: @filename is encoded using the QEMU command line character device
480# encoding. See the QEMU man page for details.
481#
482# Since: 0.14.0
483##
484{ 'type': 'ChardevInfo', 'data': {'label': 'str', 'filename': 'str'} }
485
486##
487# @query-chardev:
488#
489# Returns information about current character devices.
490#
491# Returns: a list of @ChardevInfo
492#
493# Since: 0.14.0
494##
495{ 'command': 'query-chardev', 'returns': ['ChardevInfo'] }
aa9b79bc 496
77d1c3c6
MK
497##
498# @ChardevBackendInfo:
499#
500# Information about a character device backend
501#
502# @name: The backend name
503#
504# Since: 2.0
505##
506{ 'type': 'ChardevBackendInfo', 'data': {'name': 'str'} }
507
508##
509# @query-chardev-backends:
510#
511# Returns information about character device backends.
512#
513# Returns: a list of @ChardevBackendInfo
514#
515# Since: 2.0
516##
517{ 'command': 'query-chardev-backends', 'returns': ['ChardevBackendInfo'] }
518
1f590cf9
LL
519##
520# @DataFormat:
521#
522# An enumeration of data format.
523#
3949e594 524# @utf8: Data is a UTF-8 string (RFC 3629)
1f590cf9 525#
3949e594 526# @base64: Data is Base64 encoded binary (RFC 3548)
1f590cf9
LL
527#
528# Since: 1.4
529##
ad0f171e 530{ 'enum': 'DataFormat',
1f590cf9
LL
531 'data': [ 'utf8', 'base64' ] }
532
533##
3949e594 534# @ringbuf-write:
1f590cf9 535#
3949e594 536# Write to a ring buffer character device.
1f590cf9 537#
3949e594 538# @device: the ring buffer character device name
1f590cf9 539#
3949e594 540# @data: data to write
1f590cf9 541#
3949e594
MA
542# @format: #optional data encoding (default 'utf8').
543# - base64: data must be base64 encoded text. Its binary
544# decoding gets written.
545# Bug: invalid base64 is currently not rejected.
546# Whitespace *is* invalid.
547# - utf8: data's UTF-8 encoding is written
548# - data itself is always Unicode regardless of format, like
549# any other string.
1f590cf9
LL
550#
551# Returns: Nothing on success
1f590cf9
LL
552#
553# Since: 1.4
554##
3949e594 555{ 'command': 'ringbuf-write',
82e59a67 556 'data': {'device': 'str', 'data': 'str',
1f590cf9
LL
557 '*format': 'DataFormat'} }
558
49b6d722 559##
3949e594 560# @ringbuf-read:
49b6d722 561#
3949e594 562# Read from a ring buffer character device.
49b6d722 563#
3949e594 564# @device: the ring buffer character device name
49b6d722 565#
3949e594 566# @size: how many bytes to read at most
49b6d722 567#
3949e594
MA
568# @format: #optional data encoding (default 'utf8').
569# - base64: the data read is returned in base64 encoding.
570# - utf8: the data read is interpreted as UTF-8.
571# Bug: can screw up when the buffer contains invalid UTF-8
572# sequences, NUL characters, after the ring buffer lost
573# data, and when reading stops because the size limit is
574# reached.
575# - The return value is always Unicode regardless of format,
576# like any other string.
49b6d722 577#
3ab651fc 578# Returns: data read from the device
49b6d722
LL
579#
580# Since: 1.4
581##
3949e594 582{ 'command': 'ringbuf-read',
49b6d722 583 'data': {'device': 'str', 'size': 'int', '*format': 'DataFormat'},
3ab651fc 584 'returns': 'str' }
49b6d722 585
aa9b79bc
LC
586##
587# @CommandInfo:
588#
589# Information about a QMP command
590#
591# @name: The command name
592#
593# Since: 0.14.0
594##
595{ 'type': 'CommandInfo', 'data': {'name': 'str'} }
596
597##
598# @query-commands:
599#
600# Return a list of supported QMP commands by this server
601#
602# Returns: A list of @CommandInfo for all supported commands
603#
604# Since: 0.14.0
605##
606{ 'command': 'query-commands', 'returns': ['CommandInfo'] }
607
4860853d
DB
608##
609# @EventInfo:
610#
611# Information about a QMP event
612#
613# @name: The event name
614#
615# Since: 1.2.0
616##
617{ 'type': 'EventInfo', 'data': {'name': 'str'} }
618
619##
620# @query-events:
621#
622# Return a list of supported QMP events by this server
623#
624# Returns: A list of @EventInfo for all supported events
625#
626# Since: 1.2.0
627##
628{ 'command': 'query-events', 'returns': ['EventInfo'] }
629
791e7c82
LC
630##
631# @MigrationStats
632#
633# Detailed migration status.
634#
635# @transferred: amount of bytes already transferred to the target VM
636#
637# @remaining: amount of bytes remaining to be transferred to the target VM
638#
639# @total: total amount of bytes involved in the migration process
640#
f1c72795
PL
641# @duplicate: number of duplicate (zero) pages (since 1.2)
642#
643# @skipped: number of skipped zero pages (since 1.5)
004d4c10
OW
644#
645# @normal : number of normal pages (since 1.2)
646#
8d017193
JQ
647# @normal-bytes: number of normal bytes sent (since 1.2)
648#
649# @dirty-pages-rate: number of pages dirtied by second by the
650# guest (since 1.3)
004d4c10 651#
7e114f8c
MH
652# @mbps: throughput in megabits/sec. (since 1.6)
653#
58570ed8
C
654# @dirty-sync-count: number of times that dirty ram was synchronized (since 2.1)
655#
004d4c10 656# Since: 0.14.0
791e7c82
LC
657##
658{ 'type': 'MigrationStats',
d5f8a570 659 'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
f1c72795 660 'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
7e114f8c 661 'normal-bytes': 'int', 'dirty-pages-rate' : 'int',
58570ed8 662 'mbps' : 'number', 'dirty-sync-count' : 'int' } }
791e7c82 663
f36d55af
OW
664##
665# @XBZRLECacheStats
666#
667# Detailed XBZRLE migration cache statistics
668#
669# @cache-size: XBZRLE cache size
670#
671# @bytes: amount of bytes already transferred to the target VM
672#
673# @pages: amount of pages transferred to the target VM
674#
675# @cache-miss: number of cache miss
676#
8bc39233
C
677# @cache-miss-rate: rate of cache miss (since 2.1)
678#
f36d55af
OW
679# @overflow: number of overflows
680#
681# Since: 1.2
682##
683{ 'type': 'XBZRLECacheStats',
684 'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
8bc39233
C
685 'cache-miss': 'int', 'cache-miss-rate': 'number',
686 'overflow': 'int' } }
f36d55af 687
791e7c82
LC
688##
689# @MigrationInfo
690#
691# Information about current migration process.
692#
693# @status: #optional string describing the current migration status.
3b695950 694# As of 0.14.0 this can be 'setup', 'active', 'completed', 'failed' or
791e7c82
LC
695# 'cancelled'. If this field is not returned, no migration process
696# has been initiated
697#
d5f8a570
JQ
698# @ram: #optional @MigrationStats containing detailed migration
699# status, only returned if status is 'active' or
700# 'completed'. 'comppleted' (since 1.2)
791e7c82
LC
701#
702# @disk: #optional @MigrationStats containing detailed disk migration
703# status, only returned if status is 'active' and it is a block
704# migration
705#
f36d55af
OW
706# @xbzrle-cache: #optional @XBZRLECacheStats containing detailed XBZRLE
707# migration statistics, only returned if XBZRLE feature is on and
708# status is 'active' or 'completed' (since 1.2)
709#
7aa939af
JQ
710# @total-time: #optional total amount of milliseconds since migration started.
711# If migration has ended, it returns the total migration
712# time. (since 1.2)
713#
9c5a9fcf
JQ
714# @downtime: #optional only present when migration finishes correctly
715# total downtime in milliseconds for the guest.
716# (since 1.3)
717#
2c52ddf1
JQ
718# @expected-downtime: #optional only present while migration is active
719# expected downtime in milliseconds for the guest in last walk
720# of the dirty bitmap. (since 1.3)
721#
ed4fbd10
MH
722# @setup-time: #optional amount of setup time in milliseconds _before_ the
723# iterations begin but _after_ the QMP command is issued. This is designed
724# to provide an accounting of any activities (such as RDMA pinning) which
725# may be expensive, but do not actually occur during the iterative
726# migration rounds themselves. (since 1.6)
727#
791e7c82
LC
728# Since: 0.14.0
729##
730{ 'type': 'MigrationInfo',
731 'data': {'*status': 'str', '*ram': 'MigrationStats',
f36d55af 732 '*disk': 'MigrationStats',
7aa939af 733 '*xbzrle-cache': 'XBZRLECacheStats',
9c5a9fcf 734 '*total-time': 'int',
2c52ddf1 735 '*expected-downtime': 'int',
ed4fbd10
MH
736 '*downtime': 'int',
737 '*setup-time': 'int'} }
791e7c82
LC
738
739##
740# @query-migrate
741#
742# Returns information about current migration process.
743#
744# Returns: @MigrationInfo
745#
746# Since: 0.14.0
747##
748{ 'command': 'query-migrate', 'returns': 'MigrationInfo' }
749
bbf6da32
OW
750##
751# @MigrationCapability
752#
753# Migration capabilities enumeration
754#
755# @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
756# This feature allows us to minimize migration traffic for certain work
757# loads, by sending compressed difference of the pages
758#
41310c68 759# @rdma-pin-all: Controls whether or not the entire VM memory footprint is
60d9222c 760# mlock()'d on demand or all at once. Refer to docs/rdma.txt for usage.
41310c68 761# Disabled by default. (since 2.0)
60d9222c 762#
323004a3
PL
763# @zero-blocks: During storage migration encode blocks of zeroes efficiently. This
764# essentially saves 1MB of zeroes per block on the wire. Enabling requires
765# source and target VM to support this feature. To enable it is sufficient
766# to enable the capability on the source VM. The feature is disabled by
767# default. (since 1.6)
768#
9781c371
JQ
769# @auto-converge: If enabled, QEMU will automatically throttle down the guest
770# to speed up convergence of RAM migration. (since 1.6)
771#
bbf6da32
OW
772# Since: 1.2
773##
774{ 'enum': 'MigrationCapability',
41310c68 775 'data': ['xbzrle', 'rdma-pin-all', 'auto-converge', 'zero-blocks'] }
bbf6da32
OW
776
777##
778# @MigrationCapabilityStatus
779#
780# Migration capability information
781#
782# @capability: capability enum
783#
784# @state: capability state bool
785#
786# Since: 1.2
787##
788{ 'type': 'MigrationCapabilityStatus',
789 'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
790
791##
00458433
OW
792# @migrate-set-capabilities
793#
794# Enable/Disable the following migration capabilities (like xbzrle)
795#
796# @capabilities: json array of capability modifications to make
797#
798# Since: 1.2
799##
800{ 'command': 'migrate-set-capabilities',
801 'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
802
803##
bbf6da32
OW
804# @query-migrate-capabilities
805#
806# Returns information about the current migration capabilities status
807#
808# Returns: @MigrationCapabilitiesStatus
809#
810# Since: 1.2
811##
812{ 'command': 'query-migrate-capabilities', 'returns': ['MigrationCapabilityStatus']}
813
e235cec3
LC
814##
815# @MouseInfo:
816#
817# Information about a mouse device.
818#
819# @name: the name of the mouse device
820#
821# @index: the index of the mouse device
822#
823# @current: true if this device is currently receiving mouse events
824#
825# @absolute: true if this device supports absolute coordinates as input
826#
827# Since: 0.14.0
828##
829{ 'type': 'MouseInfo',
830 'data': {'name': 'str', 'index': 'int', 'current': 'bool',
831 'absolute': 'bool'} }
832
833##
834# @query-mice:
835#
836# Returns information about each active mouse device
837#
838# Returns: a list of @MouseInfo for each device
839#
840# Since: 0.14.0
841##
842{ 'command': 'query-mice', 'returns': ['MouseInfo'] }
843
de0b36b6
LC
844##
845# @CpuInfo:
846#
847# Information about a virtual CPU
848#
849# @CPU: the index of the virtual CPU
850#
851# @current: this only exists for backwards compatible and should be ignored
b80e560b 852#
de0b36b6
LC
853# @halted: true if the virtual CPU is in the halt state. Halt usually refers
854# to a processor specific low power mode.
855#
856# @pc: #optional If the target is i386 or x86_64, this is the 64-bit instruction
857# pointer.
858# If the target is Sparc, this is the PC component of the
859# instruction pointer.
860#
861# @nip: #optional If the target is PPC, the instruction pointer
862#
863# @npc: #optional If the target is Sparc, the NPC component of the instruction
864# pointer
865#
866# @PC: #optional If the target is MIPS, the instruction pointer
867#
868# @thread_id: ID of the underlying host thread
869#
870# Since: 0.14.0
871#
872# Notes: @halted is a transient state that changes frequently. By the time the
873# data is sent to the client, the guest may no longer be halted.
874##
875{ 'type': 'CpuInfo',
876 'data': {'CPU': 'int', 'current': 'bool', 'halted': 'bool', '*pc': 'int',
877 '*nip': 'int', '*npc': 'int', '*PC': 'int', 'thread_id': 'int'} }
878
879##
880# @query-cpus:
881#
882# Returns a list of information about each virtual CPU.
883#
884# Returns: a list of @CpuInfo for each virtual CPU
885#
886# Since: 0.14.0
887##
888{ 'command': 'query-cpus', 'returns': ['CpuInfo'] }
889
dc3dd0d2
SH
890##
891# @IOThreadInfo:
892#
893# Information about an iothread
894#
895# @id: the identifier of the iothread
896#
897# @thread-id: ID of the underlying host thread
898#
899# Since: 2.0
900##
901{ 'type': 'IOThreadInfo',
902 'data': {'id': 'str', 'thread-id': 'int'} }
903
904##
905# @query-iothreads:
906#
907# Returns a list of information about each iothread.
908#
909# Note this list excludes the QEMU main loop thread, which is not declared
910# using the -object iothread command-line option. It is always the main thread
911# of the process.
912#
913# Returns: a list of @IOThreadInfo for each iothread
914#
915# Since: 2.0
916##
917{ 'command': 'query-iothreads', 'returns': ['IOThreadInfo'] }
918
b2023818
LC
919##
920# @BlockDeviceInfo:
921#
922# Information about the backing device for a block device.
923#
924# @file: the filename of the backing device
925#
c13163fb
BC
926# @node-name: #optional the name of the block driver node (Since 2.0)
927#
b2023818
LC
928# @ro: true if the backing device was open read-only
929#
930# @drv: the name of the block format used to open the backing device. As of
931# 0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
932# 'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
933# 'host_floppy', 'http', 'https', 'nbd', 'parallels', 'qcow',
934# 'qcow2', 'raw', 'tftp', 'vdi', 'vmdk', 'vpc', 'vvfat'
935#
936# @backing_file: #optional the name of the backing file (for copy-on-write)
937#
2e3e3317
BC
938# @backing_file_depth: number of files in the backing file chain (since: 1.2)
939#
b2023818
LC
940# @encrypted: true if the backing device is encrypted
941#
c75a1a8a
LC
942# @encryption_key_missing: true if the backing device is encrypted but an
943# valid encryption key is missing
944#
465bee1d
PL
945# @detect_zeroes: detect and optimize zero writes (Since 2.1)
946#
727f005e
ZYW
947# @bps: total throughput limit in bytes per second is specified
948#
949# @bps_rd: read throughput limit in bytes per second is specified
950#
951# @bps_wr: write throughput limit in bytes per second is specified
952#
953# @iops: total I/O operations per second is specified
954#
955# @iops_rd: read I/O operations per second is specified
956#
957# @iops_wr: write I/O operations per second is specified
958#
553a7e87
WX
959# @image: the info of image used (since: 1.6)
960#
3e9fab69
BC
961# @bps_max: #optional total max in bytes (Since 1.7)
962#
963# @bps_rd_max: #optional read max in bytes (Since 1.7)
964#
965# @bps_wr_max: #optional write max in bytes (Since 1.7)
966#
967# @iops_max: #optional total I/O operations max (Since 1.7)
968#
969# @iops_rd_max: #optional read I/O operations max (Since 1.7)
970#
971# @iops_wr_max: #optional write I/O operations max (Since 1.7)
972#
2024c1df
BC
973# @iops_size: #optional an I/O size in bytes (Since 1.7)
974#
b2023818
LC
975# Since: 0.14.0
976#
b2023818
LC
977##
978{ 'type': 'BlockDeviceInfo',
c13163fb 979 'data': { 'file': 'str', '*node-name': 'str', 'ro': 'bool', 'drv': 'str',
2e3e3317 980 '*backing_file': 'str', 'backing_file_depth': 'int',
c75a1a8a 981 'encrypted': 'bool', 'encryption_key_missing': 'bool',
465bee1d 982 'detect_zeroes': 'BlockdevDetectZeroesOptions',
c75a1a8a 983 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
553a7e87 984 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
3e9fab69
BC
985 'image': 'ImageInfo',
986 '*bps_max': 'int', '*bps_rd_max': 'int',
987 '*bps_wr_max': 'int', '*iops_max': 'int',
2024c1df
BC
988 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
989 '*iops_size': 'int' } }
b2023818
LC
990
991##
992# @BlockDeviceIoStatus:
993#
994# An enumeration of block device I/O status.
995#
996# @ok: The last I/O operation has succeeded
997#
998# @failed: The last I/O operation has failed
999#
1000# @nospace: The last I/O operation has failed due to a no-space condition
1001#
1002# Since: 1.0
1003##
1004{ 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
1005
facd6e2b
PB
1006##
1007# @BlockDeviceMapEntry:
1008#
1009# Entry in the metadata map of the device (returned by "qemu-img map")
1010#
1011# @start: Offset in the image of the first byte described by this entry
1012# (in bytes)
1013#
1014# @length: Length of the range described by this entry (in bytes)
1015#
1016# @depth: Number of layers (0 = top image, 1 = top image's backing file, etc.)
1017# before reaching one for which the range is allocated. The value is
1018# in the range 0 to the depth of the image chain - 1.
1019#
1020# @zero: the sectors in this range read as zeros
1021#
1022# @data: reading the image will actually read data from a file (in particular,
1023# if @offset is present this means that the sectors are not simply
1024# preallocated, but contain actual data in raw format)
1025#
1026# @offset: if present, the image file stores the data for this range in
1027# raw format at the given offset.
1028#
1029# Since 1.7
1030##
1031{ 'type': 'BlockDeviceMapEntry',
1032 'data': { 'start': 'int', 'length': 'int', 'depth': 'int', 'zero': 'bool',
1033 'data': 'bool', '*offset': 'int' } }
1034
b9a9b3a4
PB
1035##
1036# @BlockDirtyInfo:
1037#
1038# Block dirty bitmap information.
1039#
1040# @count: number of dirty bytes according to the dirty bitmap
1041#
50717e94
PB
1042# @granularity: granularity of the dirty bitmap in bytes (since 1.4)
1043#
b9a9b3a4
PB
1044# Since: 1.3
1045##
1046{ 'type': 'BlockDirtyInfo',
50717e94 1047 'data': {'count': 'int', 'granularity': 'int'} }
b9a9b3a4 1048
b2023818
LC
1049##
1050# @BlockInfo:
1051#
1052# Block device information. This structure describes a virtual device and
1053# the backing device associated with it.
1054#
1055# @device: The device name associated with the virtual device.
1056#
1057# @type: This field is returned only for compatibility reasons, it should
1058# not be used (always returns 'unknown')
1059#
1060# @removable: True if the device supports removable media.
1061#
1062# @locked: True if the guest has locked this device from having its media
1063# removed
1064#
1065# @tray_open: #optional True if the device has a tray and it is open
1066# (only present if removable is true)
1067#
21b56835 1068# @dirty-bitmaps: #optional dirty bitmaps information (only present if the
01443e13 1069# driver has one or more dirty bitmaps) (Since 2.0)
b9a9b3a4 1070#
b2023818
LC
1071# @io-status: #optional @BlockDeviceIoStatus. Only present if the device
1072# supports it and the VM is configured to stop on errors
1073#
1074# @inserted: #optional @BlockDeviceInfo describing the device if media is
1075# present
1076#
1077# Since: 0.14.0
1078##
1079{ 'type': 'BlockInfo',
1080 'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
1081 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
b9a9b3a4 1082 '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
21b56835 1083 '*dirty-bitmaps': ['BlockDirtyInfo'] } }
b2023818
LC
1084
1085##
1086# @query-block:
1087#
1088# Get a list of BlockInfo for all virtual block devices.
1089#
1090# Returns: a list of @BlockInfo describing each virtual block device
1091#
1092# Since: 0.14.0
1093##
1094{ 'command': 'query-block', 'returns': ['BlockInfo'] }
1095
f11f57e4
LC
1096##
1097# @BlockDeviceStats:
1098#
1099# Statistics of a virtual block device or a block backing device.
1100#
1101# @rd_bytes: The number of bytes read by the device.
1102#
1103# @wr_bytes: The number of bytes written by the device.
1104#
1105# @rd_operations: The number of read operations performed by the device.
1106#
1107# @wr_operations: The number of write operations performed by the device.
1108#
1109# @flush_operations: The number of cache flush operations performed by the
1110# device (since 0.15.0)
1111#
1112# @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
1113# (since 0.15.0).
1114#
1115# @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
1116#
1117# @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
1118#
1119# @wr_highest_offset: The offset after the greatest byte written to the
1120# device. The intended use of this information is for
1121# growable sparse files (like qcow2) that are used on top
1122# of a physical device.
1123#
1124# Since: 0.14.0
1125##
1126{ 'type': 'BlockDeviceStats',
1127 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
1128 'wr_operations': 'int', 'flush_operations': 'int',
1129 'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
1130 'rd_total_time_ns': 'int', 'wr_highest_offset': 'int' } }
1131
1132##
1133# @BlockStats:
1134#
1135# Statistics of a virtual block device or a block backing device.
1136#
1137# @device: #optional If the stats are for a virtual block device, the name
1138# corresponding to the virtual block device.
1139#
1140# @stats: A @BlockDeviceStats for the device.
1141#
c8059b97
FZ
1142# @parent: #optional This describes the file block device if it has one.
1143#
1144# @backing: #optional This describes the backing block device if it has one.
1145# (Since 2.0)
f11f57e4
LC
1146#
1147# Since: 0.14.0
1148##
1149{ 'type': 'BlockStats',
1150 'data': {'*device': 'str', 'stats': 'BlockDeviceStats',
c8059b97
FZ
1151 '*parent': 'BlockStats',
1152 '*backing': 'BlockStats'} }
f11f57e4
LC
1153
1154##
1155# @query-blockstats:
1156#
1157# Query the @BlockStats for all virtual block devices.
1158#
1159# Returns: A list of @BlockStats for each virtual block devices.
1160#
1161# Since: 0.14.0
1162##
1163{ 'command': 'query-blockstats', 'returns': ['BlockStats'] }
1164
2b54aa87
LC
1165##
1166# @VncClientInfo:
1167#
1168# Information about a connected VNC client.
1169#
1170# @host: The host name of the client. QEMU tries to resolve this to a DNS name
1171# when possible.
1172#
1173# @family: 'ipv6' if the client is connected via IPv6 and TCP
1174# 'ipv4' if the client is connected via IPv4 and TCP
1175# 'unix' if the client is connected via a unix domain socket
1176# 'unknown' otherwise
1177#
1178# @service: The service name of the client's port. This may depends on the
1179# host system's service database so symbolic names should not be
1180# relied on.
1181#
1182# @x509_dname: #optional If x509 authentication is in use, the Distinguished
1183# Name of the client.
1184#
1185# @sasl_username: #optional If SASL authentication is in use, the SASL username
1186# used for authentication.
1187#
1188# Since: 0.14.0
1189##
1190{ 'type': 'VncClientInfo',
1191 'data': {'host': 'str', 'family': 'str', 'service': 'str',
1192 '*x509_dname': 'str', '*sasl_username': 'str'} }
1193
1194##
1195# @VncInfo:
1196#
1197# Information about the VNC session.
1198#
1199# @enabled: true if the VNC server is enabled, false otherwise
1200#
1201# @host: #optional The hostname the VNC server is bound to. This depends on
1202# the name resolution on the host and may be an IP address.
1203#
1204# @family: #optional 'ipv6' if the host is listening for IPv6 connections
1205# 'ipv4' if the host is listening for IPv4 connections
1206# 'unix' if the host is listening on a unix domain socket
1207# 'unknown' otherwise
1208#
1209# @service: #optional The service name of the server's port. This may depends
1210# on the host system's service database so symbolic names should not
1211# be relied on.
1212#
1213# @auth: #optional the current authentication type used by the server
1214# 'none' if no authentication is being used
1215# 'vnc' if VNC authentication is being used
1216# 'vencrypt+plain' if VEncrypt is used with plain text authentication
1217# 'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
1218# 'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
1219# 'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
1220# 'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
1221# 'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
1222# 'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
1223# 'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
1224# 'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
1225#
1226# @clients: a list of @VncClientInfo of all currently connected clients
1227#
1228# Since: 0.14.0
1229##
1230{ 'type': 'VncInfo',
1231 'data': {'enabled': 'bool', '*host': 'str', '*family': 'str',
1232 '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
1233
1234##
1235# @query-vnc:
1236#
1237# Returns information about the current VNC server
1238#
1239# Returns: @VncInfo
2b54aa87
LC
1240#
1241# Since: 0.14.0
1242##
1243{ 'command': 'query-vnc', 'returns': 'VncInfo' }
1244
d1f29646
LC
1245##
1246# @SpiceChannel
1247#
1248# Information about a SPICE client channel.
1249#
1250# @host: The host name of the client. QEMU tries to resolve this to a DNS name
1251# when possible.
1252#
1253# @family: 'ipv6' if the client is connected via IPv6 and TCP
1254# 'ipv4' if the client is connected via IPv4 and TCP
1255# 'unix' if the client is connected via a unix domain socket
1256# 'unknown' otherwise
1257#
1258# @port: The client's port number.
1259#
1260# @connection-id: SPICE connection id number. All channels with the same id
1261# belong to the same SPICE session.
1262#
419e1bdf
AL
1263# @connection-type: SPICE channel type number. "1" is the main control
1264# channel, filter for this one if you want to track spice
1265# sessions only
d1f29646 1266#
419e1bdf
AL
1267# @channel-id: SPICE channel ID number. Usually "0", might be different when
1268# multiple channels of the same type exist, such as multiple
d1f29646
LC
1269# display channels in a multihead setup
1270#
1271# @tls: true if the channel is encrypted, false otherwise.
1272#
1273# Since: 0.14.0
1274##
1275{ 'type': 'SpiceChannel',
1276 'data': {'host': 'str', 'family': 'str', 'port': 'str',
1277 'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
1278 'tls': 'bool'} }
1279
4efee029
AL
1280##
1281# @SpiceQueryMouseMode
1282#
6932a69b 1283# An enumeration of Spice mouse states.
4efee029
AL
1284#
1285# @client: Mouse cursor position is determined by the client.
1286#
1287# @server: Mouse cursor position is determined by the server.
1288#
1289# @unknown: No information is available about mouse mode used by
1290# the spice server.
1291#
1292# Note: spice/enums.h has a SpiceMouseMode already, hence the name.
1293#
1294# Since: 1.1
1295##
1296{ 'enum': 'SpiceQueryMouseMode',
1297 'data': [ 'client', 'server', 'unknown' ] }
1298
d1f29646
LC
1299##
1300# @SpiceInfo
1301#
1302# Information about the SPICE session.
b80e560b 1303#
d1f29646
LC
1304# @enabled: true if the SPICE server is enabled, false otherwise
1305#
61c4efe2
YH
1306# @migrated: true if the last guest migration completed and spice
1307# migration had completed as well. false otherwise.
1308#
d1f29646
LC
1309# @host: #optional The hostname the SPICE server is bound to. This depends on
1310# the name resolution on the host and may be an IP address.
1311#
1312# @port: #optional The SPICE server's port number.
1313#
1314# @compiled-version: #optional SPICE server version.
1315#
1316# @tls-port: #optional The SPICE server's TLS port number.
1317#
1318# @auth: #optional the current authentication type used by the server
419e1bdf
AL
1319# 'none' if no authentication is being used
1320# 'spice' uses SASL or direct TLS authentication, depending on command
1321# line options
d1f29646 1322#
4efee029
AL
1323# @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
1324# be determined by the client or the server, or unknown if spice
1325# server doesn't provide this information.
1326#
1327# Since: 1.1
1328#
d1f29646
LC
1329# @channels: a list of @SpiceChannel for each active spice channel
1330#
1331# Since: 0.14.0
1332##
1333{ 'type': 'SpiceInfo',
61c4efe2 1334 'data': {'enabled': 'bool', 'migrated': 'bool', '*host': 'str', '*port': 'int',
d1f29646 1335 '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
4efee029 1336 'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
d1f29646
LC
1337
1338##
1339# @query-spice
1340#
1341# Returns information about the current SPICE server
1342#
1343# Returns: @SpiceInfo
1344#
1345# Since: 0.14.0
1346##
1347{ 'command': 'query-spice', 'returns': 'SpiceInfo' }
1348
96637bcd
LC
1349##
1350# @BalloonInfo:
1351#
1352# Information about the guest balloon device.
1353#
1354# @actual: the number of bytes the balloon currently contains
1355#
96637bcd
LC
1356# Since: 0.14.0
1357#
96637bcd 1358##
01ceb97e 1359{ 'type': 'BalloonInfo', 'data': {'actual': 'int' } }
96637bcd
LC
1360
1361##
1362# @query-balloon:
1363#
1364# Return information about the balloon device.
1365#
1366# Returns: @BalloonInfo on success
1367# If the balloon driver is enabled but not functional because the KVM
1368# kernel module cannot support it, KvmMissingCap
1369# If no balloon device is present, DeviceNotActive
1370#
1371# Since: 0.14.0
1372##
1373{ 'command': 'query-balloon', 'returns': 'BalloonInfo' }
1374
79627472
LC
1375##
1376# @PciMemoryRange:
1377#
1378# A PCI device memory region
1379#
1380# @base: the starting address (guest physical)
1381#
1382# @limit: the ending address (guest physical)
1383#
1384# Since: 0.14.0
1385##
1386{ 'type': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
1387
1388##
1389# @PciMemoryRegion
1390#
1391# Information about a PCI device I/O region.
1392#
1393# @bar: the index of the Base Address Register for this region
1394#
1395# @type: 'io' if the region is a PIO region
1396# 'memory' if the region is a MMIO region
1397#
1398# @prefetch: #optional if @type is 'memory', true if the memory is prefetchable
1399#
1400# @mem_type_64: #optional if @type is 'memory', true if the BAR is 64-bit
1401#
1402# Since: 0.14.0
1403##
1404{ 'type': 'PciMemoryRegion',
1405 'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
1406 '*prefetch': 'bool', '*mem_type_64': 'bool' } }
1407
1408##
1409# @PciBridgeInfo:
1410#
1411# Information about a PCI Bridge device
1412#
1413# @bus.number: primary bus interface number. This should be the number of the
1414# bus the device resides on.
1415#
1416# @bus.secondary: secondary bus interface number. This is the number of the
1417# main bus for the bridge
1418#
1419# @bus.subordinate: This is the highest number bus that resides below the
1420# bridge.
1421#
1422# @bus.io_range: The PIO range for all devices on this bridge
1423#
1424# @bus.memory_range: The MMIO range for all devices on this bridge
1425#
1426# @bus.prefetchable_range: The range of prefetchable MMIO for all devices on
1427# this bridge
1428#
1429# @devices: a list of @PciDeviceInfo for each device on this bridge
1430#
1431# Since: 0.14.0
1432##
1433{ 'type': 'PciBridgeInfo',
1434 'data': {'bus': { 'number': 'int', 'secondary': 'int', 'subordinate': 'int',
1435 'io_range': 'PciMemoryRange',
1436 'memory_range': 'PciMemoryRange',
1437 'prefetchable_range': 'PciMemoryRange' },
1438 '*devices': ['PciDeviceInfo']} }
1439
1440##
1441# @PciDeviceInfo:
1442#
1443# Information about a PCI device
1444#
1445# @bus: the bus number of the device
1446#
1447# @slot: the slot the device is located in
1448#
1449# @function: the function of the slot used by the device
1450#
1451# @class_info.desc: #optional a string description of the device's class
1452#
1453# @class_info.class: the class code of the device
1454#
1455# @id.device: the PCI device id
1456#
1457# @id.vendor: the PCI vendor id
1458#
1459# @irq: #optional if an IRQ is assigned to the device, the IRQ number
1460#
1461# @qdev_id: the device name of the PCI device
1462#
1463# @pci_bridge: if the device is a PCI bridge, the bridge information
1464#
1465# @regions: a list of the PCI I/O regions associated with the device
1466#
1467# Notes: the contents of @class_info.desc are not stable and should only be
1468# treated as informational.
1469#
1470# Since: 0.14.0
1471##
1472{ 'type': 'PciDeviceInfo',
1473 'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
1474 'class_info': {'*desc': 'str', 'class': 'int'},
1475 'id': {'device': 'int', 'vendor': 'int'},
1476 '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
1477 'regions': ['PciMemoryRegion']} }
1478
1479##
1480# @PciInfo:
1481#
1482# Information about a PCI bus
1483#
1484# @bus: the bus index
1485#
1486# @devices: a list of devices on this bus
1487#
1488# Since: 0.14.0
1489##
1490{ 'type': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
1491
1492##
1493# @query-pci:
1494#
1495# Return information about the PCI bus topology of the guest.
1496#
1497# Returns: a list of @PciInfo for each PCI bus
1498#
1499# Since: 0.14.0
1500##
1501{ 'command': 'query-pci', 'returns': ['PciInfo'] }
1502
92aa5c6d
PB
1503##
1504# @BlockdevOnError:
1505#
1506# An enumeration of possible behaviors for errors on I/O operations.
1507# The exact meaning depends on whether the I/O was initiated by a guest
1508# or by a block job
1509#
1510# @report: for guest operations, report the error to the guest;
1511# for jobs, cancel the job
1512#
1513# @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
1514# or BLOCK_JOB_ERROR)
1515#
1516# @enospc: same as @stop on ENOSPC, same as @report otherwise.
1517#
1518# @stop: for guest operations, stop the virtual machine;
1519# for jobs, pause the job
1520#
1521# Since: 1.3
1522##
1523{ 'enum': 'BlockdevOnError',
1524 'data': ['report', 'ignore', 'enospc', 'stop'] }
1525
893f7eba
PB
1526##
1527# @MirrorSyncMode:
1528#
1529# An enumeration of possible behaviors for the initial synchronization
1530# phase of storage mirroring.
1531#
1532# @top: copies data in the topmost image to the destination
1533#
1534# @full: copies data from all images to the destination
1535#
1536# @none: only copy data written from now on
1537#
1538# Since: 1.3
1539##
1540{ 'enum': 'MirrorSyncMode',
1541 'data': ['top', 'full', 'none'] }
1542
2cb5b222
FZ
1543##
1544# @BlockJobType:
1545#
1546# Type of a block job.
1547#
1548# @commit: block commit job type, see "block-commit"
1549#
1550# @stream: block stream job type, see "block-stream"
1551#
1552# @mirror: drive mirror job type, see "drive-mirror"
1553#
1554# @backup: drive backup job type, see "drive-backup"
1555#
1556# Since: 1.7
1557##
1558{ 'enum': 'BlockJobType',
1559 'data': ['commit', 'stream', 'mirror', 'backup'] }
1560
fb5458cd
SH
1561##
1562# @BlockJobInfo:
1563#
1564# Information about a long-running block device operation.
1565#
1566# @type: the job type ('stream' for image streaming)
1567#
1568# @device: the block device name
1569#
1570# @len: the maximum progress value
1571#
8d65883f
PB
1572# @busy: false if the job is known to be in a quiescent state, with
1573# no pending I/O. Since 1.3.
1574#
8acc72a4
PB
1575# @paused: whether the job is paused or, if @busy is true, will
1576# pause itself as soon as possible. Since 1.3.
1577#
fb5458cd
SH
1578# @offset: the current progress value
1579#
1580# @speed: the rate limit, bytes per second
1581#
32c81a4a
PB
1582# @io-status: the status of the job (since 1.3)
1583#
fb5458cd
SH
1584# Since: 1.1
1585##
1586{ 'type': 'BlockJobInfo',
1587 'data': {'type': 'str', 'device': 'str', 'len': 'int',
32c81a4a
PB
1588 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1589 'io-status': 'BlockDeviceIoStatus'} }
fb5458cd
SH
1590
1591##
1592# @query-block-jobs:
1593#
1594# Return information about long-running block device operations.
1595#
1596# Returns: a list of @BlockJobInfo for each active block job
1597#
1598# Since: 1.1
1599##
1600{ 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1601
7a7f325e
LC
1602##
1603# @quit:
1604#
1605# This command will cause the QEMU process to exit gracefully. While every
1606# attempt is made to send the QMP response before terminating, this is not
1607# guaranteed. When using this interface, a premature EOF would not be
1608# unexpected.
1609#
1610# Since: 0.14.0
1611##
1612{ 'command': 'quit' }
5f158f21
LC
1613
1614##
1615# @stop:
1616#
1617# Stop all guest VCPU execution.
1618#
1619# Since: 0.14.0
1620#
1621# Notes: This function will succeed even if the guest is already in the stopped
1e998146
PB
1622# state. In "inmigrate" state, it will ensure that the guest
1623# remains paused once migration finishes, as if the -S option was
1624# passed on the command line.
5f158f21
LC
1625##
1626{ 'command': 'stop' }
38d22653
LC
1627
1628##
1629# @system_reset:
1630#
1631# Performs a hard reset of a guest.
1632#
1633# Since: 0.14.0
1634##
1635{ 'command': 'system_reset' }
5bc465e4
LC
1636
1637##
1638# @system_powerdown:
1639#
1640# Requests that a guest perform a powerdown operation.
1641#
1642# Since: 0.14.0
1643#
1644# Notes: A guest may or may not respond to this command. This command
1645# returning does not indicate that a guest has accepted the request or
1646# that it has shut down. Many guests will respond to this command by
1647# prompting the user in some way.
1648##
1649{ 'command': 'system_powerdown' }
755f1968
LC
1650
1651##
1652# @cpu:
1653#
1654# This command is a nop that is only provided for the purposes of compatibility.
1655#
1656# Since: 0.14.0
1657#
1658# Notes: Do not use this command.
1659##
1660{ 'command': 'cpu', 'data': {'index': 'int'} }
0cfd6a9a 1661
69ca3ea5
IM
1662##
1663# @cpu-add
1664#
1665# Adds CPU with specified ID
1666#
1667# @id: ID of CPU to be created, valid values [0..max_cpus)
1668#
1669# Returns: Nothing on success
1670#
1671# Since 1.5
1672##
1673{ 'command': 'cpu-add', 'data': {'id': 'int'} }
1674
0cfd6a9a
LC
1675##
1676# @memsave:
1677#
1678# Save a portion of guest memory to a file.
1679#
1680# @val: the virtual address of the guest to start from
1681#
1682# @size: the size of memory region to save
1683#
1684# @filename: the file to save the memory to as binary data
1685#
1686# @cpu-index: #optional the index of the virtual CPU to use for translating the
1687# virtual address (defaults to CPU 0)
1688#
1689# Returns: Nothing on success
0cfd6a9a
LC
1690#
1691# Since: 0.14.0
1692#
1693# Notes: Errors were not reliably returned until 1.1
1694##
1695{ 'command': 'memsave',
1696 'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
6d3962bf
LC
1697
1698##
1699# @pmemsave:
1700#
1701# Save a portion of guest physical memory to a file.
1702#
1703# @val: the physical address of the guest to start from
1704#
1705# @size: the size of memory region to save
1706#
1707# @filename: the file to save the memory to as binary data
1708#
1709# Returns: Nothing on success
6d3962bf
LC
1710#
1711# Since: 0.14.0
1712#
1713# Notes: Errors were not reliably returned until 1.1
1714##
1715{ 'command': 'pmemsave',
1716 'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
e42e818b
LC
1717
1718##
1719# @cont:
1720#
1721# Resume guest VCPU execution.
1722#
1723# Since: 0.14.0
1724#
1725# Returns: If successful, nothing
e42e818b
LC
1726# If QEMU was started with an encrypted block device and a key has
1727# not yet been set, DeviceEncrypted.
1728#
1e998146
PB
1729# Notes: This command will succeed if the guest is currently running. It
1730# will also succeed if the guest is in the "inmigrate" state; in
1731# this case, the effect of the command is to make sure the guest
1732# starts once migration finishes, removing the effect of the -S
1733# command line option if it was passed.
e42e818b
LC
1734##
1735{ 'command': 'cont' }
1736
9b9df25a
GH
1737##
1738# @system_wakeup:
1739#
1740# Wakeup guest from suspend. Does nothing in case the guest isn't suspended.
1741#
1742# Since: 1.1
1743#
1744# Returns: nothing.
1745##
1746{ 'command': 'system_wakeup' }
1747
ab49ab5c
LC
1748##
1749# @inject-nmi:
1750#
1751# Injects an Non-Maskable Interrupt into all guest's VCPUs.
1752#
1753# Returns: If successful, nothing
ab49ab5c
LC
1754#
1755# Since: 0.14.0
1756#
1757# Notes: Only x86 Virtual Machines support this command.
1758##
1759{ 'command': 'inject-nmi' }
4b37156c
LC
1760
1761##
1762# @set_link:
1763#
1764# Sets the link status of a virtual network adapter.
1765#
1766# @name: the device name of the virtual network adapter
1767#
1768# @up: true to set the link status to be up
1769#
1770# Returns: Nothing on success
1771# If @name is not a valid network device, DeviceNotFound
1772#
1773# Since: 0.14.0
1774#
1775# Notes: Not all network adapters support setting link status. This command
1776# will succeed even if the network adapter does not support link status
1777# notification.
1778##
1779{ 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
a4dea8a9
LC
1780
1781##
1782# @block_passwd:
1783#
1784# This command sets the password of a block device that has not been open
1785# with a password and requires one.
1786#
1787# The two cases where this can happen are a block device is created through
1788# QEMU's initial command line or a block device is changed through the legacy
1789# @change interface.
1790#
1791# In the event that the block device is created through the initial command
1792# line, the VM will start in the stopped state regardless of whether '-S' is
1793# used. The intention is for a management tool to query the block devices to
1794# determine which ones are encrypted, set the passwords with this command, and
1795# then start the guest with the @cont command.
1796#
12d3ba82
BC
1797# Either @device or @node-name must be set but not both.
1798#
1799# @device: #optional the name of the block backend device to set the password on
1800#
1801# @node-name: #optional graph node name to set the password on (Since 2.0)
a4dea8a9
LC
1802#
1803# @password: the password to use for the device
1804#
1805# Returns: nothing on success
1806# If @device is not a valid block device, DeviceNotFound
1807# If @device is not encrypted, DeviceNotEncrypted
a4dea8a9
LC
1808#
1809# Notes: Not all block formats support encryption and some that do are not
1810# able to validate that a password is correct. Disk corruption may
1811# occur if an invalid password is specified.
1812#
1813# Since: 0.14.0
1814##
12d3ba82
BC
1815{ 'command': 'block_passwd', 'data': {'*device': 'str',
1816 '*node-name': 'str', 'password': 'str'} }
d72f3264
LC
1817
1818##
1819# @balloon:
1820#
1821# Request the balloon driver to change its balloon size.
1822#
1823# @value: the target size of the balloon in bytes
1824#
1825# Returns: Nothing on success
1826# If the balloon driver is enabled but not functional because the KVM
1827# kernel module cannot support it, KvmMissingCap
1828# If no balloon device is present, DeviceNotActive
1829#
1830# Notes: This command just issues a request to the guest. When it returns,
1831# the balloon size may not have changed. A guest can change the balloon
1832# size independent of this command.
1833#
1834# Since: 0.14.0
1835##
1836{ 'command': 'balloon', 'data': {'value': 'int'} }
5e7caacb
LC
1837
1838##
1839# @block_resize
1840#
1841# Resize a block image while a guest is running.
1842#
3b1dbd11
BC
1843# Either @device or @node-name must be set but not both.
1844#
1845# @device: #optional the name of the device to get the image resized
1846#
1847# @node-name: #optional graph node name to get the image resized (Since 2.0)
5e7caacb
LC
1848#
1849# @size: new image size in bytes
1850#
1851# Returns: nothing on success
1852# If @device is not a valid block device, DeviceNotFound
5e7caacb
LC
1853#
1854# Since: 0.14.0
1855##
3b1dbd11
BC
1856{ 'command': 'block_resize', 'data': { '*device': 'str',
1857 '*node-name': 'str',
1858 'size': 'int' }}
6106e249 1859
8802d1fd 1860##
bc8b094f
PB
1861# @NewImageMode
1862#
1863# An enumeration that tells QEMU how to set the backing file path in
1864# a new image file.
1865#
1866# @existing: QEMU should look for an existing image file.
1867#
1868# @absolute-paths: QEMU should create a new image with absolute paths
1296c2f0
HR
1869# for the backing file. If there is no backing file available, the new
1870# image will not be backed either.
bc8b094f
PB
1871#
1872# Since: 1.1
1873##
ad0f171e 1874{ 'enum': 'NewImageMode',
bc8b094f
PB
1875 'data': [ 'existing', 'absolute-paths' ] }
1876
8802d1fd 1877##
52e7c241 1878# @BlockdevSnapshot
8802d1fd 1879#
0901f67e
BC
1880# Either @device or @node-name must be set but not both.
1881#
1882# @device: #optional the name of the device to generate the snapshot from.
1883#
1884# @node-name: #optional graph node name to generate the snapshot from (Since 2.0)
8802d1fd
JC
1885#
1886# @snapshot-file: the target of the new image. A new file will be created.
1887#
0901f67e
BC
1888# @snapshot-node-name: #optional the graph node name of the new image (Since 2.0)
1889#
8802d1fd 1890# @format: #optional the format of the snapshot image, default is 'qcow2'.
6cc2a415
PB
1891#
1892# @mode: #optional whether and how QEMU should create a new image, default is
8bde9b6f 1893# 'absolute-paths'.
8802d1fd 1894##
52e7c241 1895{ 'type': 'BlockdevSnapshot',
0901f67e
BC
1896 'data': { '*device': 'str', '*node-name': 'str',
1897 'snapshot-file': 'str', '*snapshot-node-name': 'str',
1898 '*format': 'str', '*mode': 'NewImageMode' } }
8802d1fd 1899
bbe86010
WX
1900##
1901# @BlockdevSnapshotInternal
1902#
1903# @device: the name of the device to generate the snapshot from
1904#
1905# @name: the name of the internal snapshot to be created
1906#
1907# Notes: In transaction, if @name is empty, or any snapshot matching @name
1908# exists, the operation will fail. Only some image formats support it,
1909# for example, qcow2, rbd, and sheepdog.
1910#
1911# Since: 1.7
1912##
1913{ 'type': 'BlockdevSnapshotInternal',
1914 'data': { 'device': 'str', 'name': 'str' } }
1915
3037f364
SH
1916##
1917# @DriveBackup
1918#
1919# @device: the name of the device which should be copied.
1920#
1921# @target: the target of the new image. If the file exists, or if it
1922# is a device, the existing file/device will be used as the new
1923# destination. If it does not exist, a new file will be created.
1924#
1925# @format: #optional the format of the new destination, default is to
1926# probe if @mode is 'existing', else the format of the source
1927#
b53169ea
SH
1928# @sync: what parts of the disk image should be copied to the destination
1929# (all the disk, only the sectors allocated in the topmost image, or
1930# only new I/O).
1931#
3037f364
SH
1932# @mode: #optional whether and how QEMU should create a new image, default is
1933# 'absolute-paths'.
1934#
1935# @speed: #optional the maximum speed, in bytes per second
1936#
1937# @on-source-error: #optional the action to take on an error on the source,
1938# default 'report'. 'stop' and 'enospc' can only be used
1939# if the block device supports io-status (see BlockInfo).
1940#
1941# @on-target-error: #optional the action to take on an error on the target,
1942# default 'report' (no limitations, since this applies to
1943# a different block device than @device).
1944#
1945# Note that @on-source-error and @on-target-error only affect background I/O.
1946# If an error occurs during a guest write request, the device's rerror/werror
1947# actions will be used.
1948#
1949# Since: 1.6
1950##
1951{ 'type': 'DriveBackup',
1952 'data': { 'device': 'str', 'target': 'str', '*format': 'str',
b53169ea
SH
1953 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
1954 '*speed': 'int',
3037f364
SH
1955 '*on-source-error': 'BlockdevOnError',
1956 '*on-target-error': 'BlockdevOnError' } }
1957
78b18b78
SH
1958##
1959# @Abort
1960#
1961# This action can be used to test transaction failure.
1962#
1963# Since: 1.6
1964###
1965{ 'type': 'Abort',
1966 'data': { } }
1967
8802d1fd 1968##
c8a83e85 1969# @TransactionAction
8802d1fd 1970#
52e7c241
PB
1971# A discriminated record of operations that can be performed with
1972# @transaction.
8802d1fd 1973##
c8a83e85 1974{ 'union': 'TransactionAction',
52e7c241 1975 'data': {
3037f364 1976 'blockdev-snapshot-sync': 'BlockdevSnapshot',
78b18b78 1977 'drive-backup': 'DriveBackup',
bbe86010
WX
1978 'abort': 'Abort',
1979 'blockdev-snapshot-internal-sync': 'BlockdevSnapshotInternal'
52e7c241 1980 } }
8802d1fd
JC
1981
1982##
52e7c241 1983# @transaction
8802d1fd 1984#
c8a83e85
KW
1985# Executes a number of transactionable QMP commands atomically. If any
1986# operation fails, then the entire set of actions will be abandoned and the
1987# appropriate error returned.
8802d1fd
JC
1988#
1989# List of:
c8a83e85 1990# @TransactionAction: information needed for the respective operation
8802d1fd
JC
1991#
1992# Returns: nothing on success
c8a83e85 1993# Errors depend on the operations of the transaction
8802d1fd 1994#
c8a83e85
KW
1995# Note: The transaction aborts on the first failure. Therefore, there will be
1996# information on only one failed operation returned in an error condition, and
52e7c241
PB
1997# subsequent actions will not have been attempted.
1998#
1999# Since 1.1
8802d1fd 2000##
52e7c241 2001{ 'command': 'transaction',
c8a83e85 2002 'data': { 'actions': [ 'TransactionAction' ] } }
8802d1fd 2003
6106e249
LC
2004##
2005# @blockdev-snapshot-sync
2006#
2007# Generates a synchronous snapshot of a block device.
2008#
852ad1a9 2009# For the arguments, see the documentation of BlockdevSnapshot.
6cc2a415 2010#
6106e249
LC
2011# Returns: nothing on success
2012# If @device is not a valid block device, DeviceNotFound
6106e249 2013#
6106e249
LC
2014# Since 0.14.0
2015##
2016{ 'command': 'blockdev-snapshot-sync',
852ad1a9 2017 'data': 'BlockdevSnapshot' }
d51a67b4 2018
f323bc9e
WX
2019##
2020# @blockdev-snapshot-internal-sync
2021#
2022# Synchronously take an internal snapshot of a block device, when the format
2023# of the image used supports it.
2024#
2025# For the arguments, see the documentation of BlockdevSnapshotInternal.
2026#
2027# Returns: nothing on success
2028# If @device is not a valid block device, DeviceNotFound
2029# If any snapshot matching @name exists, or @name is empty,
2030# GenericError
2031# If the format of the image used does not support it,
2032# BlockFormatFeatureNotSupported
2033#
2034# Since 1.7
2035##
2036{ 'command': 'blockdev-snapshot-internal-sync',
2037 'data': 'BlockdevSnapshotInternal' }
2038
44e3e053
WX
2039##
2040# @blockdev-snapshot-delete-internal-sync
2041#
2042# Synchronously delete an internal snapshot of a block device, when the format
2043# of the image used support it. The snapshot is identified by name or id or
2044# both. One of the name or id is required. Return SnapshotInfo for the
2045# successfully deleted snapshot.
2046#
2047# @device: the name of the device to delete the snapshot from
2048#
2049# @id: optional the snapshot's ID to be deleted
2050#
2051# @name: optional the snapshot's name to be deleted
2052#
2053# Returns: SnapshotInfo on success
2054# If @device is not a valid block device, DeviceNotFound
2055# If snapshot not found, GenericError
2056# If the format of the image used does not support it,
2057# BlockFormatFeatureNotSupported
2058# If @id and @name are both not specified, GenericError
2059#
2060# Since 1.7
2061##
2062{ 'command': 'blockdev-snapshot-delete-internal-sync',
2063 'data': { 'device': 'str', '*id': 'str', '*name': 'str'},
2064 'returns': 'SnapshotInfo' }
2065
d51a67b4
LC
2066##
2067# @human-monitor-command:
2068#
2069# Execute a command on the human monitor and return the output.
2070#
2071# @command-line: the command to execute in the human monitor
2072#
2073# @cpu-index: #optional The CPU to use for commands that require an implicit CPU
2074#
2075# Returns: the output of the command as a string
2076#
2077# Since: 0.14.0
2078#
59b00962 2079# Notes: This command only exists as a stop-gap. Its use is highly
d51a67b4
LC
2080# discouraged. The semantics of this command are not guaranteed.
2081#
2082# Known limitations:
2083#
2084# o This command is stateless, this means that commands that depend
2085# on state information (such as getfd) might not work
2086#
2087# o Commands that prompt the user for data (eg. 'cont' when the block
2088# device is encrypted) don't currently work
2089##
2090{ 'command': 'human-monitor-command',
2091 'data': {'command-line': 'str', '*cpu-index': 'int'},
b80e560b 2092 'returns': 'str' }
6cdedb07
LC
2093
2094##
ed61fc10
JC
2095# @block-commit
2096#
2097# Live commit of data from overlay image nodes into backing nodes - i.e.,
2098# writes data between 'top' and 'base' into 'base'.
2099#
2100# @device: the name of the device
2101#
2102# @base: #optional The file name of the backing image to write data into.
2103# If not specified, this is the deepest backing image
2104#
2105# @top: The file name of the backing image within the image chain,
2106# which contains the topmost data to be committed down.
ed61fc10
JC
2107#
2108# If top == base, that is an error.
20a63d2c
FZ
2109# If top == active, the job will not be completed by itself,
2110# user needs to complete the job with the block-job-complete
2111# command after getting the ready event. (Since 2.0)
ed61fc10 2112#
37222900
JC
2113# If the base image is smaller than top, then the base image
2114# will be resized to be the same size as top. If top is
2115# smaller than the base image, the base will not be
2116# truncated. If you want the base image size to match the
2117# size of the smaller top, you can safely truncate it
2118# yourself once the commit operation successfully completes.
2119#
ed61fc10
JC
2120#
2121# @speed: #optional the maximum speed, in bytes per second
2122#
2123# Returns: Nothing on success
2124# If commit or stream is already active on this device, DeviceInUse
2125# If @device does not exist, DeviceNotFound
2126# If image commit is not supported by this device, NotSupported
2127# If @base or @top is invalid, a generic error is returned
ed61fc10
JC
2128# If @speed is invalid, InvalidParameter
2129#
2130# Since: 1.3
2131#
2132##
2133{ 'command': 'block-commit',
2134 'data': { 'device': 'str', '*base': 'str', 'top': 'str',
2135 '*speed': 'int' } }
2136
99a9addf
SH
2137##
2138# @drive-backup
2139#
2140# Start a point-in-time copy of a block device to a new destination. The
2141# status of ongoing drive-backup operations can be checked with
2142# query-block-jobs where the BlockJobInfo.type field has the value 'backup'.
2143# The operation can be stopped before it has completed using the
2144# block-job-cancel command.
2145#
f53cae50 2146# For the arguments, see the documentation of DriveBackup.
99a9addf
SH
2147#
2148# Returns: nothing on success
2149# If @device is not a valid block device, DeviceNotFound
2150#
2151# Since 1.6
2152##
f53cae50 2153{ 'command': 'drive-backup', 'data': 'DriveBackup' }
99a9addf 2154
c13163fb
BC
2155##
2156# @query-named-block-nodes
2157#
2158# Get the named block driver list
2159#
2160# Returns: the list of BlockDeviceInfo
2161#
2162# Since 2.0
2163##
2164{ 'command': 'query-named-block-nodes', 'returns': [ 'BlockDeviceInfo' ] }
2165
d9b902db
PB
2166##
2167# @drive-mirror
2168#
2169# Start mirroring a block device's writes to a new destination.
2170#
2171# @device: the name of the device whose writes should be mirrored.
2172#
2173# @target: the target of the new image. If the file exists, or if it
2174# is a device, the existing file/device will be used as the new
2175# destination. If it does not exist, a new file will be created.
2176#
2177# @format: #optional the format of the new destination, default is to
2178# probe if @mode is 'existing', else the format of the source
2179#
2180# @mode: #optional whether and how QEMU should create a new image, default is
2181# 'absolute-paths'.
2182#
2183# @speed: #optional the maximum speed, in bytes per second
2184#
2185# @sync: what parts of the disk image should be copied to the destination
2186# (all the disk, only the sectors allocated in the topmost image, or
2187# only new I/O).
2188#
eee13dfe
PB
2189# @granularity: #optional granularity of the dirty bitmap, default is 64K
2190# if the image format doesn't have clusters, 4K if the clusters
2191# are smaller than that, else the cluster size. Must be a
2192# power of 2 between 512 and 64M (since 1.4).
2193#
08e4ed6c
PB
2194# @buf-size: #optional maximum amount of data in flight from source to
2195# target (since 1.4).
2196#
b952b558
PB
2197# @on-source-error: #optional the action to take on an error on the source,
2198# default 'report'. 'stop' and 'enospc' can only be used
2199# if the block device supports io-status (see BlockInfo).
2200#
2201# @on-target-error: #optional the action to take on an error on the target,
2202# default 'report' (no limitations, since this applies to
2203# a different block device than @device).
2204#
d9b902db
PB
2205# Returns: nothing on success
2206# If @device is not a valid block device, DeviceNotFound
2207#
2208# Since 1.3
2209##
2210{ 'command': 'drive-mirror',
2211 'data': { 'device': 'str', 'target': 'str', '*format': 'str',
2212 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
eee13dfe 2213 '*speed': 'int', '*granularity': 'uint32',
08e4ed6c 2214 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
b952b558 2215 '*on-target-error': 'BlockdevOnError' } }
d9b902db
PB
2216
2217##
6cdedb07
LC
2218# @migrate_cancel
2219#
2220# Cancel the current executing migration process.
2221#
2222# Returns: nothing on success
2223#
2224# Notes: This command succeeds even if there is no migration process running.
2225#
2226# Since: 0.14.0
2227##
2228{ 'command': 'migrate_cancel' }
4f0a993b
LC
2229
2230##
2231# @migrate_set_downtime
2232#
2233# Set maximum tolerated downtime for migration.
2234#
2235# @value: maximum downtime in seconds
2236#
2237# Returns: nothing on success
2238#
2239# Since: 0.14.0
2240##
2241{ 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
3dc85383
LC
2242
2243##
2244# @migrate_set_speed
2245#
2246# Set maximum speed for migration.
2247#
2248# @value: maximum speed in bytes.
2249#
2250# Returns: nothing on success
2251#
2252# Notes: A value lesser than zero will be automatically round up to zero.
2253#
2254# Since: 0.14.0
2255##
2256{ 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
b4b12c62 2257
9e1ba4cc
OW
2258##
2259# @migrate-set-cache-size
2260#
2261# Set XBZRLE cache size
2262#
2263# @value: cache size in bytes
2264#
2265# The size will be rounded down to the nearest power of 2.
2266# The cache size can be modified before and during ongoing migration
2267#
2268# Returns: nothing on success
2269#
2270# Since: 1.2
2271##
2272{ 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
2273
2274##
2275# @query-migrate-cache-size
2276#
2277# query XBZRLE cache size
2278#
2279# Returns: XBZRLE cache size in bytes
2280#
2281# Since: 1.2
2282##
2283{ 'command': 'query-migrate-cache-size', 'returns': 'int' }
2284
b4b12c62 2285##
d03ee401 2286# @ObjectPropertyInfo:
b4b12c62
AL
2287#
2288# @name: the name of the property
2289#
2290# @type: the type of the property. This will typically come in one of four
2291# forms:
2292#
2293# 1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
2294# These types are mapped to the appropriate JSON type.
2295#
2296# 2) A legacy type in the form 'legacy<subtype>' where subtype is the
2297# legacy qdev typename. These types are always treated as strings.
2298#
2299# 3) A child type in the form 'child<subtype>' where subtype is a qdev
2300# device type name. Child properties create the composition tree.
2301#
2302# 4) A link type in the form 'link<subtype>' where subtype is a qdev
2303# device type name. Link properties form the device model graph.
2304#
51920820 2305# Since: 1.2
b4b12c62 2306##
57c9fafe 2307{ 'type': 'ObjectPropertyInfo',
b4b12c62
AL
2308 'data': { 'name': 'str', 'type': 'str' } }
2309
2310##
2311# @qom-list:
2312#
57c9fafe 2313# This command will list any properties of a object given a path in the object
b4b12c62
AL
2314# model.
2315#
57c9fafe 2316# @path: the path within the object model. See @qom-get for a description of
b4b12c62
AL
2317# this parameter.
2318#
57c9fafe
AL
2319# Returns: a list of @ObjectPropertyInfo that describe the properties of the
2320# object.
b4b12c62 2321#
51920820 2322# Since: 1.2
b4b12c62
AL
2323##
2324{ 'command': 'qom-list',
2325 'data': { 'path': 'str' },
57c9fafe 2326 'returns': [ 'ObjectPropertyInfo' ] }
eb6e8ea5
AL
2327
2328##
2329# @qom-get:
2330#
57c9fafe 2331# This command will get a property from a object model path and return the
eb6e8ea5
AL
2332# value.
2333#
57c9fafe 2334# @path: The path within the object model. There are two forms of supported
eb6e8ea5
AL
2335# paths--absolute and partial paths.
2336#
57c9fafe 2337# Absolute paths are derived from the root object and can follow child<>
eb6e8ea5
AL
2338# or link<> properties. Since they can follow link<> properties, they
2339# can be arbitrarily long. Absolute paths look like absolute filenames
2340# and are prefixed with a leading slash.
2341#
2342# Partial paths look like relative filenames. They do not begin
2343# with a prefix. The matching rules for partial paths are subtle but
57c9fafe 2344# designed to make specifying objects easy. At each level of the
eb6e8ea5
AL
2345# composition tree, the partial path is matched as an absolute path.
2346# The first match is not returned. At least two matches are searched
2347# for. A successful result is only returned if only one match is
2348# found. If more than one match is found, a flag is return to
2349# indicate that the match was ambiguous.
2350#
2351# @property: The property name to read
2352#
2353# Returns: The property value. The type depends on the property type. legacy<>
2354# properties are returned as #str. child<> and link<> properties are
2355# returns as #str pathnames. All integer property types (u8, u16, etc)
2356# are returned as #int.
2357#
51920820 2358# Since: 1.2
eb6e8ea5
AL
2359##
2360{ 'command': 'qom-get',
2361 'data': { 'path': 'str', 'property': 'str' },
2362 'returns': 'visitor',
2363 'gen': 'no' }
2364
2365##
2366# @qom-set:
2367#
57c9fafe 2368# This command will set a property from a object model path.
eb6e8ea5
AL
2369#
2370# @path: see @qom-get for a description of this parameter
2371#
2372# @property: the property name to set
2373#
2374# @value: a value who's type is appropriate for the property type. See @qom-get
2375# for a description of type mapping.
2376#
51920820 2377# Since: 1.2
eb6e8ea5
AL
2378##
2379{ 'command': 'qom-set',
2380 'data': { 'path': 'str', 'property': 'str', 'value': 'visitor' },
2381 'gen': 'no' }
fbf796fd
LC
2382
2383##
2384# @set_password:
2385#
2386# Sets the password of a remote display session.
2387#
2388# @protocol: `vnc' to modify the VNC server password
2389# `spice' to modify the Spice server password
2390#
2391# @password: the new password
2392#
2393# @connected: #optional how to handle existing clients when changing the
b80e560b 2394# password. If nothing is specified, defaults to `keep'
fbf796fd
LC
2395# `fail' to fail the command if clients are connected
2396# `disconnect' to disconnect existing clients
2397# `keep' to maintain existing clients
2398#
2399# Returns: Nothing on success
2400# If Spice is not enabled, DeviceNotFound
fbf796fd
LC
2401#
2402# Since: 0.14.0
2403##
2404{ 'command': 'set_password',
2405 'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
9ad5372d
LC
2406
2407##
2408# @expire_password:
2409#
2410# Expire the password of a remote display server.
2411#
2412# @protocol: the name of the remote display protocol `vnc' or `spice'
2413#
2414# @time: when to expire the password.
2415# `now' to expire the password immediately
2416# `never' to cancel password expiration
2417# `+INT' where INT is the number of seconds from now (integer)
2418# `INT' where INT is the absolute time in seconds
2419#
2420# Returns: Nothing on success
2421# If @protocol is `spice' and Spice is not active, DeviceNotFound
9ad5372d
LC
2422#
2423# Since: 0.14.0
2424#
2425# Notes: Time is relative to the server and currently there is no way to
2426# coordinate server time with client time. It is not recommended to
2427# use the absolute time version of the @time parameter unless you're
2428# sure you are on the same machine as the QEMU instance.
2429##
2430{ 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
c245b6a3
LC
2431
2432##
2433# @eject:
2434#
2435# Ejects a device from a removable drive.
2436#
2437# @device: The name of the device
2438#
2439# @force: @optional If true, eject regardless of whether the drive is locked.
2440# If not specified, the default value is false.
2441#
2442# Returns: Nothing on success
2443# If @device is not a valid block device, DeviceNotFound
c245b6a3
LC
2444#
2445# Notes: Ejecting a device will no media results in success
2446#
2447# Since: 0.14.0
2448##
2449{ 'command': 'eject', 'data': {'device': 'str', '*force': 'bool'} }
270b243f
LC
2450
2451##
2452# @change-vnc-password:
2453#
2454# Change the VNC server password.
2455#
2456# @target: the new password to use with VNC authentication
2457#
2458# Since: 1.1
2459#
2460# Notes: An empty password in this command will set the password to the empty
2461# string. Existing clients are unaffected by executing this command.
2462##
2463{ 'command': 'change-vnc-password', 'data': {'password': 'str'} }
333a96ec
LC
2464
2465##
2466# @change:
2467#
2468# This command is multiple commands multiplexed together.
2469#
2470# @device: This is normally the name of a block device but it may also be 'vnc'.
2471# when it's 'vnc', then sub command depends on @target
2472#
2473# @target: If @device is a block device, then this is the new filename.
2474# If @device is 'vnc', then if the value 'password' selects the vnc
2475# change password command. Otherwise, this specifies a new server URI
2476# address to listen to for VNC connections.
2477#
2478# @arg: If @device is a block device, then this is an optional format to open
2479# the device with.
2480# If @device is 'vnc' and @target is 'password', this is the new VNC
2481# password to set. If this argument is an empty string, then no future
2482# logins will be allowed.
2483#
2484# Returns: Nothing on success.
2485# If @device is not a valid block device, DeviceNotFound
333a96ec
LC
2486# If the new block device is encrypted, DeviceEncrypted. Note that
2487# if this error is returned, the device has been opened successfully
2488# and an additional call to @block_passwd is required to set the
2489# device's password. The behavior of reads and writes to the block
2490# device between when these calls are executed is undefined.
2491#
2492# Notes: It is strongly recommended that this interface is not used especially
2493# for changing block devices.
2494#
2495# Since: 0.14.0
2496##
2497{ 'command': 'change',
2498 'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
80047da5
LC
2499
2500##
2501# @block_set_io_throttle:
2502#
2503# Change I/O throttle limits for a block drive.
2504#
2505# @device: The name of the device
2506#
2507# @bps: total throughput limit in bytes per second
2508#
2509# @bps_rd: read throughput limit in bytes per second
2510#
2511# @bps_wr: write throughput limit in bytes per second
2512#
2513# @iops: total I/O operations per second
2514#
2515# @ops_rd: read I/O operations per second
2516#
2517# @iops_wr: write I/O operations per second
2518#
3e9fab69
BC
2519# @bps_max: #optional total max in bytes (Since 1.7)
2520#
2521# @bps_rd_max: #optional read max in bytes (Since 1.7)
2522#
2523# @bps_wr_max: #optional write max in bytes (Since 1.7)
2524#
2525# @iops_max: #optional total I/O operations max (Since 1.7)
2526#
2527# @iops_rd_max: #optional read I/O operations max (Since 1.7)
2528#
2529# @iops_wr_max: #optional write I/O operations max (Since 1.7)
2530#
2024c1df
BC
2531# @iops_size: #optional an I/O size in bytes (Since 1.7)
2532#
80047da5
LC
2533# Returns: Nothing on success
2534# If @device is not a valid block device, DeviceNotFound
80047da5
LC
2535#
2536# Since: 1.1
b80e560b 2537##
80047da5
LC
2538{ 'command': 'block_set_io_throttle',
2539 'data': { 'device': 'str', 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
3e9fab69
BC
2540 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int',
2541 '*bps_max': 'int', '*bps_rd_max': 'int',
2542 '*bps_wr_max': 'int', '*iops_max': 'int',
2024c1df
BC
2543 '*iops_rd_max': 'int', '*iops_wr_max': 'int',
2544 '*iops_size': 'int' } }
12bd451f 2545
db58f9c0
SH
2546##
2547# @block-stream:
12bd451f
SH
2548#
2549# Copy data from a backing file into a block device.
2550#
2551# The block streaming operation is performed in the background until the entire
2552# backing file has been copied. This command returns immediately once streaming
2553# has started. The status of ongoing block streaming operations can be checked
2554# with query-block-jobs. The operation can be stopped before it has completed
db58f9c0 2555# using the block-job-cancel command.
12bd451f
SH
2556#
2557# If a base file is specified then sectors are not copied from that base file and
2558# its backing chain. When streaming completes the image file will have the base
2559# file as its backing file. This can be used to stream a subset of the backing
2560# file chain instead of flattening the entire image.
2561#
2562# On successful completion the image file is updated to drop the backing file
2563# and the BLOCK_JOB_COMPLETED event is emitted.
2564#
2565# @device: the device name
2566#
2567# @base: #optional the common backing file name
2568#
c83c66c3
SH
2569# @speed: #optional the maximum speed, in bytes per second
2570#
1d809098
PB
2571# @on-error: #optional the action to take on an error (default report).
2572# 'stop' and 'enospc' can only be used if the block device
2573# supports io-status (see BlockInfo). Since 1.3.
2574#
12bd451f 2575# Returns: Nothing on success
12bd451f 2576# If @device does not exist, DeviceNotFound
12bd451f
SH
2577#
2578# Since: 1.1
2579##
1d809098
PB
2580{ 'command': 'block-stream',
2581 'data': { 'device': 'str', '*base': 'str', '*speed': 'int',
2582 '*on-error': 'BlockdevOnError' } }
2d47c6e9
SH
2583
2584##
db58f9c0 2585# @block-job-set-speed:
2d47c6e9
SH
2586#
2587# Set maximum speed for a background block operation.
2588#
2589# This command can only be issued when there is an active block job.
2590#
2591# Throttling can be disabled by setting the speed to 0.
2592#
2593# @device: the device name
2594#
c83c66c3
SH
2595# @speed: the maximum speed, in bytes per second, or 0 for unlimited.
2596# Defaults to 0.
2d47c6e9
SH
2597#
2598# Returns: Nothing on success
05290d80 2599# If no background operation is active on this device, DeviceNotActive
2d47c6e9
SH
2600#
2601# Since: 1.1
2602##
db58f9c0 2603{ 'command': 'block-job-set-speed',
882ec7ce 2604 'data': { 'device': 'str', 'speed': 'int' } }
370521a1
SH
2605
2606##
db58f9c0 2607# @block-job-cancel:
370521a1 2608#
05290d80 2609# Stop an active background block operation.
370521a1 2610#
05290d80 2611# This command returns immediately after marking the active background block
370521a1
SH
2612# operation for cancellation. It is an error to call this command if no
2613# operation is in progress.
2614#
2615# The operation will cancel as soon as possible and then emit the
2616# BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
2617# enumerated using query-block-jobs.
2618#
05290d80
PB
2619# For streaming, the image file retains its backing file unless the streaming
2620# operation happens to complete just as it is being cancelled. A new streaming
2621# operation can be started at a later time to finish copying all data from the
2622# backing file.
370521a1
SH
2623#
2624# @device: the device name
2625#
6e37fb81
PB
2626# @force: #optional whether to allow cancellation of a paused job (default
2627# false). Since 1.3.
2628#
370521a1 2629# Returns: Nothing on success
05290d80 2630# If no background operation is active on this device, DeviceNotActive
370521a1
SH
2631#
2632# Since: 1.1
2633##
6e37fb81
PB
2634{ 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2635
2636##
2637# @block-job-pause:
2638#
2639# Pause an active background block operation.
2640#
2641# This command returns immediately after marking the active background block
2642# operation for pausing. It is an error to call this command if no
2643# operation is in progress. Pausing an already paused job has no cumulative
2644# effect; a single block-job-resume command will resume the job.
2645#
2646# The operation will pause as soon as possible. No event is emitted when
2647# the operation is actually paused. Cancelling a paused job automatically
2648# resumes it.
2649#
2650# @device: the device name
2651#
2652# Returns: Nothing on success
2653# If no background operation is active on this device, DeviceNotActive
2654#
2655# Since: 1.3
2656##
2657{ 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2658
2659##
2660# @block-job-resume:
2661#
2662# Resume an active background block operation.
2663#
2664# This command returns immediately after resuming a paused background block
2665# operation. It is an error to call this command if no operation is in
2666# progress. Resuming an already running job is not an error.
2667#
32c81a4a
PB
2668# This command also clears the error status of the job.
2669#
6e37fb81
PB
2670# @device: the device name
2671#
2672# Returns: Nothing on success
2673# If no background operation is active on this device, DeviceNotActive
2674#
2675# Since: 1.3
2676##
2677{ 'command': 'block-job-resume', 'data': { 'device': 'str' } }
5eeee3fa 2678
aeae883b
PB
2679##
2680# @block-job-complete:
2681#
2682# Manually trigger completion of an active background block operation. This
2683# is supported for drive mirroring, where it also switches the device to
a66a2a36
PB
2684# write to the target path only. The ability to complete is signaled with
2685# a BLOCK_JOB_READY event.
aeae883b
PB
2686#
2687# This command completes an active background block operation synchronously.
2688# The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2689# is not defined. Note that if an I/O error occurs during the processing of
2690# this command: 1) the command itself will fail; 2) the error will be processed
2691# according to the rerror/werror arguments that were specified when starting
2692# the operation.
2693#
2694# A cancelled or paused job cannot be completed.
2695#
2696# @device: the device name
2697#
2698# Returns: Nothing on success
2699# If no background operation is active on this device, DeviceNotActive
2700#
2701# Since: 1.3
2702##
2703{ 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2704
5eeee3fa
AL
2705##
2706# @ObjectTypeInfo:
2707#
2708# This structure describes a search result from @qom-list-types
2709#
2710# @name: the type name found in the search
2711#
2712# Since: 1.1
2713#
2714# Notes: This command is experimental and may change syntax in future releases.
2715##
2716{ 'type': 'ObjectTypeInfo',
2717 'data': { 'name': 'str' } }
2718
2719##
2720# @qom-list-types:
2721#
2722# This command will return a list of types given search parameters
2723#
2724# @implements: if specified, only return types that implement this type name
2725#
2726# @abstract: if true, include abstract types in the results
2727#
2728# Returns: a list of @ObjectTypeInfo or an empty list if no results are found
2729#
2730# Since: 1.1
5eeee3fa
AL
2731##
2732{ 'command': 'qom-list-types',
2733 'data': { '*implements': 'str', '*abstract': 'bool' },
2734 'returns': [ 'ObjectTypeInfo' ] }
e1c37d0e 2735
1daa31b9
AL
2736##
2737# @DevicePropertyInfo:
2738#
2739# Information about device properties.
2740#
2741# @name: the name of the property
2742# @type: the typename of the property
2743#
2744# Since: 1.2
2745##
2746{ 'type': 'DevicePropertyInfo',
2747 'data': { 'name': 'str', 'type': 'str' } }
2748
2749##
2750# @device-list-properties:
2751#
2752# List properties associated with a device.
2753#
2754# @typename: the type name of a device
2755#
2756# Returns: a list of DevicePropertyInfo describing a devices properties
2757#
2758# Since: 1.2
2759##
2760{ 'command': 'device-list-properties',
2761 'data': { 'typename': 'str'},
2762 'returns': [ 'DevicePropertyInfo' ] }
2763
e1c37d0e
LC
2764##
2765# @migrate
2766#
2767# Migrates the current running guest to another Virtual Machine.
2768#
2769# @uri: the Uniform Resource Identifier of the destination VM
2770#
2771# @blk: #optional do block migration (full disk copy)
2772#
2773# @inc: #optional incremental disk copy migration
2774#
2775# @detach: this argument exists only for compatibility reasons and
2776# is ignored by QEMU
2777#
2778# Returns: nothing on success
2779#
2780# Since: 0.14.0
2781##
2782{ 'command': 'migrate',
2783 'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
33cf629a 2784
a7ae8355
SS
2785# @xen-save-devices-state:
2786#
2787# Save the state of all devices to file. The RAM and the block devices
2788# of the VM are not saved by this command.
2789#
2790# @filename: the file to save the state of the devices to as binary
2791# data. See xen-save-devices-state.txt for a description of the binary
2792# format.
2793#
2794# Returns: Nothing on success
a7ae8355
SS
2795#
2796# Since: 1.1
2797##
2798{ 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
a15fef21 2799
39f42439
AP
2800##
2801# @xen-set-global-dirty-log
2802#
2803# Enable or disable the global dirty log mode.
2804#
2805# @enable: true to enable, false to disable.
2806#
2807# Returns: nothing
2808#
2809# Since: 1.3
2810##
2811{ 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
2812
a15fef21
LC
2813##
2814# @device_del:
2815#
2816# Remove a device from a guest
2817#
2818# @id: the name of the device
2819#
2820# Returns: Nothing on success
2821# If @id is not a valid device, DeviceNotFound
a15fef21
LC
2822#
2823# Notes: When this command completes, the device may not be removed from the
2824# guest. Hot removal is an operation that requires guest cooperation.
2825# This command merely requests that the guest begin the hot removal
0402a5d6
MT
2826# process. Completion of the device removal process is signaled with a
2827# DEVICE_DELETED event. Guest reset will automatically complete removal
2828# for all devices.
a15fef21
LC
2829#
2830# Since: 0.14.0
2831##
2832{ 'command': 'device_del', 'data': {'id': 'str'} }
783e9b48 2833
b53ccc30
QN
2834##
2835# @DumpGuestMemoryFormat:
2836#
2837# An enumeration of guest-memory-dump's format.
2838#
2839# @elf: elf format
2840#
2841# @kdump-zlib: kdump-compressed format with zlib-compressed
2842#
2843# @kdump-lzo: kdump-compressed format with lzo-compressed
2844#
2845# @kdump-snappy: kdump-compressed format with snappy-compressed
2846#
2847# Since: 2.0
2848##
2849{ 'enum': 'DumpGuestMemoryFormat',
2850 'data': [ 'elf', 'kdump-zlib', 'kdump-lzo', 'kdump-snappy' ] }
2851
783e9b48
WC
2852##
2853# @dump-guest-memory
2854#
2855# Dump guest's memory to vmcore. It is a synchronous operation that can take
2856# very long depending on the amount of guest memory. This command is only
f5b0d93b
LC
2857# supported on i386 and x86_64.
2858#
2859# @paging: if true, do paging to get guest's memory mapping. This allows
d691180e 2860# using gdb to process the core file.
f5b0d93b 2861#
d691180e
LC
2862# IMPORTANT: this option can make QEMU allocate several gigabytes
2863# of RAM. This can happen for a large guest, or a
2864# malicious guest pretending to be large.
2865#
2866# Also, paging=true has the following limitations:
2867#
2868# 1. The guest may be in a catastrophic state or can have corrupted
2869# memory, which cannot be trusted
2870# 2. The guest can be in real-mode even if paging is enabled. For
2871# example, the guest uses ACPI to sleep, and ACPI sleep state
2872# goes in real-mode
f5b0d93b 2873#
783e9b48 2874# @protocol: the filename or file descriptor of the vmcore. The supported
d691180e 2875# protocols are:
f5b0d93b 2876#
d691180e
LC
2877# 1. file: the protocol starts with "file:", and the following
2878# string is the file's path.
2879# 2. fd: the protocol starts with "fd:", and the following string
2880# is the fd's name.
f5b0d93b 2881#
783e9b48 2882# @begin: #optional if specified, the starting physical address.
f5b0d93b 2883#
783e9b48 2884# @length: #optional if specified, the memory size, in bytes. If you don't
d691180e
LC
2885# want to dump all guest's memory, please specify the start @begin
2886# and @length
783e9b48 2887#
b53ccc30
QN
2888# @format: #optional if specified, the format of guest memory dump. But non-elf
2889# format is conflict with paging and filter, ie. @paging, @begin and
2890# @length is not allowed to be specified with non-elf @format at the
2891# same time (since 2.0)
2892#
783e9b48 2893# Returns: nothing on success
783e9b48
WC
2894#
2895# Since: 1.2
2896##
2897{ 'command': 'dump-guest-memory',
2898 'data': { 'paging': 'bool', 'protocol': 'str', '*begin': 'int',
b53ccc30 2899 '*length': 'int', '*format': 'DumpGuestMemoryFormat' } }
d691180e 2900
7d6dc7f3
QN
2901##
2902# @DumpGuestMemoryCapability:
2903#
2904# A list of the available formats for dump-guest-memory
2905#
2906# Since: 2.0
2907##
2908{ 'type': 'DumpGuestMemoryCapability',
2909 'data': {
2910 'formats': ['DumpGuestMemoryFormat'] } }
2911
2912##
2913# @query-dump-guest-memory-capability:
2914#
2915# Returns the available formats for dump-guest-memory
2916#
2917# Returns: A @DumpGuestMemoryCapability object listing available formats for
2918# dump-guest-memory
2919#
2920# Since: 2.0
2921##
2922{ 'command': 'query-dump-guest-memory-capability',
2923 'returns': 'DumpGuestMemoryCapability' }
d691180e 2924
928059a3
LC
2925##
2926# @netdev_add:
2927#
2928# Add a network backend.
2929#
2930# @type: the type of network backend. Current valid values are 'user', 'tap',
2931# 'vde', 'socket', 'dump' and 'bridge'
2932#
2933# @id: the name of the new network backend
2934#
2935# @props: #optional a list of properties to be passed to the backend in
2936# the format 'name=value', like 'ifname=tap0,script=no'
2937#
2938# Notes: The semantics of @props is not well defined. Future commands will be
2939# introduced that provide stronger typing for backend creation.
2940#
2941# Since: 0.14.0
2942#
2943# Returns: Nothing on success
2944# If @type is not a valid network backend, DeviceNotFound
928059a3
LC
2945##
2946{ 'command': 'netdev_add',
2947 'data': {'type': 'str', 'id': 'str', '*props': '**'},
2948 'gen': 'no' }
5f964155
LC
2949
2950##
2951# @netdev_del:
2952#
2953# Remove a network backend.
2954#
2955# @id: the name of the network backend to remove
2956#
2957# Returns: Nothing on success
2958# If @id is not a valid network backend, DeviceNotFound
2959#
2960# Since: 0.14.0
2961##
2962{ 'command': 'netdev_del', 'data': {'id': 'str'} }
208c9d1b 2963
cff8b2c6
PB
2964##
2965# @object-add:
2966#
2967# Create a QOM object.
2968#
2969# @qom-type: the class name for the object to be created
2970#
2971# @id: the name of the new object
2972#
2973# @props: #optional a dictionary of properties to be passed to the backend
2974#
2975# Returns: Nothing on success
2976# Error if @qom-type is not a valid class name
2977#
2978# Since: 2.0
2979##
2980{ 'command': 'object-add',
2981 'data': {'qom-type': 'str', 'id': 'str', '*props': 'dict'},
2982 'gen': 'no' }
2983
ab2d0531
PB
2984##
2985# @object-del:
2986#
2987# Remove a QOM object.
2988#
2989# @id: the name of the QOM object to remove
2990#
2991# Returns: Nothing on success
2992# Error if @id is not a valid id for a QOM object
2993#
2994# Since: 2.0
2995##
2996{ 'command': 'object-del', 'data': {'id': 'str'} }
2997
14aa0c2d
LE
2998##
2999# @NetdevNoneOptions
3000#
3001# Use it alone to have zero network devices.
3002#
3003# Since 1.2
3004##
3005{ 'type': 'NetdevNoneOptions',
3006 'data': { } }
3007
3008##
3009# @NetLegacyNicOptions
3010#
3011# Create a new Network Interface Card.
3012#
3013# @netdev: #optional id of -netdev to connect to
3014#
3015# @macaddr: #optional MAC address
3016#
3017# @model: #optional device model (e1000, rtl8139, virtio etc.)
3018#
3019# @addr: #optional PCI device address
3020#
3021# @vectors: #optional number of MSI-x vectors, 0 to disable MSI-X
3022#
3023# Since 1.2
3024##
3025{ 'type': 'NetLegacyNicOptions',
3026 'data': {
3027 '*netdev': 'str',
3028 '*macaddr': 'str',
3029 '*model': 'str',
3030 '*addr': 'str',
3031 '*vectors': 'uint32' } }
3032
3033##
3034# @String
3035#
3036# A fat type wrapping 'str', to be embedded in lists.
3037#
3038# Since 1.2
3039##
3040{ 'type': 'String',
3041 'data': {
3042 'str': 'str' } }
3043
3044##
3045# @NetdevUserOptions
3046#
3047# Use the user mode network stack which requires no administrator privilege to
3048# run.
3049#
3050# @hostname: #optional client hostname reported by the builtin DHCP server
3051#
3052# @restrict: #optional isolate the guest from the host
3053#
3054# @ip: #optional legacy parameter, use net= instead
3055#
3056# @net: #optional IP address and optional netmask
3057#
3058# @host: #optional guest-visible address of the host
3059#
3060# @tftp: #optional root directory of the built-in TFTP server
3061#
3062# @bootfile: #optional BOOTP filename, for use with tftp=
3063#
3064# @dhcpstart: #optional the first of the 16 IPs the built-in DHCP server can
3065# assign
3066#
3067# @dns: #optional guest-visible address of the virtual nameserver
3068#
63d2960b
KS
3069# @dnssearch: #optional list of DNS suffixes to search, passed as DHCP option
3070# to the guest
3071#
14aa0c2d
LE
3072# @smb: #optional root directory of the built-in SMB server
3073#
3074# @smbserver: #optional IP address of the built-in SMB server
3075#
3076# @hostfwd: #optional redirect incoming TCP or UDP host connections to guest
3077# endpoints
3078#
3079# @guestfwd: #optional forward guest TCP connections
3080#
3081# Since 1.2
3082##
3083{ 'type': 'NetdevUserOptions',
3084 'data': {
3085 '*hostname': 'str',
3086 '*restrict': 'bool',
3087 '*ip': 'str',
3088 '*net': 'str',
3089 '*host': 'str',
3090 '*tftp': 'str',
3091 '*bootfile': 'str',
3092 '*dhcpstart': 'str',
3093 '*dns': 'str',
63d2960b 3094 '*dnssearch': ['String'],
14aa0c2d
LE
3095 '*smb': 'str',
3096 '*smbserver': 'str',
3097 '*hostfwd': ['String'],
3098 '*guestfwd': ['String'] } }
3099
3100##
3101# @NetdevTapOptions
3102#
3103# Connect the host TAP network interface name to the VLAN.
3104#
3105# @ifname: #optional interface name
3106#
3107# @fd: #optional file descriptor of an already opened tap
3108#
2ca81baa
JW
3109# @fds: #optional multiple file descriptors of already opened multiqueue capable
3110# tap
3111#
14aa0c2d
LE
3112# @script: #optional script to initialize the interface
3113#
3114# @downscript: #optional script to shut down the interface
3115#
3116# @helper: #optional command to execute to configure bridge
3117#
3118# @sndbuf: #optional send buffer limit. Understands [TGMKkb] suffixes.
3119#
3120# @vnet_hdr: #optional enable the IFF_VNET_HDR flag on the tap interface
3121#
3122# @vhost: #optional enable vhost-net network accelerator
3123#
3124# @vhostfd: #optional file descriptor of an already opened vhost net device
3125#
2ca81baa
JW
3126# @vhostfds: #optional file descriptors of multiple already opened vhost net
3127# devices
3128#
14aa0c2d
LE
3129# @vhostforce: #optional vhost on for non-MSIX virtio guests
3130#
ec396014
JW
3131# @queues: #optional number of queues to be created for multiqueue capable tap
3132#
14aa0c2d
LE
3133# Since 1.2
3134##
3135{ 'type': 'NetdevTapOptions',
3136 'data': {
3137 '*ifname': 'str',
3138 '*fd': 'str',
264986e2 3139 '*fds': 'str',
14aa0c2d
LE
3140 '*script': 'str',
3141 '*downscript': 'str',
3142 '*helper': 'str',
3143 '*sndbuf': 'size',
3144 '*vnet_hdr': 'bool',
3145 '*vhost': 'bool',
3146 '*vhostfd': 'str',
264986e2
JW
3147 '*vhostfds': 'str',
3148 '*vhostforce': 'bool',
3149 '*queues': 'uint32'} }
14aa0c2d
LE
3150
3151##
3152# @NetdevSocketOptions
3153#
3154# Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP
3155# socket connection.
3156#
3157# @fd: #optional file descriptor of an already opened socket
3158#
3159# @listen: #optional port number, and optional hostname, to listen on
3160#
3161# @connect: #optional port number, and optional hostname, to connect to
3162#
3163# @mcast: #optional UDP multicast address and port number
3164#
3165# @localaddr: #optional source address and port for multicast and udp packets
3166#
3167# @udp: #optional UDP unicast address and port number
3168#
3169# Since 1.2
3170##
3171{ 'type': 'NetdevSocketOptions',
3172 'data': {
3173 '*fd': 'str',
3174 '*listen': 'str',
3175 '*connect': 'str',
3176 '*mcast': 'str',
3177 '*localaddr': 'str',
3178 '*udp': 'str' } }
3179
3180##
3181# @NetdevVdeOptions
3182#
3183# Connect the VLAN to a vde switch running on the host.
3184#
3185# @sock: #optional socket path
3186#
3187# @port: #optional port number
3188#
3189# @group: #optional group owner of socket
3190#
3191# @mode: #optional permissions for socket
3192#
3193# Since 1.2
3194##
3195{ 'type': 'NetdevVdeOptions',
3196 'data': {
3197 '*sock': 'str',
3198 '*port': 'uint16',
3199 '*group': 'str',
3200 '*mode': 'uint16' } }
3201
3202##
3203# @NetdevDumpOptions
3204#
3205# Dump VLAN network traffic to a file.
3206#
3207# @len: #optional per-packet size limit (64k default). Understands [TGMKkb]
3208# suffixes.
3209#
3210# @file: #optional dump file path (default is qemu-vlan0.pcap)
3211#
3212# Since 1.2
3213##
3214{ 'type': 'NetdevDumpOptions',
3215 'data': {
3216 '*len': 'size',
3217 '*file': 'str' } }
3218
3219##
3220# @NetdevBridgeOptions
3221#
3222# Connect a host TAP network interface to a host bridge device.
3223#
3224# @br: #optional bridge name
3225#
3226# @helper: #optional command to execute to configure bridge
3227#
3228# Since 1.2
3229##
3230{ 'type': 'NetdevBridgeOptions',
3231 'data': {
3232 '*br': 'str',
3233 '*helper': 'str' } }
3234
f6c874e3
SH
3235##
3236# @NetdevHubPortOptions
3237#
3238# Connect two or more net clients through a software hub.
3239#
3240# @hubid: hub identifier number
3241#
3242# Since 1.2
3243##
3244{ 'type': 'NetdevHubPortOptions',
3245 'data': {
3246 'hubid': 'int32' } }
3247
58952137
VM
3248##
3249# @NetdevNetmapOptions
3250#
3251# Connect a client to a netmap-enabled NIC or to a VALE switch port
3252#
3253# @ifname: Either the name of an existing network interface supported by
3254# netmap, or the name of a VALE port (created on the fly).
3255# A VALE port name is in the form 'valeXXX:YYY', where XXX and
3256# YYY are non-negative integers. XXX identifies a switch and
3257# YYY identifies a port of the switch. VALE ports having the
3258# same XXX are therefore connected to the same switch.
3259#
3260# @devname: #optional path of the netmap device (default: '/dev/netmap').
3261#
c27de2a3 3262# Since 2.0
58952137
VM
3263##
3264{ 'type': 'NetdevNetmapOptions',
3265 'data': {
3266 'ifname': 'str',
3267 '*devname': 'str' } }
3268
14aa0c2d
LE
3269##
3270# @NetClientOptions
3271#
3272# A discriminated record of network device traits.
3273#
3274# Since 1.2
3275##
3276{ 'union': 'NetClientOptions',
3277 'data': {
f6c874e3
SH
3278 'none': 'NetdevNoneOptions',
3279 'nic': 'NetLegacyNicOptions',
3280 'user': 'NetdevUserOptions',
3281 'tap': 'NetdevTapOptions',
3282 'socket': 'NetdevSocketOptions',
3283 'vde': 'NetdevVdeOptions',
3284 'dump': 'NetdevDumpOptions',
3285 'bridge': 'NetdevBridgeOptions',
58952137
VM
3286 'hubport': 'NetdevHubPortOptions',
3287 'netmap': 'NetdevNetmapOptions' } }
14aa0c2d
LE
3288
3289##
3290# @NetLegacy
3291#
3292# Captures the configuration of a network device; legacy.
3293#
3294# @vlan: #optional vlan number
3295#
3296# @id: #optional identifier for monitor commands
3297#
3298# @name: #optional identifier for monitor commands, ignored if @id is present
3299#
3300# @opts: device type specific properties (legacy)
3301#
3302# Since 1.2
3303##
3304{ 'type': 'NetLegacy',
3305 'data': {
3306 '*vlan': 'int32',
3307 '*id': 'str',
3308 '*name': 'str',
3309 'opts': 'NetClientOptions' } }
3310
3311##
3312# @Netdev
3313#
3314# Captures the configuration of a network device.
3315#
3316# @id: identifier for monitor commands.
3317#
3318# @opts: device type specific properties
3319#
3320# Since 1.2
3321##
3322{ 'type': 'Netdev',
3323 'data': {
3324 'id': 'str',
3325 'opts': 'NetClientOptions' } }
3326
5be8c759
PB
3327##
3328# @InetSocketAddress
3329#
3330# Captures a socket address or address range in the Internet namespace.
3331#
3332# @host: host part of the address
3333#
3334# @port: port part of the address, or lowest port if @to is present
3335#
3336# @to: highest port to try
3337#
3338# @ipv4: whether to accept IPv4 addresses, default try both IPv4 and IPv6
3339# #optional
3340#
3341# @ipv6: whether to accept IPv6 addresses, default try both IPv4 and IPv6
3342# #optional
3343#
3344# Since 1.3
3345##
3346{ 'type': 'InetSocketAddress',
3347 'data': {
3348 'host': 'str',
3349 'port': 'str',
3350 '*to': 'uint16',
3351 '*ipv4': 'bool',
3352 '*ipv6': 'bool' } }
3353
3354##
3355# @UnixSocketAddress
3356#
3357# Captures a socket address in the local ("Unix socket") namespace.
3358#
3359# @path: filesystem path to use
3360#
3361# Since 1.3
3362##
3363{ 'type': 'UnixSocketAddress',
3364 'data': {
3365 'path': 'str' } }
3366
3367##
3368# @SocketAddress
3369#
3370# Captures the address of a socket, which could also be a named file descriptor
3371#
3372# Since 1.3
3373##
3374{ 'union': 'SocketAddress',
3375 'data': {
3376 'inet': 'InetSocketAddress',
3377 'unix': 'UnixSocketAddress',
3378 'fd': 'String' } }
3379
208c9d1b
CB
3380##
3381# @getfd:
3382#
3383# Receive a file descriptor via SCM rights and assign it a name
3384#
3385# @fdname: file descriptor name
3386#
3387# Returns: Nothing on success
208c9d1b
CB
3388#
3389# Since: 0.14.0
3390#
3391# Notes: If @fdname already exists, the file descriptor assigned to
3392# it will be closed and replaced by the received file
3393# descriptor.
3394# The 'closefd' command can be used to explicitly close the
3395# file descriptor when it is no longer needed.
3396##
3397{ 'command': 'getfd', 'data': {'fdname': 'str'} }
3398
3399##
3400# @closefd:
3401#
3402# Close a file descriptor previously passed via SCM rights
3403#
3404# @fdname: file descriptor name
3405#
3406# Returns: Nothing on success
208c9d1b
CB
3407#
3408# Since: 0.14.0
3409##
3410{ 'command': 'closefd', 'data': {'fdname': 'str'} }
01d3c80d
AL
3411
3412##
3413# @MachineInfo:
3414#
3415# Information describing a machine.
3416#
3417# @name: the name of the machine
3418#
3419# @alias: #optional an alias for the machine name
3420#
3421# @default: #optional whether the machine is default
3422#
c72e7688
MN
3423# @cpu-max: maximum number of CPUs supported by the machine type
3424# (since 1.5.0)
3425#
01d3c80d
AL
3426# Since: 1.2.0
3427##
3428{ 'type': 'MachineInfo',
3429 'data': { 'name': 'str', '*alias': 'str',
c72e7688 3430 '*is-default': 'bool', 'cpu-max': 'int' } }
01d3c80d
AL
3431
3432##
3433# @query-machines:
3434#
3435# Return a list of supported machines
3436#
3437# Returns: a list of MachineInfo
3438#
3439# Since: 1.2.0
3440##
3441{ 'command': 'query-machines', 'returns': ['MachineInfo'] }
e4e31c63
AL
3442
3443##
3444# @CpuDefinitionInfo:
3445#
3446# Virtual CPU definition.
3447#
3448# @name: the name of the CPU definition
3449#
3450# Since: 1.2.0
3451##
3452{ 'type': 'CpuDefinitionInfo',
3453 'data': { 'name': 'str' } }
3454
3455##
3456# @query-cpu-definitions:
3457#
3458# Return a list of supported virtual CPU definitions
3459#
3460# Returns: a list of CpuDefInfo
3461#
3462# Since: 1.2.0
3463##
3464{ 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
ba1c048a
CB
3465
3466# @AddfdInfo:
3467#
3468# Information about a file descriptor that was added to an fd set.
3469#
3470# @fdset-id: The ID of the fd set that @fd was added to.
3471#
3472# @fd: The file descriptor that was received via SCM rights and
3473# added to the fd set.
3474#
3475# Since: 1.2.0
3476##
3477{ 'type': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
3478
3479##
3480# @add-fd:
3481#
3482# Add a file descriptor, that was passed via SCM rights, to an fd set.
3483#
3484# @fdset-id: #optional The ID of the fd set to add the file descriptor to.
3485#
3486# @opaque: #optional A free-form string that can be used to describe the fd.
3487#
3488# Returns: @AddfdInfo on success
3489# If file descriptor was not received, FdNotSupplied
9ac54af0 3490# If @fdset-id is a negative value, InvalidParameterValue
ba1c048a
CB
3491#
3492# Notes: The list of fd sets is shared by all monitor connections.
3493#
3494# If @fdset-id is not specified, a new fd set will be created.
3495#
3496# Since: 1.2.0
3497##
3498{ 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
3499 'returns': 'AddfdInfo' }
3500
3501##
3502# @remove-fd:
3503#
3504# Remove a file descriptor from an fd set.
3505#
3506# @fdset-id: The ID of the fd set that the file descriptor belongs to.
3507#
3508# @fd: #optional The file descriptor that is to be removed.
3509#
3510# Returns: Nothing on success
3511# If @fdset-id or @fd is not found, FdNotFound
3512#
3513# Since: 1.2.0
3514#
3515# Notes: The list of fd sets is shared by all monitor connections.
3516#
3517# If @fd is not specified, all file descriptors in @fdset-id
3518# will be removed.
3519##
3520{ 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
3521
3522##
3523# @FdsetFdInfo:
3524#
3525# Information about a file descriptor that belongs to an fd set.
3526#
3527# @fd: The file descriptor value.
3528#
3529# @opaque: #optional A free-form string that can be used to describe the fd.
3530#
3531# Since: 1.2.0
3532##
3533{ 'type': 'FdsetFdInfo',
3534 'data': {'fd': 'int', '*opaque': 'str'} }
3535
3536##
3537# @FdsetInfo:
3538#
3539# Information about an fd set.
3540#
3541# @fdset-id: The ID of the fd set.
3542#
3543# @fds: A list of file descriptors that belong to this fd set.
3544#
3545# Since: 1.2.0
3546##
3547{ 'type': 'FdsetInfo',
3548 'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
3549
3550##
3551# @query-fdsets:
3552#
3553# Return information describing all fd sets.
3554#
3555# Returns: A list of @FdsetInfo
3556#
3557# Since: 1.2.0
3558#
3559# Note: The list of fd sets is shared by all monitor connections.
3560#
3561##
3562{ 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
99afc91d 3563
99afc91d
DB
3564##
3565# @TargetInfo:
3566#
3567# Information describing the QEMU target.
3568#
3569# @arch: the target architecture (eg "x86_64", "i386", etc)
3570#
3571# Since: 1.2.0
3572##
3573{ 'type': 'TargetInfo',
c02a9552 3574 'data': { 'arch': 'str' } }
99afc91d
DB
3575
3576##
3577# @query-target:
3578#
3579# Return information about the target for this QEMU
3580#
3581# Returns: TargetInfo
3582#
3583# Since: 1.2.0
3584##
3585{ 'command': 'query-target', 'returns': 'TargetInfo' }
411656f4
AK
3586
3587##
3588# @QKeyCode:
3589#
3590# An enumeration of key name.
3591#
3592# This is used by the send-key command.
3593#
3594# Since: 1.3.0
bbd1b1cc 3595#
8b6b0c59 3596# 'unmapped' and 'pause' since 2.0
411656f4
AK
3597##
3598{ 'enum': 'QKeyCode',
bbd1b1cc
GH
3599 'data': [ 'unmapped',
3600 'shift', 'shift_r', 'alt', 'alt_r', 'altgr', 'altgr_r', 'ctrl',
411656f4
AK
3601 'ctrl_r', 'menu', 'esc', '1', '2', '3', '4', '5', '6', '7', '8',
3602 '9', '0', 'minus', 'equal', 'backspace', 'tab', 'q', 'w', 'e',
3603 'r', 't', 'y', 'u', 'i', 'o', 'p', 'bracket_left', 'bracket_right',
3604 'ret', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'semicolon',
3605 'apostrophe', 'grave_accent', 'backslash', 'z', 'x', 'c', 'v', 'b',
3606 'n', 'm', 'comma', 'dot', 'slash', 'asterisk', 'spc', 'caps_lock',
3607 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10',
3608 'num_lock', 'scroll_lock', 'kp_divide', 'kp_multiply',
3609 'kp_subtract', 'kp_add', 'kp_enter', 'kp_decimal', 'sysrq', 'kp_0',
3610 'kp_1', 'kp_2', 'kp_3', 'kp_4', 'kp_5', 'kp_6', 'kp_7', 'kp_8',
3611 'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
3612 'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
3613 'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
8b6b0c59 3614 'lf', 'help', 'meta_l', 'meta_r', 'compose', 'pause' ] }
e4c8f004 3615
9f328977
LC
3616##
3617# @KeyValue
3618#
3619# Represents a keyboard key.
3620#
3621# Since: 1.3.0
3622##
3623{ 'union': 'KeyValue',
3624 'data': {
3625 'number': 'int',
3626 'qcode': 'QKeyCode' } }
3627
e4c8f004
AK
3628##
3629# @send-key:
3630#
3631# Send keys to guest.
3632#
9f328977
LC
3633# @keys: An array of @KeyValue elements. All @KeyValues in this array are
3634# simultaneously sent to the guest. A @KeyValue.number value is sent
3635# directly to the guest, while @KeyValue.qcode must be a valid
3636# @QKeyCode value
e4c8f004
AK
3637#
3638# @hold-time: #optional time to delay key up events, milliseconds. Defaults
3639# to 100
3640#
3641# Returns: Nothing on success
3642# If key is unknown or redundant, InvalidParameter
3643#
3644# Since: 1.3.0
3645#
3646##
3647{ 'command': 'send-key',
9f328977 3648 'data': { 'keys': ['KeyValue'], '*hold-time': 'int' } }
ad39cf6d
LC
3649
3650##
3651# @screendump:
3652#
3653# Write a PPM of the VGA screen to a file.
3654#
3655# @filename: the path of a new PPM file to store the image
3656#
3657# Returns: Nothing on success
3658#
3659# Since: 0.14.0
3660##
3661{ 'command': 'screendump', 'data': {'filename': 'str'} }
6dd844db
PB
3662
3663##
3664# @nbd-server-start:
3665#
3666# Start an NBD server listening on the given host and port. Block
3667# devices can then be exported using @nbd-server-add. The NBD
3668# server will present them as named exports; for example, another
3669# QEMU instance could refer to them as "nbd:HOST:PORT:exportname=NAME".
3670#
3671# @addr: Address on which to listen.
3672#
3673# Returns: error if the server is already running.
3674#
3675# Since: 1.3.0
3676##
3677{ 'command': 'nbd-server-start',
3678 'data': { 'addr': 'SocketAddress' } }
3679
3680##
3681# @nbd-server-add:
3682#
3683# Export a device to QEMU's embedded NBD server.
3684#
3685# @device: Block device to be exported
3686#
3687# @writable: Whether clients should be able to write to the device via the
3688# NBD connection (default false). #optional
3689#
3690# Returns: error if the device is already marked for export.
3691#
3692# Since: 1.3.0
3693##
3694{ 'command': 'nbd-server-add', 'data': {'device': 'str', '*writable': 'bool'} }
3695
3696##
3697# @nbd-server-stop:
3698#
3699# Stop QEMU's embedded NBD server, and unregister all devices previously
3700# added via @nbd-server-add.
3701#
3702# Since: 1.3.0
3703##
3704{ 'command': 'nbd-server-stop' }
f1a1a356 3705
ffbdbe59
GH
3706##
3707# @ChardevFile:
3708#
3709# Configuration info for file chardevs.
3710#
3711# @in: #optional The name of the input file
3712# @out: The name of the output file
3713#
3714# Since: 1.4
3715##
3716{ 'type': 'ChardevFile', 'data': { '*in' : 'str',
3717 'out' : 'str' } }
3718
d59044ef 3719##
d36b2b90 3720# @ChardevHostdev:
d59044ef 3721#
548cbb36 3722# Configuration info for device and pipe chardevs.
d59044ef
GH
3723#
3724# @device: The name of the special file for the device,
3725# i.e. /dev/ttyS0 on Unix or COM1: on Windows
3726# @type: What kind of device this is.
3727#
3728# Since: 1.4
3729##
d36b2b90 3730{ 'type': 'ChardevHostdev', 'data': { 'device' : 'str' } }
d59044ef 3731
f6bd5d6e
GH
3732##
3733# @ChardevSocket:
3734#
3ecc059d 3735# Configuration info for (stream) socket chardevs.
f6bd5d6e
GH
3736#
3737# @addr: socket address to listen on (server=true)
3738# or connect to (server=false)
3739# @server: #optional create server socket (default: true)
ef993ba7
GH
3740# @wait: #optional wait for incoming connection on server
3741# sockets (default: false).
f6bd5d6e 3742# @nodelay: #optional set TCP_NODELAY socket option (default: false)
ef993ba7
GH
3743# @telnet: #optional enable telnet protocol on server
3744# sockets (default: false)
f6bd5d6e
GH
3745#
3746# Since: 1.4
3747##
3748{ 'type': 'ChardevSocket', 'data': { 'addr' : 'SocketAddress',
3749 '*server' : 'bool',
3750 '*wait' : 'bool',
3751 '*nodelay' : 'bool',
3752 '*telnet' : 'bool' } }
3753
3ecc059d 3754##
08d0ab3f 3755# @ChardevUdp:
3ecc059d
GH
3756#
3757# Configuration info for datagram socket chardevs.
3758#
3759# @remote: remote address
3760# @local: #optional local address
3761#
3762# Since: 1.5
3763##
08d0ab3f
LL
3764{ 'type': 'ChardevUdp', 'data': { 'remote' : 'SocketAddress',
3765 '*local' : 'SocketAddress' } }
3ecc059d 3766
edb2fb3c
GH
3767##
3768# @ChardevMux:
3769#
3770# Configuration info for mux chardevs.
3771#
3772# @chardev: name of the base chardev.
3773#
3774# Since: 1.5
3775##
3776{ 'type': 'ChardevMux', 'data': { 'chardev' : 'str' } }
3777
7c358031
GH
3778##
3779# @ChardevStdio:
3780#
3781# Configuration info for stdio chardevs.
3782#
3783# @signal: #optional Allow signals (such as SIGINT triggered by ^C)
3784# be delivered to qemu. Default: true in -nographic mode,
3785# false otherwise.
3786#
3787# Since: 1.5
3788##
3789{ 'type': 'ChardevStdio', 'data': { '*signal' : 'bool' } }
3790
cd153e2a
GH
3791##
3792# @ChardevSpiceChannel:
3793#
3794# Configuration info for spice vm channel chardevs.
3795#
3796# @type: kind of channel (for example vdagent).
3797#
3798# Since: 1.5
3799##
3800{ 'type': 'ChardevSpiceChannel', 'data': { 'type' : 'str' } }
3801
3802##
3803# @ChardevSpicePort:
3804#
3805# Configuration info for spice port chardevs.
3806#
3807# @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
3808#
3809# Since: 1.5
3810##
3811{ 'type': 'ChardevSpicePort', 'data': { 'fqdn' : 'str' } }
3812
702ec69c
GH
3813##
3814# @ChardevVC:
3815#
3816# Configuration info for virtual console chardevs.
3817#
3818# @width: console width, in pixels
3819# @height: console height, in pixels
3820# @cols: console width, in chars
3821# @rows: console height, in chars
3822#
3823# Since: 1.5
3824##
3825{ 'type': 'ChardevVC', 'data': { '*width' : 'int',
3826 '*height' : 'int',
3827 '*cols' : 'int',
3828 '*rows' : 'int' } }
3829
1da48c65 3830##
4f57378f 3831# @ChardevRingbuf:
1da48c65 3832#
3a1da42e 3833# Configuration info for ring buffer chardevs.
1da48c65 3834#
3a1da42e 3835# @size: #optional ring buffer size, must be power of two, default is 65536
1da48c65
GH
3836#
3837# Since: 1.5
3838##
4f57378f 3839{ 'type': 'ChardevRingbuf', 'data': { '*size' : 'int' } }
1da48c65 3840
f1a1a356
GH
3841##
3842# @ChardevBackend:
3843#
3844# Configuration info for the new chardev backend.
3845#
3846# Since: 1.4
3847##
3848{ 'type': 'ChardevDummy', 'data': { } }
3849
f6bd5d6e 3850{ 'union': 'ChardevBackend', 'data': { 'file' : 'ChardevFile',
d36b2b90
MA
3851 'serial' : 'ChardevHostdev',
3852 'parallel': 'ChardevHostdev',
548cbb36 3853 'pipe' : 'ChardevHostdev',
f6bd5d6e 3854 'socket' : 'ChardevSocket',
08d0ab3f 3855 'udp' : 'ChardevUdp',
0a1a7fab 3856 'pty' : 'ChardevDummy',
edb2fb3c 3857 'null' : 'ChardevDummy',
f5a51cab 3858 'mux' : 'ChardevMux',
2d57286d 3859 'msmouse': 'ChardevDummy',
7c358031 3860 'braille': 'ChardevDummy',
d9ac374f 3861 'stdio' : 'ChardevStdio',
cd153e2a
GH
3862 'console': 'ChardevDummy',
3863 'spicevmc' : 'ChardevSpiceChannel',
702ec69c 3864 'spiceport' : 'ChardevSpicePort',
1da48c65 3865 'vc' : 'ChardevVC',
3a1da42e
MA
3866 'ringbuf': 'ChardevRingbuf',
3867 # next one is just for compatibility
4f57378f 3868 'memory' : 'ChardevRingbuf' } }
f1a1a356
GH
3869
3870##
3871# @ChardevReturn:
3872#
3873# Return info about the chardev backend just created.
3874#
58fa4325
MA
3875# @pty: #optional name of the slave pseudoterminal device, present if
3876# and only if a chardev of type 'pty' was created
3877#
f1a1a356
GH
3878# Since: 1.4
3879##
0a1a7fab 3880{ 'type' : 'ChardevReturn', 'data': { '*pty' : 'str' } }
f1a1a356
GH
3881
3882##
3883# @chardev-add:
3884#
58fa4325 3885# Add a character device backend
f1a1a356
GH
3886#
3887# @id: the chardev's ID, must be unique
3888# @backend: backend type and parameters
3889#
58fa4325 3890# Returns: ChardevReturn.
f1a1a356
GH
3891#
3892# Since: 1.4
3893##
3894{ 'command': 'chardev-add', 'data': {'id' : 'str',
3895 'backend' : 'ChardevBackend' },
3896 'returns': 'ChardevReturn' }
3897
3898##
3899# @chardev-remove:
3900#
58fa4325 3901# Remove a character device backend
f1a1a356
GH
3902#
3903# @id: the chardev's ID, must exist and not be in use
3904#
3905# Returns: Nothing on success
3906#
3907# Since: 1.4
3908##
3909{ 'command': 'chardev-remove', 'data': {'id': 'str'} }
d1a0cf73
SB
3910
3911##
3912# @TpmModel:
3913#
3914# An enumeration of TPM models
3915#
3916# @tpm-tis: TPM TIS model
3917#
3918# Since: 1.5
3919##
3920{ 'enum': 'TpmModel', 'data': [ 'tpm-tis' ] }
3921
3922##
3923# @query-tpm-models:
3924#
3925# Return a list of supported TPM models
3926#
3927# Returns: a list of TpmModel
3928#
3929# Since: 1.5
3930##
3931{ 'command': 'query-tpm-models', 'returns': ['TpmModel'] }
3932
3933##
3934# @TpmType:
3935#
3936# An enumeration of TPM types
3937#
3938# @passthrough: TPM passthrough type
3939#
3940# Since: 1.5
3941##
3942{ 'enum': 'TpmType', 'data': [ 'passthrough' ] }
3943
3944##
3945# @query-tpm-types:
3946#
3947# Return a list of supported TPM types
3948#
3949# Returns: a list of TpmType
3950#
3951# Since: 1.5
3952##
3953{ 'command': 'query-tpm-types', 'returns': ['TpmType'] }
3954
3955##
3956# @TPMPassthroughOptions:
3957#
3958# Information about the TPM passthrough type
3959#
3960# @path: #optional string describing the path used for accessing the TPM device
3961#
3962# @cancel-path: #optional string showing the TPM's sysfs cancel file
3963# for cancellation of TPM commands while they are executing
3964#
3965# Since: 1.5
3966##
3967{ 'type': 'TPMPassthroughOptions', 'data': { '*path' : 'str',
3968 '*cancel-path' : 'str'} }
3969
3970##
3971# @TpmTypeOptions:
3972#
3973# A union referencing different TPM backend types' configuration options
3974#
88ca7bcf 3975# @passthrough: The configuration options for the TPM passthrough type
d1a0cf73
SB
3976#
3977# Since: 1.5
3978##
3979{ 'union': 'TpmTypeOptions',
88ca7bcf 3980 'data': { 'passthrough' : 'TPMPassthroughOptions' } }
d1a0cf73
SB
3981
3982##
3983# @TpmInfo:
3984#
3985# Information about the TPM
3986#
3987# @id: The Id of the TPM
3988#
3989# @model: The TPM frontend model
3990#
88ca7bcf 3991# @options: The TPM (backend) type configuration options
d1a0cf73
SB
3992#
3993# Since: 1.5
3994##
3995{ 'type': 'TPMInfo',
3996 'data': {'id': 'str',
3997 'model': 'TpmModel',
88ca7bcf 3998 'options': 'TpmTypeOptions' } }
d1a0cf73
SB
3999
4000##
4001# @query-tpm:
4002#
4003# Return information about the TPM device
4004#
4005# Returns: @TPMInfo on success
4006#
4007# Since: 1.5
4008##
4009{ 'command': 'query-tpm', 'returns': ['TPMInfo'] }
8ccbad5c
LE
4010
4011##
4012# @AcpiTableOptions
4013#
4014# Specify an ACPI table on the command line to load.
4015#
4016# At most one of @file and @data can be specified. The list of files specified
4017# by any one of them is loaded and concatenated in order. If both are omitted,
4018# @data is implied.
4019#
4020# Other fields / optargs can be used to override fields of the generic ACPI
4021# table header; refer to the ACPI specification 5.0, section 5.2.6 System
4022# Description Table Header. If a header field is not overridden, then the
4023# corresponding value from the concatenated blob is used (in case of @file), or
4024# it is filled in with a hard-coded value (in case of @data).
4025#
4026# String fields are copied into the matching ACPI member from lowest address
4027# upwards, and silently truncated / NUL-padded to length.
4028#
4029# @sig: #optional table signature / identifier (4 bytes)
4030#
4031# @rev: #optional table revision number (dependent on signature, 1 byte)
4032#
4033# @oem_id: #optional OEM identifier (6 bytes)
4034#
4035# @oem_table_id: #optional OEM table identifier (8 bytes)
4036#
4037# @oem_rev: #optional OEM-supplied revision number (4 bytes)
4038#
4039# @asl_compiler_id: #optional identifier of the utility that created the table
4040# (4 bytes)
4041#
4042# @asl_compiler_rev: #optional revision number of the utility that created the
4043# table (4 bytes)
4044#
4045# @file: #optional colon (:) separated list of pathnames to load and
4046# concatenate as table data. The resultant binary blob is expected to
4047# have an ACPI table header. At least one file is required. This field
4048# excludes @data.
4049#
4050# @data: #optional colon (:) separated list of pathnames to load and
4051# concatenate as table data. The resultant binary blob must not have an
4052# ACPI table header. At least one file is required. This field excludes
4053# @file.
4054#
4055# Since 1.5
4056##
4057{ 'type': 'AcpiTableOptions',
4058 'data': {
4059 '*sig': 'str',
4060 '*rev': 'uint8',
4061 '*oem_id': 'str',
4062 '*oem_table_id': 'str',
4063 '*oem_rev': 'uint32',
4064 '*asl_compiler_id': 'str',
4065 '*asl_compiler_rev': 'uint32',
4066 '*file': 'str',
4067 '*data': 'str' }}
1f8f987d
AK
4068
4069##
4070# @CommandLineParameterType:
4071#
4072# Possible types for an option parameter.
4073#
4074# @string: accepts a character string
4075#
4076# @boolean: accepts "on" or "off"
4077#
4078# @number: accepts a number
4079#
4080# @size: accepts a number followed by an optional suffix (K)ilo,
4081# (M)ega, (G)iga, (T)era
4082#
4083# Since 1.5
4084##
4085{ 'enum': 'CommandLineParameterType',
4086 'data': ['string', 'boolean', 'number', 'size'] }
4087
4088##
4089# @CommandLineParameterInfo:
4090#
4091# Details about a single parameter of a command line option.
4092#
4093# @name: parameter name
4094#
4095# @type: parameter @CommandLineParameterType
4096#
4097# @help: #optional human readable text string, not suitable for parsing.
4098#
4099# Since 1.5
4100##
4101{ 'type': 'CommandLineParameterInfo',
4102 'data': { 'name': 'str',
4103 'type': 'CommandLineParameterType',
4104 '*help': 'str' } }
4105
4106##
4107# @CommandLineOptionInfo:
4108#
4109# Details about a command line option, including its list of parameter details
4110#
4111# @option: option name
4112#
4113# @parameters: an array of @CommandLineParameterInfo
4114#
4115# Since 1.5
4116##
4117{ 'type': 'CommandLineOptionInfo',
4118 'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
4119
4120##
4121# @query-command-line-options:
4122#
4123# Query command line option schema.
4124#
4125# @option: #optional option name
4126#
4127# Returns: list of @CommandLineOptionInfo for all options (or for the given
4128# @option). Returns an error if the given @option doesn't exist.
4129#
4130# Since 1.5
4131##
4132{'command': 'query-command-line-options', 'data': { '*option': 'str' },
4133 'returns': ['CommandLineOptionInfo'] }
8e8aba50
EH
4134
4135##
4136# @X86CPURegister32
4137#
4138# A X86 32-bit register
4139#
4140# Since: 1.5
4141##
4142{ 'enum': 'X86CPURegister32',
4143 'data': [ 'EAX', 'EBX', 'ECX', 'EDX', 'ESP', 'EBP', 'ESI', 'EDI' ] }
4144
4145##
4146# @X86CPUFeatureWordInfo
4147#
4148# Information about a X86 CPU feature word
4149#
4150# @cpuid-input-eax: Input EAX value for CPUID instruction for that feature word
4151#
4152# @cpuid-input-ecx: #optional Input ECX value for CPUID instruction for that
4153# feature word
4154#
4155# @cpuid-register: Output register containing the feature bits
4156#
4157# @features: value of output register, containing the feature bits
4158#
4159# Since: 1.5
4160##
4161{ 'type': 'X86CPUFeatureWordInfo',
4162 'data': { 'cpuid-input-eax': 'int',
4163 '*cpuid-input-ecx': 'int',
4164 'cpuid-register': 'X86CPURegister32',
4165 'features': 'int' } }
b1be4280
AK
4166
4167##
4168# @RxState:
4169#
4170# Packets receiving state
4171#
4172# @normal: filter assigned packets according to the mac-table
4173#
4174# @none: don't receive any assigned packet
4175#
4176# @all: receive all assigned packets
4177#
4178# Since: 1.6
4179##
4180{ 'enum': 'RxState', 'data': [ 'normal', 'none', 'all' ] }
4181
4182##
4183# @RxFilterInfo:
4184#
4185# Rx-filter information for a NIC.
4186#
4187# @name: net client name
4188#
4189# @promiscuous: whether promiscuous mode is enabled
4190#
4191# @multicast: multicast receive state
4192#
4193# @unicast: unicast receive state
4194#
f7bc8ef8
AK
4195# @vlan: vlan receive state (Since 2.0)
4196#
b1be4280
AK
4197# @broadcast-allowed: whether to receive broadcast
4198#
4199# @multicast-overflow: multicast table is overflowed or not
4200#
4201# @unicast-overflow: unicast table is overflowed or not
4202#
4203# @main-mac: the main macaddr string
4204#
4205# @vlan-table: a list of active vlan id
4206#
4207# @unicast-table: a list of unicast macaddr string
4208#
4209# @multicast-table: a list of multicast macaddr string
4210#
4211# Since 1.6
4212##
4213
4214{ 'type': 'RxFilterInfo',
4215 'data': {
4216 'name': 'str',
4217 'promiscuous': 'bool',
4218 'multicast': 'RxState',
4219 'unicast': 'RxState',
f7bc8ef8 4220 'vlan': 'RxState',
b1be4280
AK
4221 'broadcast-allowed': 'bool',
4222 'multicast-overflow': 'bool',
4223 'unicast-overflow': 'bool',
4224 'main-mac': 'str',
4225 'vlan-table': ['int'],
4226 'unicast-table': ['str'],
4227 'multicast-table': ['str'] }}
4228
4229##
4230# @query-rx-filter:
4231#
4232# Return rx-filter information for all NICs (or for the given NIC).
4233#
4234# @name: #optional net client name
4235#
4236# Returns: list of @RxFilterInfo for all NICs (or for the given NIC).
4237# Returns an error if the given @name doesn't exist, or given
4238# NIC doesn't support rx-filter querying, or given net client
4239# isn't a NIC.
4240#
4241# Since: 1.6
4242##
4243{ 'command': 'query-rx-filter', 'data': { '*name': 'str' },
4244 'returns': ['RxFilterInfo'] }
d26c9a15
KW
4245
4246
4247##
4248# @BlockdevDiscardOptions
4249#
4250# Determines how to handle discard requests.
4251#
4252# @ignore: Ignore the request
4253# @unmap: Forward as an unmap request
4254#
4255# Since: 1.7
4256##
4257{ 'enum': 'BlockdevDiscardOptions',
4258 'data': [ 'ignore', 'unmap' ] }
4259
465bee1d
PL
4260##
4261# @BlockdevDetectZeroesOptions
4262#
4263# Describes the operation mode for the automatic conversion of plain
4264# zero writes by the OS to driver specific optimized zero write commands.
4265#
4266# @off: Disabled (default)
4267# @on: Enabled
4268# @unmap: Enabled and even try to unmap blocks if possible. This requires
4269# also that @BlockdevDiscardOptions is set to unmap for this device.
4270#
4271# Since: 2.1
4272##
4273{ 'enum': 'BlockdevDetectZeroesOptions',
4274 'data': [ 'off', 'on', 'unmap' ] }
4275
d26c9a15
KW
4276##
4277# @BlockdevAioOptions
4278#
4279# Selects the AIO backend to handle I/O requests
4280#
4281# @threads: Use qemu's thread pool
4282# @native: Use native AIO backend (only Linux and Windows)
4283#
4284# Since: 1.7
4285##
4286{ 'enum': 'BlockdevAioOptions',
4287 'data': [ 'threads', 'native' ] }
4288
4289##
4290# @BlockdevCacheOptions
4291#
4292# Includes cache-related options for block devices
4293#
4294# @writeback: #optional enables writeback mode for any caches (default: true)
4295# @direct: #optional enables use of O_DIRECT (bypass the host page cache;
4296# default: false)
4297# @no-flush: #optional ignore any flush requests for the device (default:
4298# false)
4299#
4300# Since: 1.7
4301##
4302{ 'type': 'BlockdevCacheOptions',
4303 'data': { '*writeback': 'bool',
4304 '*direct': 'bool',
4305 '*no-flush': 'bool' } }
4306
59ca664e
WX
4307##
4308# @BlockdevDriver
4309#
4310# Drivers that are supported in block device operations.
4311#
a28315eb
KW
4312# @host_device, @host_cdrom, @host_floppy: Since 2.1
4313#
59ca664e
WX
4314# Since: 2.0
4315##
4316{ 'enum': 'BlockdevDriver',
a28315eb
KW
4317 'data': [ 'file', 'host_device', 'host_cdrom', 'host_floppy',
4318 'http', 'https', 'ftp', 'ftps', 'tftp', 'vvfat', 'blkdebug',
59ca664e
WX
4319 'blkverify', 'bochs', 'cloop', 'cow', 'dmg', 'parallels', 'qcow',
4320 'qcow2', 'qed', 'raw', 'vdi', 'vhdx', 'vmdk', 'vpc', 'quorum' ] }
4321
d26c9a15
KW
4322##
4323# @BlockdevOptionsBase
4324#
4325# Options that are available for all block devices, independent of the block
4326# driver.
4327#
465bee1d
PL
4328# @driver: block driver name
4329# @id: #optional id by which the new block device can be referred to.
4330# This is a required option on the top level of blockdev-add, and
4331# currently not allowed on any other level.
4332# @node-name: #optional the name of a block driver state node (Since 2.0)
4333# @discard: #optional discard-related options (default: ignore)
4334# @cache: #optional cache-related options
4335# @aio: #optional AIO backend (default: threads)
4336# @rerror: #optional how to handle read errors on the device
4337# (default: report)
4338# @werror: #optional how to handle write errors on the device
4339# (default: enospc)
4340# @read-only: #optional whether the block device should be read-only
4341# (default: false)
4342# @detect-zeroes: #optional detect and optimize zero writes (Since 2.1)
4343# (default: off)
d26c9a15
KW
4344#
4345# Since: 1.7
4346##
4347{ 'type': 'BlockdevOptionsBase',
59ca664e 4348 'data': { 'driver': 'BlockdevDriver',
d26c9a15 4349 '*id': 'str',
6913c0c2 4350 '*node-name': 'str',
d26c9a15
KW
4351 '*discard': 'BlockdevDiscardOptions',
4352 '*cache': 'BlockdevCacheOptions',
4353 '*aio': 'BlockdevAioOptions',
4354 '*rerror': 'BlockdevOnError',
4355 '*werror': 'BlockdevOnError',
465bee1d
PL
4356 '*read-only': 'bool',
4357 '*detect-zeroes': 'BlockdevDetectZeroesOptions' } }
d26c9a15
KW
4358
4359##
4360# @BlockdevOptionsFile
4361#
4362# Driver specific block device options for the file backend and similar
4363# protocols.
4364#
4365# @filename: path to the image file
4366#
4367# Since: 1.7
4368##
4369{ 'type': 'BlockdevOptionsFile',
4370 'data': { 'filename': 'str' } }
4371
4372##
4373# @BlockdevOptionsVVFAT
4374#
4375# Driver specific block device options for the vvfat protocol.
4376#
4377# @dir: directory to be exported as FAT image
4378# @fat-type: #optional FAT type: 12, 16 or 32
4379# @floppy: #optional whether to export a floppy image (true) or
4380# partitioned hard disk (false; default)
4381# @rw: #optional whether to allow write operations (default: false)
4382#
4383# Since: 1.7
4384##
4385{ 'type': 'BlockdevOptionsVVFAT',
4386 'data': { 'dir': 'str', '*fat-type': 'int', '*floppy': 'bool',
4387 '*rw': 'bool' } }
4388
4389##
4390# @BlockdevOptionsGenericFormat
4391#
4392# Driver specific block device options for image format that have no option
4393# besides their data source.
4394#
4395# @file: reference to or definition of the data source block device
4396#
4397# Since: 1.7
4398##
4399{ 'type': 'BlockdevOptionsGenericFormat',
4400 'data': { 'file': 'BlockdevRef' } }
4401
4402##
4403# @BlockdevOptionsGenericCOWFormat
4404#
4405# Driver specific block device options for image format that have no option
4406# besides their data source and an optional backing file.
4407#
4408# @backing: #optional reference to or definition of the backing file block
4409# device (if missing, taken from the image file content). It is
4410# allowed to pass an empty string here in order to disable the
4411# default backing file.
4412#
4413# Since: 1.7
4414##
4415{ 'type': 'BlockdevOptionsGenericCOWFormat',
4416 'base': 'BlockdevOptionsGenericFormat',
4417 'data': { '*backing': 'BlockdevRef' } }
4418
4419##
4420# @BlockdevOptionsQcow2
4421#
4422# Driver specific block device options for qcow2.
4423#
4424# @lazy-refcounts: #optional whether to enable the lazy refcounts
4425# feature (default is taken from the image file)
4426#
4427# @pass-discard-request: #optional whether discard requests to the qcow2
4428# device should be forwarded to the data source
4429#
4430# @pass-discard-snapshot: #optional whether discard requests for the data source
4431# should be issued when a snapshot operation (e.g.
4432# deleting a snapshot) frees clusters in the qcow2 file
4433#
4434# @pass-discard-other: #optional whether discard requests for the data source
4435# should be issued on other occasions where a cluster
4436# gets freed
4437#
4438# Since: 1.7
4439##
4440{ 'type': 'BlockdevOptionsQcow2',
4441 'base': 'BlockdevOptionsGenericCOWFormat',
4442 'data': { '*lazy-refcounts': 'bool',
4443 '*pass-discard-request': 'bool',
4444 '*pass-discard-snapshot': 'bool',
4445 '*pass-discard-other': 'bool' } }
4446
1bf20b82
HR
4447##
4448# @BlkdebugEvent
4449#
4450# Trigger events supported by blkdebug.
4451##
4452{ 'enum': 'BlkdebugEvent',
4453 'data': [ 'l1_update', 'l1_grow.alloc_table', 'l1_grow.write_table',
4454 'l1_grow.activate_table', 'l2_load', 'l2_update',
4455 'l2_update_compressed', 'l2_alloc.cow_read', 'l2_alloc.write',
4456 'read_aio', 'read_backing_aio', 'read_compressed', 'write_aio',
4457 'write_compressed', 'vmstate_load', 'vmstate_save', 'cow_read',
4458 'cow_write', 'reftable_load', 'reftable_grow', 'reftable_update',
4459 'refblock_load', 'refblock_update', 'refblock_update_part',
4460 'refblock_alloc', 'refblock_alloc.hookup', 'refblock_alloc.write',
4461 'refblock_alloc.write_blocks', 'refblock_alloc.write_table',
4462 'refblock_alloc.switch_table', 'cluster_alloc',
4463 'cluster_alloc_bytes', 'cluster_free', 'flush_to_os',
4464 'flush_to_disk' ] }
4465
4466##
4467# @BlkdebugInjectErrorOptions
4468#
4469# Describes a single error injection for blkdebug.
4470#
4471# @event: trigger event
4472#
4473# @state: #optional the state identifier blkdebug needs to be in to
4474# actually trigger the event; defaults to "any"
4475#
4476# @errno: #optional error identifier (errno) to be returned; defaults to
4477# EIO
4478#
4479# @sector: #optional specifies the sector index which has to be affected
4480# in order to actually trigger the event; defaults to "any
4481# sector"
4482#
4483# @once: #optional disables further events after this one has been
4484# triggered; defaults to false
4485#
4486# @immediately: #optional fail immediately; defaults to false
4487#
4488# Since: 2.0
4489##
4490{ 'type': 'BlkdebugInjectErrorOptions',
4491 'data': { 'event': 'BlkdebugEvent',
4492 '*state': 'int',
4493 '*errno': 'int',
4494 '*sector': 'int',
4495 '*once': 'bool',
4496 '*immediately': 'bool' } }
4497
4498##
4499# @BlkdebugSetStateOptions
4500#
4501# Describes a single state-change event for blkdebug.
4502#
4503# @event: trigger event
4504#
4505# @state: #optional the current state identifier blkdebug needs to be in;
4506# defaults to "any"
4507#
4508# @new_state: the state identifier blkdebug is supposed to assume if
4509# this event is triggered
4510#
4511# Since: 2.0
4512##
4513{ 'type': 'BlkdebugSetStateOptions',
4514 'data': { 'event': 'BlkdebugEvent',
4515 '*state': 'int',
4516 'new_state': 'int' } }
4517
4518##
4519# @BlockdevOptionsBlkdebug
4520#
4521# Driver specific block device options for blkdebug.
4522#
4523# @image: underlying raw block device (or image file)
4524#
4525# @config: #optional filename of the configuration file
4526#
b35ee7fb
KW
4527# @align: #optional required alignment for requests in bytes
4528#
1bf20b82
HR
4529# @inject-error: #optional array of error injection descriptions
4530#
4531# @set-state: #optional array of state-change descriptions
4532#
4533# Since: 2.0
4534##
4535{ 'type': 'BlockdevOptionsBlkdebug',
4536 'data': { 'image': 'BlockdevRef',
4537 '*config': 'str',
b35ee7fb 4538 '*align': 'int',
1bf20b82
HR
4539 '*inject-error': ['BlkdebugInjectErrorOptions'],
4540 '*set-state': ['BlkdebugSetStateOptions'] } }
4541
4542##
4543# @BlockdevOptionsBlkverify
4544#
4545# Driver specific block device options for blkverify.
4546#
4547# @test: block device to be tested
4548#
4549# @raw: raw image used for verification
4550#
4551# Since: 2.0
4552##
4553{ 'type': 'BlockdevOptionsBlkverify',
4554 'data': { 'test': 'BlockdevRef',
4555 'raw': 'BlockdevRef' } }
4556
c88a1de5
BC
4557##
4558# @BlockdevOptionsQuorum
4559#
4560# Driver specific block device options for Quorum
4561#
4562# @blkverify: #optional true if the driver must print content mismatch
a9e6a0cb 4563# set to false by default
c88a1de5 4564#
a9e6a0cb 4565# @children: the children block devices to use
c88a1de5 4566#
a9e6a0cb 4567# @vote-threshold: the vote limit under which a read will fail
c88a1de5
BC
4568#
4569# Since: 2.0
4570##
4571{ 'type': 'BlockdevOptionsQuorum',
4572 'data': { '*blkverify': 'bool',
4573 'children': [ 'BlockdevRef' ],
4574 'vote-threshold': 'int' } }
4575
d26c9a15
KW
4576##
4577# @BlockdevOptions
4578#
4579# Options for creating a block device.
4580#
4581# Since: 1.7
4582##
4583{ 'union': 'BlockdevOptions',
4584 'base': 'BlockdevOptionsBase',
4585 'discriminator': 'driver',
4586 'data': {
4587 'file': 'BlockdevOptionsFile',
a28315eb
KW
4588 'host_device':'BlockdevOptionsFile',
4589 'host_cdrom': 'BlockdevOptionsFile',
4590 'host_floppy':'BlockdevOptionsFile',
d26c9a15
KW
4591 'http': 'BlockdevOptionsFile',
4592 'https': 'BlockdevOptionsFile',
4593 'ftp': 'BlockdevOptionsFile',
4594 'ftps': 'BlockdevOptionsFile',
4595 'tftp': 'BlockdevOptionsFile',
4596# TODO gluster: Wait for structured options
4597# TODO iscsi: Wait for structured options
4598# TODO nbd: Should take InetSocketAddress for 'host'?
6542aa9c 4599# TODO nfs: Wait for structured options
d26c9a15
KW
4600# TODO rbd: Wait for structured options
4601# TODO sheepdog: Wait for structured options
4602# TODO ssh: Should take InetSocketAddress for 'host'?
4603 'vvfat': 'BlockdevOptionsVVFAT',
1bf20b82
HR
4604 'blkdebug': 'BlockdevOptionsBlkdebug',
4605 'blkverify': 'BlockdevOptionsBlkverify',
d26c9a15
KW
4606 'bochs': 'BlockdevOptionsGenericFormat',
4607 'cloop': 'BlockdevOptionsGenericFormat',
4608 'cow': 'BlockdevOptionsGenericCOWFormat',
4609 'dmg': 'BlockdevOptionsGenericFormat',
4610 'parallels': 'BlockdevOptionsGenericFormat',
4611 'qcow': 'BlockdevOptionsGenericCOWFormat',
4612 'qcow2': 'BlockdevOptionsQcow2',
4613 'qed': 'BlockdevOptionsGenericCOWFormat',
4614 'raw': 'BlockdevOptionsGenericFormat',
4615 'vdi': 'BlockdevOptionsGenericFormat',
4616 'vhdx': 'BlockdevOptionsGenericFormat',
4617 'vmdk': 'BlockdevOptionsGenericCOWFormat',
c88a1de5
BC
4618 'vpc': 'BlockdevOptionsGenericFormat',
4619 'quorum': 'BlockdevOptionsQuorum'
d26c9a15
KW
4620 } }
4621
4622##
4623# @BlockdevRef
4624#
4625# Reference to a block device.
4626#
4627# @definition: defines a new block device inline
4628# @reference: references the ID of an existing block device. An
4629# empty string means that no block device should be
4630# referenced.
4631#
4632# Since: 1.7
4633##
4634{ 'union': 'BlockdevRef',
4635 'discriminator': {},
4636 'data': { 'definition': 'BlockdevOptions',
4637 'reference': 'str' } }
4638
4639##
4640# @blockdev-add:
4641#
4642# Creates a new block device.
4643#
4644# @options: block device options for the new device
4645#
4646# Since: 1.7
4647##
4648{ 'command': 'blockdev-add', 'data': { 'options': 'BlockdevOptions' } }
031fa964
GH
4649
4650##
4651# @InputButton
4652#
4653# Button of a pointer input device (mouse, tablet).
4654#
4655# Since: 2.0
4656##
4657{ 'enum' : 'InputButton',
4658 'data' : [ 'Left', 'Middle', 'Right', 'WheelUp', 'WheelDown' ] }
4659
4660##
4661# @InputButton
4662#
4663# Position axis of a pointer input device (mouse, tablet).
4664#
4665# Since: 2.0
4666##
4667{ 'enum' : 'InputAxis',
4668 'data' : [ 'X', 'Y' ] }
4669
4670##
4671# @InputKeyEvent
4672#
4673# Keyboard input event.
4674#
4675# @key: Which key this event is for.
4676# @down: True for key-down and false for key-up events.
4677#
4678# Since: 2.0
4679##
4680{ 'type' : 'InputKeyEvent',
4681 'data' : { 'key' : 'KeyValue',
4682 'down' : 'bool' } }
4683
4684##
4685# @InputBtnEvent
4686#
4687# Pointer button input event.
4688#
4689# @button: Which button this event is for.
4690# @down: True for key-down and false for key-up events.
4691#
4692# Since: 2.0
4693##
4694{ 'type' : 'InputBtnEvent',
4695 'data' : { 'button' : 'InputButton',
4696 'down' : 'bool' } }
4697
4698##
4699# @InputMoveEvent
4700#
4701# Pointer motion input event.
4702#
4703# @axis: Which axis is referenced by @value.
4704# @value: Pointer position. For absolute coordinates the
4705# valid range is 0 -> 0x7ffff
4706#
4707# Since: 2.0
4708##
4709{ 'type' : 'InputMoveEvent',
4710 'data' : { 'axis' : 'InputAxis',
4711 'value' : 'int' } }
4712
4713##
4714# @InputEvent
4715#
4716# Input event union.
4717#
4718# Since: 2.0
4719##
4720{ 'union' : 'InputEvent',
4721 'data' : { 'key' : 'InputKeyEvent',
4722 'btn' : 'InputBtnEvent',
4723 'rel' : 'InputMoveEvent',
4724 'abs' : 'InputMoveEvent' } }