]> git.proxmox.com Git - qemu.git/blame - qapi-schema.json
qdev: Report errors collected during device realization
[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
b224e5e2
LC
31##
32# @add_client
33#
34# Allow client connections for VNC, Spice and socket based
35# character devices to be passed in to QEMU via SCM_RIGHTS.
36#
37# @protocol: protocol name. Valid names are "vnc", "spice" or the
38# name of a character device (eg. from -chardev id=XXXX)
39#
40# @fdname: file descriptor name previously passed via 'getfd' command
41#
42# @skipauth: #optional whether to skip authentication. Only applies
43# to "vnc" and "spice" protocols
44#
45# @tls: #optional whether to perform TLS. Only applies to the "spice"
46# protocol
47#
48# Returns: nothing on success.
49#
50# Since: 0.14.0
51##
52{ 'command': 'add_client',
53 'data': { 'protocol': 'str', 'fdname': 'str', '*skipauth': 'bool',
54 '*tls': 'bool' } }
55
48a32bed
AL
56##
57# @NameInfo:
58#
59# Guest name information.
60#
61# @name: #optional The name of the guest
62#
63# Since 0.14.0
64##
65{ 'type': 'NameInfo', 'data': {'*name': 'str'} }
66
67##
68# @query-name:
69#
70# Return the name information of a guest.
71#
72# Returns: @NameInfo of the guest
73#
74# Since 0.14.0
75##
76{ 'command': 'query-name', 'returns': 'NameInfo' }
b9c15f16
LC
77
78##
79# @VersionInfo:
80#
81# A description of QEMU's version.
82#
83# @qemu.major: The major version of QEMU
84#
85# @qemu.minor: The minor version of QEMU
86#
87# @qemu.micro: The micro version of QEMU. By current convention, a micro
88# version of 50 signifies a development branch. A micro version
89# greater than or equal to 90 signifies a release candidate for
90# the next minor version. A micro version of less than 50
91# signifies a stable release.
92#
93# @package: QEMU will always set this field to an empty string. Downstream
94# versions of QEMU should set this to a non-empty string. The
95# exact format depends on the downstream however it highly
96# recommended that a unique name is used.
97#
98# Since: 0.14.0
99##
100{ 'type': 'VersionInfo',
101 'data': {'qemu': {'major': 'int', 'minor': 'int', 'micro': 'int'},
102 'package': 'str'} }
103
104##
105# @query-version:
106#
107# Returns the current version of QEMU.
108#
109# Returns: A @VersionInfo object describing the current version of QEMU.
110#
111# Since: 0.14.0
112##
113{ 'command': 'query-version', 'returns': 'VersionInfo' }
292a2602
LC
114
115##
116# @KvmInfo:
117#
118# Information about support for KVM acceleration
119#
120# @enabled: true if KVM acceleration is active
121#
122# @present: true if KVM acceleration is built into this executable
123#
124# Since: 0.14.0
125##
126{ 'type': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
127
128##
129# @query-kvm:
130#
131# Returns information about KVM acceleration
132#
133# Returns: @KvmInfo
134#
135# Since: 0.14.0
136##
137{ 'command': 'query-kvm', 'returns': 'KvmInfo' }
138
1fa9a5e4
LC
139##
140# @RunState
141#
6932a69b 142# An enumeration of VM run states.
1fa9a5e4
LC
143#
144# @debug: QEMU is running on a debugger
145#
0a24c7b1
LC
146# @finish-migrate: guest is paused to finish the migration process
147#
1e998146
PB
148# @inmigrate: guest is paused waiting for an incoming migration. Note
149# that this state does not tell whether the machine will start at the
150# end of the migration. This depends on the command-line -S option and
151# any invocation of 'stop' or 'cont' that has happened since QEMU was
152# started.
1fa9a5e4
LC
153#
154# @internal-error: An internal error that prevents further guest execution
155# has occurred
156#
157# @io-error: the last IOP has failed and the device is configured to pause
158# on I/O errors
159#
160# @paused: guest has been paused via the 'stop' command
161#
162# @postmigrate: guest is paused following a successful 'migrate'
163#
164# @prelaunch: QEMU was started with -S and guest has not started
165#
1fa9a5e4
LC
166# @restore-vm: guest is paused to restore VM state
167#
168# @running: guest is actively running
169#
170# @save-vm: guest is paused to save the VM state
171#
172# @shutdown: guest is shut down (and -no-shutdown is in use)
173#
ad02b96a
LC
174# @suspended: guest is suspended (ACPI S3)
175#
1fa9a5e4
LC
176# @watchdog: the watchdog action is configured to pause and has been triggered
177##
178{ 'enum': 'RunState',
179 'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused',
180 'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm',
ad02b96a 181 'running', 'save-vm', 'shutdown', 'suspended', 'watchdog' ] }
1fa9a5e4 182
c249ee68
BC
183##
184# @SnapshotInfo
185#
186# @id: unique snapshot id
187#
188# @name: user chosen name
189#
190# @vm-state-size: size of the VM state
191#
192# @date-sec: UTC date of the snapshot in seconds
193#
194# @date-nsec: fractional part in nano seconds to be used with date-sec
195#
196# @vm-clock-sec: VM clock relative to boot in seconds
197#
198# @vm-clock-nsec: fractional part in nano seconds to be used with vm-clock-sec
199#
200# Since: 1.3
201#
202##
203
204{ 'type': 'SnapshotInfo',
205 'data': { 'id': 'str', 'name': 'str', 'vm-state-size': 'int',
206 'date-sec': 'int', 'date-nsec': 'int',
207 'vm-clock-sec': 'int', 'vm-clock-nsec': 'int' } }
208
209##
210# @ImageInfo:
211#
212# Information about a QEMU image file
213#
214# @filename: name of the image file
215#
216# @format: format of the image file
217#
218# @virtual-size: maximum capacity in bytes of the image
219#
220# @actual-size: #optional actual size on disk in bytes of the image
221#
222# @dirty-flag: #optional true if image is not cleanly closed
223#
224# @cluster-size: #optional size of a cluster in bytes
225#
226# @encrypted: #optional true if the image is encrypted
227#
228# @backing-filename: #optional name of the backing file
229#
230# @full-backing-filename: #optional full path of the backing file
231#
232# @backing-filename-format: #optional the format of the backing file
233#
234# @snapshots: #optional list of VM snapshots
235#
236# Since: 1.3
237#
238##
239
240{ 'type': 'ImageInfo',
241 'data': {'filename': 'str', 'format': 'str', '*dirty-flag': 'bool',
242 '*actual-size': 'int', 'virtual-size': 'int',
243 '*cluster-size': 'int', '*encrypted': 'bool',
244 '*backing-filename': 'str', '*full-backing-filename': 'str',
245 '*backing-filename-format': 'str', '*snapshots': ['SnapshotInfo'] } }
246
8599ea4c
FS
247##
248# @ImageCheck:
249#
250# Information about a QEMU image file check
251#
252# @filename: name of the image file checked
253#
254# @format: format of the image file checked
255#
256# @check-errors: number of unexpected errors occurred during check
257#
258# @image-end-offset: #optional offset (in bytes) where the image ends, this
259# field is present if the driver for the image format
260# supports it
261#
262# @corruptions: #optional number of corruptions found during the check if any
263#
264# @leaks: #optional number of leaks found during the check if any
265#
266# @corruptions-fixed: #optional number of corruptions fixed during the check
267# if any
268#
269# @leaks-fixed: #optional number of leaks fixed during the check if any
270#
271# @total-clusters: #optional total number of clusters, this field is present
272# if the driver for the image format supports it
273#
274# @allocated-clusters: #optional total number of allocated clusters, this
275# field is present if the driver for the image format
276# supports it
277#
278# @fragmented-clusters: #optional total number of fragmented clusters, this
279# field is present if the driver for the image format
280# supports it
281#
e6439d78
SH
282# @compressed-clusters: #optional total number of compressed clusters, this
283# field is present if the driver for the image format
284# supports it
285#
8599ea4c
FS
286# Since: 1.4
287#
288##
289
290{ 'type': 'ImageCheck',
291 'data': {'filename': 'str', 'format': 'str', 'check-errors': 'int',
292 '*image-end-offset': 'int', '*corruptions': 'int', '*leaks': 'int',
293 '*corruptions-fixed': 'int', '*leaks-fixed': 'int',
294 '*total-clusters': 'int', '*allocated-clusters': 'int',
e6439d78 295 '*fragmented-clusters': 'int', '*compressed-clusters': 'int' } }
8599ea4c 296
1fa9a5e4
LC
297##
298# @StatusInfo:
299#
300# Information about VCPU run state
301#
302# @running: true if all VCPUs are runnable, false if not runnable
303#
304# @singlestep: true if VCPUs are in single-step mode
305#
306# @status: the virtual machine @RunState
307#
308# Since: 0.14.0
309#
310# Notes: @singlestep is enabled through the GDB stub
311##
312{ 'type': 'StatusInfo',
313 'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
314
315##
316# @query-status:
317#
318# Query the run status of all VCPUs
319#
320# Returns: @StatusInfo reflecting all VCPUs
321#
322# Since: 0.14.0
323##
324{ 'command': 'query-status', 'returns': 'StatusInfo' }
325
efab767e
LC
326##
327# @UuidInfo:
328#
329# Guest UUID information.
330#
331# @UUID: the UUID of the guest
332#
333# Since: 0.14.0
334#
335# Notes: If no UUID was specified for the guest, a null UUID is returned.
336##
337{ 'type': 'UuidInfo', 'data': {'UUID': 'str'} }
338
339##
340# @query-uuid:
341#
342# Query the guest UUID information.
343#
344# Returns: The @UuidInfo for the guest
345#
346# Since 0.14.0
347##
348{ 'command': 'query-uuid', 'returns': 'UuidInfo' }
349
c5a415a0
LC
350##
351# @ChardevInfo:
352#
353# Information about a character device.
354#
355# @label: the label of the character device
356#
357# @filename: the filename of the character device
358#
359# Notes: @filename is encoded using the QEMU command line character device
360# encoding. See the QEMU man page for details.
361#
362# Since: 0.14.0
363##
364{ 'type': 'ChardevInfo', 'data': {'label': 'str', 'filename': 'str'} }
365
366##
367# @query-chardev:
368#
369# Returns information about current character devices.
370#
371# Returns: a list of @ChardevInfo
372#
373# Since: 0.14.0
374##
375{ 'command': 'query-chardev', 'returns': ['ChardevInfo'] }
aa9b79bc 376
1f590cf9
LL
377##
378# @DataFormat:
379#
380# An enumeration of data format.
381#
3949e594 382# @utf8: Data is a UTF-8 string (RFC 3629)
1f590cf9 383#
3949e594 384# @base64: Data is Base64 encoded binary (RFC 3548)
1f590cf9
LL
385#
386# Since: 1.4
387##
388{ 'enum': 'DataFormat'
389 'data': [ 'utf8', 'base64' ] }
390
391##
3949e594 392# @ringbuf-write:
1f590cf9 393#
3949e594 394# Write to a ring buffer character device.
1f590cf9 395#
3949e594 396# @device: the ring buffer character device name
1f590cf9 397#
3949e594 398# @data: data to write
1f590cf9 399#
3949e594
MA
400# @format: #optional data encoding (default 'utf8').
401# - base64: data must be base64 encoded text. Its binary
402# decoding gets written.
403# Bug: invalid base64 is currently not rejected.
404# Whitespace *is* invalid.
405# - utf8: data's UTF-8 encoding is written
406# - data itself is always Unicode regardless of format, like
407# any other string.
1f590cf9
LL
408#
409# Returns: Nothing on success
1f590cf9
LL
410#
411# Since: 1.4
412##
3949e594 413{ 'command': 'ringbuf-write',
82e59a67 414 'data': {'device': 'str', 'data': 'str',
1f590cf9
LL
415 '*format': 'DataFormat'} }
416
49b6d722 417##
3949e594 418# @ringbuf-read:
49b6d722 419#
3949e594 420# Read from a ring buffer character device.
49b6d722 421#
3949e594 422# @device: the ring buffer character device name
49b6d722 423#
3949e594 424# @size: how many bytes to read at most
49b6d722 425#
3949e594
MA
426# @format: #optional data encoding (default 'utf8').
427# - base64: the data read is returned in base64 encoding.
428# - utf8: the data read is interpreted as UTF-8.
429# Bug: can screw up when the buffer contains invalid UTF-8
430# sequences, NUL characters, after the ring buffer lost
431# data, and when reading stops because the size limit is
432# reached.
433# - The return value is always Unicode regardless of format,
434# like any other string.
49b6d722 435#
3ab651fc 436# Returns: data read from the device
49b6d722
LL
437#
438# Since: 1.4
439##
3949e594 440{ 'command': 'ringbuf-read',
49b6d722 441 'data': {'device': 'str', 'size': 'int', '*format': 'DataFormat'},
3ab651fc 442 'returns': 'str' }
49b6d722 443
aa9b79bc
LC
444##
445# @CommandInfo:
446#
447# Information about a QMP command
448#
449# @name: The command name
450#
451# Since: 0.14.0
452##
453{ 'type': 'CommandInfo', 'data': {'name': 'str'} }
454
455##
456# @query-commands:
457#
458# Return a list of supported QMP commands by this server
459#
460# Returns: A list of @CommandInfo for all supported commands
461#
462# Since: 0.14.0
463##
464{ 'command': 'query-commands', 'returns': ['CommandInfo'] }
465
4860853d
DB
466##
467# @EventInfo:
468#
469# Information about a QMP event
470#
471# @name: The event name
472#
473# Since: 1.2.0
474##
475{ 'type': 'EventInfo', 'data': {'name': 'str'} }
476
477##
478# @query-events:
479#
480# Return a list of supported QMP events by this server
481#
482# Returns: A list of @EventInfo for all supported events
483#
484# Since: 1.2.0
485##
486{ 'command': 'query-events', 'returns': ['EventInfo'] }
487
791e7c82
LC
488##
489# @MigrationStats
490#
491# Detailed migration status.
492#
493# @transferred: amount of bytes already transferred to the target VM
494#
495# @remaining: amount of bytes remaining to be transferred to the target VM
496#
497# @total: total amount of bytes involved in the migration process
498#
f1c72795
PL
499# @duplicate: number of duplicate (zero) pages (since 1.2)
500#
501# @skipped: number of skipped zero pages (since 1.5)
004d4c10
OW
502#
503# @normal : number of normal pages (since 1.2)
504#
8d017193
JQ
505# @normal-bytes: number of normal bytes sent (since 1.2)
506#
507# @dirty-pages-rate: number of pages dirtied by second by the
508# guest (since 1.3)
004d4c10
OW
509#
510# Since: 0.14.0
791e7c82
LC
511##
512{ 'type': 'MigrationStats',
d5f8a570 513 'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
f1c72795
PL
514 'duplicate': 'int', 'skipped': 'int', 'normal': 'int',
515 'normal-bytes': 'int', 'dirty-pages-rate' : 'int' } }
791e7c82 516
f36d55af
OW
517##
518# @XBZRLECacheStats
519#
520# Detailed XBZRLE migration cache statistics
521#
522# @cache-size: XBZRLE cache size
523#
524# @bytes: amount of bytes already transferred to the target VM
525#
526# @pages: amount of pages transferred to the target VM
527#
528# @cache-miss: number of cache miss
529#
530# @overflow: number of overflows
531#
532# Since: 1.2
533##
534{ 'type': 'XBZRLECacheStats',
535 'data': {'cache-size': 'int', 'bytes': 'int', 'pages': 'int',
536 'cache-miss': 'int', 'overflow': 'int' } }
537
791e7c82
LC
538##
539# @MigrationInfo
540#
541# Information about current migration process.
542#
543# @status: #optional string describing the current migration status.
544# As of 0.14.0 this can be 'active', 'completed', 'failed' or
545# 'cancelled'. If this field is not returned, no migration process
546# has been initiated
547#
d5f8a570
JQ
548# @ram: #optional @MigrationStats containing detailed migration
549# status, only returned if status is 'active' or
550# 'completed'. 'comppleted' (since 1.2)
791e7c82
LC
551#
552# @disk: #optional @MigrationStats containing detailed disk migration
553# status, only returned if status is 'active' and it is a block
554# migration
555#
f36d55af
OW
556# @xbzrle-cache: #optional @XBZRLECacheStats containing detailed XBZRLE
557# migration statistics, only returned if XBZRLE feature is on and
558# status is 'active' or 'completed' (since 1.2)
559#
7aa939af
JQ
560# @total-time: #optional total amount of milliseconds since migration started.
561# If migration has ended, it returns the total migration
562# time. (since 1.2)
563#
9c5a9fcf
JQ
564# @downtime: #optional only present when migration finishes correctly
565# total downtime in milliseconds for the guest.
566# (since 1.3)
567#
2c52ddf1
JQ
568# @expected-downtime: #optional only present while migration is active
569# expected downtime in milliseconds for the guest in last walk
570# of the dirty bitmap. (since 1.3)
571#
791e7c82
LC
572# Since: 0.14.0
573##
574{ 'type': 'MigrationInfo',
575 'data': {'*status': 'str', '*ram': 'MigrationStats',
f36d55af 576 '*disk': 'MigrationStats',
7aa939af 577 '*xbzrle-cache': 'XBZRLECacheStats',
9c5a9fcf 578 '*total-time': 'int',
2c52ddf1 579 '*expected-downtime': 'int',
9c5a9fcf 580 '*downtime': 'int'} }
791e7c82
LC
581
582##
583# @query-migrate
584#
585# Returns information about current migration process.
586#
587# Returns: @MigrationInfo
588#
589# Since: 0.14.0
590##
591{ 'command': 'query-migrate', 'returns': 'MigrationInfo' }
592
bbf6da32
OW
593##
594# @MigrationCapability
595#
596# Migration capabilities enumeration
597#
598# @xbzrle: Migration supports xbzrle (Xor Based Zero Run Length Encoding).
599# This feature allows us to minimize migration traffic for certain work
600# loads, by sending compressed difference of the pages
601#
602# Since: 1.2
603##
604{ 'enum': 'MigrationCapability',
605 'data': ['xbzrle'] }
606
607##
608# @MigrationCapabilityStatus
609#
610# Migration capability information
611#
612# @capability: capability enum
613#
614# @state: capability state bool
615#
616# Since: 1.2
617##
618{ 'type': 'MigrationCapabilityStatus',
619 'data': { 'capability' : 'MigrationCapability', 'state' : 'bool' } }
620
621##
00458433
OW
622# @migrate-set-capabilities
623#
624# Enable/Disable the following migration capabilities (like xbzrle)
625#
626# @capabilities: json array of capability modifications to make
627#
628# Since: 1.2
629##
630{ 'command': 'migrate-set-capabilities',
631 'data': { 'capabilities': ['MigrationCapabilityStatus'] } }
632
633##
bbf6da32
OW
634# @query-migrate-capabilities
635#
636# Returns information about the current migration capabilities status
637#
638# Returns: @MigrationCapabilitiesStatus
639#
640# Since: 1.2
641##
642{ 'command': 'query-migrate-capabilities', 'returns': ['MigrationCapabilityStatus']}
643
e235cec3
LC
644##
645# @MouseInfo:
646#
647# Information about a mouse device.
648#
649# @name: the name of the mouse device
650#
651# @index: the index of the mouse device
652#
653# @current: true if this device is currently receiving mouse events
654#
655# @absolute: true if this device supports absolute coordinates as input
656#
657# Since: 0.14.0
658##
659{ 'type': 'MouseInfo',
660 'data': {'name': 'str', 'index': 'int', 'current': 'bool',
661 'absolute': 'bool'} }
662
663##
664# @query-mice:
665#
666# Returns information about each active mouse device
667#
668# Returns: a list of @MouseInfo for each device
669#
670# Since: 0.14.0
671##
672{ 'command': 'query-mice', 'returns': ['MouseInfo'] }
673
de0b36b6
LC
674##
675# @CpuInfo:
676#
677# Information about a virtual CPU
678#
679# @CPU: the index of the virtual CPU
680#
681# @current: this only exists for backwards compatible and should be ignored
b80e560b 682#
de0b36b6
LC
683# @halted: true if the virtual CPU is in the halt state. Halt usually refers
684# to a processor specific low power mode.
685#
686# @pc: #optional If the target is i386 or x86_64, this is the 64-bit instruction
687# pointer.
688# If the target is Sparc, this is the PC component of the
689# instruction pointer.
690#
691# @nip: #optional If the target is PPC, the instruction pointer
692#
693# @npc: #optional If the target is Sparc, the NPC component of the instruction
694# pointer
695#
696# @PC: #optional If the target is MIPS, the instruction pointer
697#
698# @thread_id: ID of the underlying host thread
699#
700# Since: 0.14.0
701#
702# Notes: @halted is a transient state that changes frequently. By the time the
703# data is sent to the client, the guest may no longer be halted.
704##
705{ 'type': 'CpuInfo',
706 'data': {'CPU': 'int', 'current': 'bool', 'halted': 'bool', '*pc': 'int',
707 '*nip': 'int', '*npc': 'int', '*PC': 'int', 'thread_id': 'int'} }
708
709##
710# @query-cpus:
711#
712# Returns a list of information about each virtual CPU.
713#
714# Returns: a list of @CpuInfo for each virtual CPU
715#
716# Since: 0.14.0
717##
718{ 'command': 'query-cpus', 'returns': ['CpuInfo'] }
719
b2023818
LC
720##
721# @BlockDeviceInfo:
722#
723# Information about the backing device for a block device.
724#
725# @file: the filename of the backing device
726#
727# @ro: true if the backing device was open read-only
728#
729# @drv: the name of the block format used to open the backing device. As of
730# 0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
731# 'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
732# 'host_floppy', 'http', 'https', 'nbd', 'parallels', 'qcow',
733# 'qcow2', 'raw', 'tftp', 'vdi', 'vmdk', 'vpc', 'vvfat'
734#
735# @backing_file: #optional the name of the backing file (for copy-on-write)
736#
2e3e3317
BC
737# @backing_file_depth: number of files in the backing file chain (since: 1.2)
738#
b2023818
LC
739# @encrypted: true if the backing device is encrypted
740#
c75a1a8a
LC
741# @encryption_key_missing: true if the backing device is encrypted but an
742# valid encryption key is missing
743#
727f005e
ZYW
744# @bps: total throughput limit in bytes per second is specified
745#
746# @bps_rd: read throughput limit in bytes per second is specified
747#
748# @bps_wr: write throughput limit in bytes per second is specified
749#
750# @iops: total I/O operations per second is specified
751#
752# @iops_rd: read I/O operations per second is specified
753#
754# @iops_wr: write I/O operations per second is specified
755#
b2023818
LC
756# Since: 0.14.0
757#
758# Notes: This interface is only found in @BlockInfo.
759##
760{ 'type': 'BlockDeviceInfo',
761 'data': { 'file': 'str', 'ro': 'bool', 'drv': 'str',
2e3e3317 762 '*backing_file': 'str', 'backing_file_depth': 'int',
c75a1a8a
LC
763 'encrypted': 'bool', 'encryption_key_missing': 'bool',
764 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
765 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int'} }
b2023818
LC
766
767##
768# @BlockDeviceIoStatus:
769#
770# An enumeration of block device I/O status.
771#
772# @ok: The last I/O operation has succeeded
773#
774# @failed: The last I/O operation has failed
775#
776# @nospace: The last I/O operation has failed due to a no-space condition
777#
778# Since: 1.0
779##
780{ 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
781
b9a9b3a4
PB
782##
783# @BlockDirtyInfo:
784#
785# Block dirty bitmap information.
786#
787# @count: number of dirty bytes according to the dirty bitmap
788#
50717e94
PB
789# @granularity: granularity of the dirty bitmap in bytes (since 1.4)
790#
b9a9b3a4
PB
791# Since: 1.3
792##
793{ 'type': 'BlockDirtyInfo',
50717e94 794 'data': {'count': 'int', 'granularity': 'int'} }
b9a9b3a4 795
b2023818
LC
796##
797# @BlockInfo:
798#
799# Block device information. This structure describes a virtual device and
800# the backing device associated with it.
801#
802# @device: The device name associated with the virtual device.
803#
804# @type: This field is returned only for compatibility reasons, it should
805# not be used (always returns 'unknown')
806#
807# @removable: True if the device supports removable media.
808#
809# @locked: True if the guest has locked this device from having its media
810# removed
811#
812# @tray_open: #optional True if the device has a tray and it is open
813# (only present if removable is true)
814#
b9a9b3a4
PB
815# @dirty: #optional dirty bitmap information (only present if the dirty
816# bitmap is enabled)
817#
b2023818
LC
818# @io-status: #optional @BlockDeviceIoStatus. Only present if the device
819# supports it and the VM is configured to stop on errors
820#
821# @inserted: #optional @BlockDeviceInfo describing the device if media is
822# present
823#
824# Since: 0.14.0
825##
826{ 'type': 'BlockInfo',
827 'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
828 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
b9a9b3a4
PB
829 '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus',
830 '*dirty': 'BlockDirtyInfo' } }
b2023818
LC
831
832##
833# @query-block:
834#
835# Get a list of BlockInfo for all virtual block devices.
836#
837# Returns: a list of @BlockInfo describing each virtual block device
838#
839# Since: 0.14.0
840##
841{ 'command': 'query-block', 'returns': ['BlockInfo'] }
842
f11f57e4
LC
843##
844# @BlockDeviceStats:
845#
846# Statistics of a virtual block device or a block backing device.
847#
848# @rd_bytes: The number of bytes read by the device.
849#
850# @wr_bytes: The number of bytes written by the device.
851#
852# @rd_operations: The number of read operations performed by the device.
853#
854# @wr_operations: The number of write operations performed by the device.
855#
856# @flush_operations: The number of cache flush operations performed by the
857# device (since 0.15.0)
858#
859# @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
860# (since 0.15.0).
861#
862# @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
863#
864# @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
865#
866# @wr_highest_offset: The offset after the greatest byte written to the
867# device. The intended use of this information is for
868# growable sparse files (like qcow2) that are used on top
869# of a physical device.
870#
871# Since: 0.14.0
872##
873{ 'type': 'BlockDeviceStats',
874 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
875 'wr_operations': 'int', 'flush_operations': 'int',
876 'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
877 'rd_total_time_ns': 'int', 'wr_highest_offset': 'int' } }
878
879##
880# @BlockStats:
881#
882# Statistics of a virtual block device or a block backing device.
883#
884# @device: #optional If the stats are for a virtual block device, the name
885# corresponding to the virtual block device.
886#
887# @stats: A @BlockDeviceStats for the device.
888#
889# @parent: #optional This may point to the backing block device if this is a
890# a virtual block device. If it's a backing block, this will point
891# to the backing file is one is present.
892#
893# Since: 0.14.0
894##
895{ 'type': 'BlockStats',
896 'data': {'*device': 'str', 'stats': 'BlockDeviceStats',
897 '*parent': 'BlockStats'} }
898
899##
900# @query-blockstats:
901#
902# Query the @BlockStats for all virtual block devices.
903#
904# Returns: A list of @BlockStats for each virtual block devices.
905#
906# Since: 0.14.0
907##
908{ 'command': 'query-blockstats', 'returns': ['BlockStats'] }
909
2b54aa87
LC
910##
911# @VncClientInfo:
912#
913# Information about a connected VNC client.
914#
915# @host: The host name of the client. QEMU tries to resolve this to a DNS name
916# when possible.
917#
918# @family: 'ipv6' if the client is connected via IPv6 and TCP
919# 'ipv4' if the client is connected via IPv4 and TCP
920# 'unix' if the client is connected via a unix domain socket
921# 'unknown' otherwise
922#
923# @service: The service name of the client's port. This may depends on the
924# host system's service database so symbolic names should not be
925# relied on.
926#
927# @x509_dname: #optional If x509 authentication is in use, the Distinguished
928# Name of the client.
929#
930# @sasl_username: #optional If SASL authentication is in use, the SASL username
931# used for authentication.
932#
933# Since: 0.14.0
934##
935{ 'type': 'VncClientInfo',
936 'data': {'host': 'str', 'family': 'str', 'service': 'str',
937 '*x509_dname': 'str', '*sasl_username': 'str'} }
938
939##
940# @VncInfo:
941#
942# Information about the VNC session.
943#
944# @enabled: true if the VNC server is enabled, false otherwise
945#
946# @host: #optional The hostname the VNC server is bound to. This depends on
947# the name resolution on the host and may be an IP address.
948#
949# @family: #optional 'ipv6' if the host is listening for IPv6 connections
950# 'ipv4' if the host is listening for IPv4 connections
951# 'unix' if the host is listening on a unix domain socket
952# 'unknown' otherwise
953#
954# @service: #optional The service name of the server's port. This may depends
955# on the host system's service database so symbolic names should not
956# be relied on.
957#
958# @auth: #optional the current authentication type used by the server
959# 'none' if no authentication is being used
960# 'vnc' if VNC authentication is being used
961# 'vencrypt+plain' if VEncrypt is used with plain text authentication
962# 'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
963# 'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
964# 'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
965# 'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
966# 'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
967# 'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
968# 'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
969# 'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
970#
971# @clients: a list of @VncClientInfo of all currently connected clients
972#
973# Since: 0.14.0
974##
975{ 'type': 'VncInfo',
976 'data': {'enabled': 'bool', '*host': 'str', '*family': 'str',
977 '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
978
979##
980# @query-vnc:
981#
982# Returns information about the current VNC server
983#
984# Returns: @VncInfo
2b54aa87
LC
985#
986# Since: 0.14.0
987##
988{ 'command': 'query-vnc', 'returns': 'VncInfo' }
989
d1f29646
LC
990##
991# @SpiceChannel
992#
993# Information about a SPICE client channel.
994#
995# @host: The host name of the client. QEMU tries to resolve this to a DNS name
996# when possible.
997#
998# @family: 'ipv6' if the client is connected via IPv6 and TCP
999# 'ipv4' if the client is connected via IPv4 and TCP
1000# 'unix' if the client is connected via a unix domain socket
1001# 'unknown' otherwise
1002#
1003# @port: The client's port number.
1004#
1005# @connection-id: SPICE connection id number. All channels with the same id
1006# belong to the same SPICE session.
1007#
419e1bdf
AL
1008# @connection-type: SPICE channel type number. "1" is the main control
1009# channel, filter for this one if you want to track spice
1010# sessions only
d1f29646 1011#
419e1bdf
AL
1012# @channel-id: SPICE channel ID number. Usually "0", might be different when
1013# multiple channels of the same type exist, such as multiple
d1f29646
LC
1014# display channels in a multihead setup
1015#
1016# @tls: true if the channel is encrypted, false otherwise.
1017#
1018# Since: 0.14.0
1019##
1020{ 'type': 'SpiceChannel',
1021 'data': {'host': 'str', 'family': 'str', 'port': 'str',
1022 'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
1023 'tls': 'bool'} }
1024
4efee029
AL
1025##
1026# @SpiceQueryMouseMode
1027#
6932a69b 1028# An enumeration of Spice mouse states.
4efee029
AL
1029#
1030# @client: Mouse cursor position is determined by the client.
1031#
1032# @server: Mouse cursor position is determined by the server.
1033#
1034# @unknown: No information is available about mouse mode used by
1035# the spice server.
1036#
1037# Note: spice/enums.h has a SpiceMouseMode already, hence the name.
1038#
1039# Since: 1.1
1040##
1041{ 'enum': 'SpiceQueryMouseMode',
1042 'data': [ 'client', 'server', 'unknown' ] }
1043
d1f29646
LC
1044##
1045# @SpiceInfo
1046#
1047# Information about the SPICE session.
b80e560b 1048#
d1f29646
LC
1049# @enabled: true if the SPICE server is enabled, false otherwise
1050#
61c4efe2
YH
1051# @migrated: true if the last guest migration completed and spice
1052# migration had completed as well. false otherwise.
1053#
d1f29646
LC
1054# @host: #optional The hostname the SPICE server is bound to. This depends on
1055# the name resolution on the host and may be an IP address.
1056#
1057# @port: #optional The SPICE server's port number.
1058#
1059# @compiled-version: #optional SPICE server version.
1060#
1061# @tls-port: #optional The SPICE server's TLS port number.
1062#
1063# @auth: #optional the current authentication type used by the server
419e1bdf
AL
1064# 'none' if no authentication is being used
1065# 'spice' uses SASL or direct TLS authentication, depending on command
1066# line options
d1f29646 1067#
4efee029
AL
1068# @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
1069# be determined by the client or the server, or unknown if spice
1070# server doesn't provide this information.
1071#
1072# Since: 1.1
1073#
d1f29646
LC
1074# @channels: a list of @SpiceChannel for each active spice channel
1075#
1076# Since: 0.14.0
1077##
1078{ 'type': 'SpiceInfo',
61c4efe2 1079 'data': {'enabled': 'bool', 'migrated': 'bool', '*host': 'str', '*port': 'int',
d1f29646 1080 '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
4efee029 1081 'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
d1f29646
LC
1082
1083##
1084# @query-spice
1085#
1086# Returns information about the current SPICE server
1087#
1088# Returns: @SpiceInfo
1089#
1090# Since: 0.14.0
1091##
1092{ 'command': 'query-spice', 'returns': 'SpiceInfo' }
1093
96637bcd
LC
1094##
1095# @BalloonInfo:
1096#
1097# Information about the guest balloon device.
1098#
1099# @actual: the number of bytes the balloon currently contains
1100#
96637bcd
LC
1101# Since: 0.14.0
1102#
96637bcd 1103##
01ceb97e 1104{ 'type': 'BalloonInfo', 'data': {'actual': 'int' } }
96637bcd
LC
1105
1106##
1107# @query-balloon:
1108#
1109# Return information about the balloon device.
1110#
1111# Returns: @BalloonInfo on success
1112# If the balloon driver is enabled but not functional because the KVM
1113# kernel module cannot support it, KvmMissingCap
1114# If no balloon device is present, DeviceNotActive
1115#
1116# Since: 0.14.0
1117##
1118{ 'command': 'query-balloon', 'returns': 'BalloonInfo' }
1119
79627472
LC
1120##
1121# @PciMemoryRange:
1122#
1123# A PCI device memory region
1124#
1125# @base: the starting address (guest physical)
1126#
1127# @limit: the ending address (guest physical)
1128#
1129# Since: 0.14.0
1130##
1131{ 'type': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
1132
1133##
1134# @PciMemoryRegion
1135#
1136# Information about a PCI device I/O region.
1137#
1138# @bar: the index of the Base Address Register for this region
1139#
1140# @type: 'io' if the region is a PIO region
1141# 'memory' if the region is a MMIO region
1142#
1143# @prefetch: #optional if @type is 'memory', true if the memory is prefetchable
1144#
1145# @mem_type_64: #optional if @type is 'memory', true if the BAR is 64-bit
1146#
1147# Since: 0.14.0
1148##
1149{ 'type': 'PciMemoryRegion',
1150 'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
1151 '*prefetch': 'bool', '*mem_type_64': 'bool' } }
1152
1153##
1154# @PciBridgeInfo:
1155#
1156# Information about a PCI Bridge device
1157#
1158# @bus.number: primary bus interface number. This should be the number of the
1159# bus the device resides on.
1160#
1161# @bus.secondary: secondary bus interface number. This is the number of the
1162# main bus for the bridge
1163#
1164# @bus.subordinate: This is the highest number bus that resides below the
1165# bridge.
1166#
1167# @bus.io_range: The PIO range for all devices on this bridge
1168#
1169# @bus.memory_range: The MMIO range for all devices on this bridge
1170#
1171# @bus.prefetchable_range: The range of prefetchable MMIO for all devices on
1172# this bridge
1173#
1174# @devices: a list of @PciDeviceInfo for each device on this bridge
1175#
1176# Since: 0.14.0
1177##
1178{ 'type': 'PciBridgeInfo',
1179 'data': {'bus': { 'number': 'int', 'secondary': 'int', 'subordinate': 'int',
1180 'io_range': 'PciMemoryRange',
1181 'memory_range': 'PciMemoryRange',
1182 'prefetchable_range': 'PciMemoryRange' },
1183 '*devices': ['PciDeviceInfo']} }
1184
1185##
1186# @PciDeviceInfo:
1187#
1188# Information about a PCI device
1189#
1190# @bus: the bus number of the device
1191#
1192# @slot: the slot the device is located in
1193#
1194# @function: the function of the slot used by the device
1195#
1196# @class_info.desc: #optional a string description of the device's class
1197#
1198# @class_info.class: the class code of the device
1199#
1200# @id.device: the PCI device id
1201#
1202# @id.vendor: the PCI vendor id
1203#
1204# @irq: #optional if an IRQ is assigned to the device, the IRQ number
1205#
1206# @qdev_id: the device name of the PCI device
1207#
1208# @pci_bridge: if the device is a PCI bridge, the bridge information
1209#
1210# @regions: a list of the PCI I/O regions associated with the device
1211#
1212# Notes: the contents of @class_info.desc are not stable and should only be
1213# treated as informational.
1214#
1215# Since: 0.14.0
1216##
1217{ 'type': 'PciDeviceInfo',
1218 'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
1219 'class_info': {'*desc': 'str', 'class': 'int'},
1220 'id': {'device': 'int', 'vendor': 'int'},
1221 '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
1222 'regions': ['PciMemoryRegion']} }
1223
1224##
1225# @PciInfo:
1226#
1227# Information about a PCI bus
1228#
1229# @bus: the bus index
1230#
1231# @devices: a list of devices on this bus
1232#
1233# Since: 0.14.0
1234##
1235{ 'type': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
1236
1237##
1238# @query-pci:
1239#
1240# Return information about the PCI bus topology of the guest.
1241#
1242# Returns: a list of @PciInfo for each PCI bus
1243#
1244# Since: 0.14.0
1245##
1246{ 'command': 'query-pci', 'returns': ['PciInfo'] }
1247
92aa5c6d
PB
1248##
1249# @BlockdevOnError:
1250#
1251# An enumeration of possible behaviors for errors on I/O operations.
1252# The exact meaning depends on whether the I/O was initiated by a guest
1253# or by a block job
1254#
1255# @report: for guest operations, report the error to the guest;
1256# for jobs, cancel the job
1257#
1258# @ignore: ignore the error, only report a QMP event (BLOCK_IO_ERROR
1259# or BLOCK_JOB_ERROR)
1260#
1261# @enospc: same as @stop on ENOSPC, same as @report otherwise.
1262#
1263# @stop: for guest operations, stop the virtual machine;
1264# for jobs, pause the job
1265#
1266# Since: 1.3
1267##
1268{ 'enum': 'BlockdevOnError',
1269 'data': ['report', 'ignore', 'enospc', 'stop'] }
1270
893f7eba
PB
1271##
1272# @MirrorSyncMode:
1273#
1274# An enumeration of possible behaviors for the initial synchronization
1275# phase of storage mirroring.
1276#
1277# @top: copies data in the topmost image to the destination
1278#
1279# @full: copies data from all images to the destination
1280#
1281# @none: only copy data written from now on
1282#
1283# Since: 1.3
1284##
1285{ 'enum': 'MirrorSyncMode',
1286 'data': ['top', 'full', 'none'] }
1287
fb5458cd
SH
1288##
1289# @BlockJobInfo:
1290#
1291# Information about a long-running block device operation.
1292#
1293# @type: the job type ('stream' for image streaming)
1294#
1295# @device: the block device name
1296#
1297# @len: the maximum progress value
1298#
8d65883f
PB
1299# @busy: false if the job is known to be in a quiescent state, with
1300# no pending I/O. Since 1.3.
1301#
8acc72a4
PB
1302# @paused: whether the job is paused or, if @busy is true, will
1303# pause itself as soon as possible. Since 1.3.
1304#
fb5458cd
SH
1305# @offset: the current progress value
1306#
1307# @speed: the rate limit, bytes per second
1308#
32c81a4a
PB
1309# @io-status: the status of the job (since 1.3)
1310#
fb5458cd
SH
1311# Since: 1.1
1312##
1313{ 'type': 'BlockJobInfo',
1314 'data': {'type': 'str', 'device': 'str', 'len': 'int',
32c81a4a
PB
1315 'offset': 'int', 'busy': 'bool', 'paused': 'bool', 'speed': 'int',
1316 'io-status': 'BlockDeviceIoStatus'} }
fb5458cd
SH
1317
1318##
1319# @query-block-jobs:
1320#
1321# Return information about long-running block device operations.
1322#
1323# Returns: a list of @BlockJobInfo for each active block job
1324#
1325# Since: 1.1
1326##
1327{ 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
1328
7a7f325e
LC
1329##
1330# @quit:
1331#
1332# This command will cause the QEMU process to exit gracefully. While every
1333# attempt is made to send the QMP response before terminating, this is not
1334# guaranteed. When using this interface, a premature EOF would not be
1335# unexpected.
1336#
1337# Since: 0.14.0
1338##
1339{ 'command': 'quit' }
5f158f21
LC
1340
1341##
1342# @stop:
1343#
1344# Stop all guest VCPU execution.
1345#
1346# Since: 0.14.0
1347#
1348# Notes: This function will succeed even if the guest is already in the stopped
1e998146
PB
1349# state. In "inmigrate" state, it will ensure that the guest
1350# remains paused once migration finishes, as if the -S option was
1351# passed on the command line.
5f158f21
LC
1352##
1353{ 'command': 'stop' }
38d22653
LC
1354
1355##
1356# @system_reset:
1357#
1358# Performs a hard reset of a guest.
1359#
1360# Since: 0.14.0
1361##
1362{ 'command': 'system_reset' }
5bc465e4
LC
1363
1364##
1365# @system_powerdown:
1366#
1367# Requests that a guest perform a powerdown operation.
1368#
1369# Since: 0.14.0
1370#
1371# Notes: A guest may or may not respond to this command. This command
1372# returning does not indicate that a guest has accepted the request or
1373# that it has shut down. Many guests will respond to this command by
1374# prompting the user in some way.
1375##
1376{ 'command': 'system_powerdown' }
755f1968
LC
1377
1378##
1379# @cpu:
1380#
1381# This command is a nop that is only provided for the purposes of compatibility.
1382#
1383# Since: 0.14.0
1384#
1385# Notes: Do not use this command.
1386##
1387{ 'command': 'cpu', 'data': {'index': 'int'} }
0cfd6a9a
LC
1388
1389##
1390# @memsave:
1391#
1392# Save a portion of guest memory to a file.
1393#
1394# @val: the virtual address of the guest to start from
1395#
1396# @size: the size of memory region to save
1397#
1398# @filename: the file to save the memory to as binary data
1399#
1400# @cpu-index: #optional the index of the virtual CPU to use for translating the
1401# virtual address (defaults to CPU 0)
1402#
1403# Returns: Nothing on success
0cfd6a9a
LC
1404#
1405# Since: 0.14.0
1406#
1407# Notes: Errors were not reliably returned until 1.1
1408##
1409{ 'command': 'memsave',
1410 'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
6d3962bf
LC
1411
1412##
1413# @pmemsave:
1414#
1415# Save a portion of guest physical memory to a file.
1416#
1417# @val: the physical address of the guest to start from
1418#
1419# @size: the size of memory region to save
1420#
1421# @filename: the file to save the memory to as binary data
1422#
1423# Returns: Nothing on success
6d3962bf
LC
1424#
1425# Since: 0.14.0
1426#
1427# Notes: Errors were not reliably returned until 1.1
1428##
1429{ 'command': 'pmemsave',
1430 'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
e42e818b
LC
1431
1432##
1433# @cont:
1434#
1435# Resume guest VCPU execution.
1436#
1437# Since: 0.14.0
1438#
1439# Returns: If successful, nothing
e42e818b
LC
1440# If QEMU was started with an encrypted block device and a key has
1441# not yet been set, DeviceEncrypted.
1442#
1e998146
PB
1443# Notes: This command will succeed if the guest is currently running. It
1444# will also succeed if the guest is in the "inmigrate" state; in
1445# this case, the effect of the command is to make sure the guest
1446# starts once migration finishes, removing the effect of the -S
1447# command line option if it was passed.
e42e818b
LC
1448##
1449{ 'command': 'cont' }
1450
9b9df25a
GH
1451##
1452# @system_wakeup:
1453#
1454# Wakeup guest from suspend. Does nothing in case the guest isn't suspended.
1455#
1456# Since: 1.1
1457#
1458# Returns: nothing.
1459##
1460{ 'command': 'system_wakeup' }
1461
ab49ab5c
LC
1462##
1463# @inject-nmi:
1464#
1465# Injects an Non-Maskable Interrupt into all guest's VCPUs.
1466#
1467# Returns: If successful, nothing
ab49ab5c
LC
1468#
1469# Since: 0.14.0
1470#
1471# Notes: Only x86 Virtual Machines support this command.
1472##
1473{ 'command': 'inject-nmi' }
4b37156c
LC
1474
1475##
1476# @set_link:
1477#
1478# Sets the link status of a virtual network adapter.
1479#
1480# @name: the device name of the virtual network adapter
1481#
1482# @up: true to set the link status to be up
1483#
1484# Returns: Nothing on success
1485# If @name is not a valid network device, DeviceNotFound
1486#
1487# Since: 0.14.0
1488#
1489# Notes: Not all network adapters support setting link status. This command
1490# will succeed even if the network adapter does not support link status
1491# notification.
1492##
1493{ 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
a4dea8a9
LC
1494
1495##
1496# @block_passwd:
1497#
1498# This command sets the password of a block device that has not been open
1499# with a password and requires one.
1500#
1501# The two cases where this can happen are a block device is created through
1502# QEMU's initial command line or a block device is changed through the legacy
1503# @change interface.
1504#
1505# In the event that the block device is created through the initial command
1506# line, the VM will start in the stopped state regardless of whether '-S' is
1507# used. The intention is for a management tool to query the block devices to
1508# determine which ones are encrypted, set the passwords with this command, and
1509# then start the guest with the @cont command.
1510#
1511# @device: the name of the device to set the password on
1512#
1513# @password: the password to use for the device
1514#
1515# Returns: nothing on success
1516# If @device is not a valid block device, DeviceNotFound
1517# If @device is not encrypted, DeviceNotEncrypted
a4dea8a9
LC
1518#
1519# Notes: Not all block formats support encryption and some that do are not
1520# able to validate that a password is correct. Disk corruption may
1521# occur if an invalid password is specified.
1522#
1523# Since: 0.14.0
1524##
1525{ 'command': 'block_passwd', 'data': {'device': 'str', 'password': 'str'} }
d72f3264
LC
1526
1527##
1528# @balloon:
1529#
1530# Request the balloon driver to change its balloon size.
1531#
1532# @value: the target size of the balloon in bytes
1533#
1534# Returns: Nothing on success
1535# If the balloon driver is enabled but not functional because the KVM
1536# kernel module cannot support it, KvmMissingCap
1537# If no balloon device is present, DeviceNotActive
1538#
1539# Notes: This command just issues a request to the guest. When it returns,
1540# the balloon size may not have changed. A guest can change the balloon
1541# size independent of this command.
1542#
1543# Since: 0.14.0
1544##
1545{ 'command': 'balloon', 'data': {'value': 'int'} }
5e7caacb
LC
1546
1547##
1548# @block_resize
1549#
1550# Resize a block image while a guest is running.
1551#
1552# @device: the name of the device to get the image resized
1553#
1554# @size: new image size in bytes
1555#
1556# Returns: nothing on success
1557# If @device is not a valid block device, DeviceNotFound
5e7caacb
LC
1558#
1559# Since: 0.14.0
1560##
1561{ 'command': 'block_resize', 'data': { 'device': 'str', 'size': 'int' }}
6106e249 1562
8802d1fd 1563##
bc8b094f
PB
1564# @NewImageMode
1565#
1566# An enumeration that tells QEMU how to set the backing file path in
1567# a new image file.
1568#
1569# @existing: QEMU should look for an existing image file.
1570#
1571# @absolute-paths: QEMU should create a new image with absolute paths
1572# for the backing file.
1573#
1574# Since: 1.1
1575##
1576{ 'enum': 'NewImageMode'
1577 'data': [ 'existing', 'absolute-paths' ] }
1578
8802d1fd 1579##
52e7c241 1580# @BlockdevSnapshot
8802d1fd
JC
1581#
1582# @device: the name of the device to generate the snapshot from.
1583#
1584# @snapshot-file: the target of the new image. A new file will be created.
1585#
1586# @format: #optional the format of the snapshot image, default is 'qcow2'.
6cc2a415
PB
1587#
1588# @mode: #optional whether and how QEMU should create a new image, default is
8bde9b6f 1589# 'absolute-paths'.
8802d1fd 1590##
52e7c241 1591{ 'type': 'BlockdevSnapshot',
bc8b094f
PB
1592 'data': { 'device': 'str', 'snapshot-file': 'str', '*format': 'str',
1593 '*mode': 'NewImageMode' } }
8802d1fd
JC
1594
1595##
52e7c241 1596# @BlockdevAction
8802d1fd 1597#
52e7c241
PB
1598# A discriminated record of operations that can be performed with
1599# @transaction.
8802d1fd 1600##
52e7c241
PB
1601{ 'union': 'BlockdevAction',
1602 'data': {
c85a1284 1603 'blockdev-snapshot-sync': 'BlockdevSnapshot'
52e7c241 1604 } }
8802d1fd
JC
1605
1606##
52e7c241 1607# @transaction
8802d1fd 1608#
52e7c241
PB
1609# Atomically operate on a group of one or more block devices. If
1610# any operation fails, then the entire set of actions will be
1611# abandoned and the appropriate error returned. The only operation
1612# supported is currently blockdev-snapshot-sync.
8802d1fd
JC
1613#
1614# List of:
52e7c241 1615# @BlockdevAction: information needed for the device snapshot
8802d1fd
JC
1616#
1617# Returns: nothing on success
1618# If @device is not a valid block device, DeviceNotFound
8802d1fd 1619#
52e7c241
PB
1620# Note: The transaction aborts on the first failure. Therefore, there will
1621# be only one device or snapshot file returned in an error condition, and
1622# subsequent actions will not have been attempted.
1623#
1624# Since 1.1
8802d1fd 1625##
52e7c241
PB
1626{ 'command': 'transaction',
1627 'data': { 'actions': [ 'BlockdevAction' ] } }
8802d1fd 1628
6106e249
LC
1629##
1630# @blockdev-snapshot-sync
1631#
1632# Generates a synchronous snapshot of a block device.
1633#
1634# @device: the name of the device to generate the snapshot from.
1635#
1636# @snapshot-file: the target of the new image. If the file exists, or if it
1637# is a device, the snapshot will be created in the existing
1638# file/device. If does not exist, a new file will be created.
1639#
1640# @format: #optional the format of the snapshot image, default is 'qcow2'.
1641#
6cc2a415 1642# @mode: #optional whether and how QEMU should create a new image, default is
8bde9b6f 1643# 'absolute-paths'.
6cc2a415 1644#
6106e249
LC
1645# Returns: nothing on success
1646# If @device is not a valid block device, DeviceNotFound
6106e249 1647#
6106e249
LC
1648# Since 0.14.0
1649##
1650{ 'command': 'blockdev-snapshot-sync',
6cc2a415
PB
1651 'data': { 'device': 'str', 'snapshot-file': 'str', '*format': 'str',
1652 '*mode': 'NewImageMode'} }
d51a67b4
LC
1653
1654##
1655# @human-monitor-command:
1656#
1657# Execute a command on the human monitor and return the output.
1658#
1659# @command-line: the command to execute in the human monitor
1660#
1661# @cpu-index: #optional The CPU to use for commands that require an implicit CPU
1662#
1663# Returns: the output of the command as a string
1664#
1665# Since: 0.14.0
1666#
1667# Notes: This command only exists as a stop-gap. It's use is highly
1668# discouraged. The semantics of this command are not guaranteed.
1669#
1670# Known limitations:
1671#
1672# o This command is stateless, this means that commands that depend
1673# on state information (such as getfd) might not work
1674#
1675# o Commands that prompt the user for data (eg. 'cont' when the block
1676# device is encrypted) don't currently work
1677##
1678{ 'command': 'human-monitor-command',
1679 'data': {'command-line': 'str', '*cpu-index': 'int'},
b80e560b 1680 'returns': 'str' }
6cdedb07
LC
1681
1682##
ed61fc10
JC
1683# @block-commit
1684#
1685# Live commit of data from overlay image nodes into backing nodes - i.e.,
1686# writes data between 'top' and 'base' into 'base'.
1687#
1688# @device: the name of the device
1689#
1690# @base: #optional The file name of the backing image to write data into.
1691# If not specified, this is the deepest backing image
1692#
1693# @top: The file name of the backing image within the image chain,
1694# which contains the topmost data to be committed down.
1695# Note, the active layer as 'top' is currently unsupported.
1696#
1697# If top == base, that is an error.
1698#
1699#
1700# @speed: #optional the maximum speed, in bytes per second
1701#
1702# Returns: Nothing on success
1703# If commit or stream is already active on this device, DeviceInUse
1704# If @device does not exist, DeviceNotFound
1705# If image commit is not supported by this device, NotSupported
1706# If @base or @top is invalid, a generic error is returned
1707# If @top is the active layer, or omitted, a generic error is returned
1708# If @speed is invalid, InvalidParameter
1709#
1710# Since: 1.3
1711#
1712##
1713{ 'command': 'block-commit',
1714 'data': { 'device': 'str', '*base': 'str', 'top': 'str',
1715 '*speed': 'int' } }
1716
d9b902db
PB
1717##
1718# @drive-mirror
1719#
1720# Start mirroring a block device's writes to a new destination.
1721#
1722# @device: the name of the device whose writes should be mirrored.
1723#
1724# @target: the target of the new image. If the file exists, or if it
1725# is a device, the existing file/device will be used as the new
1726# destination. If it does not exist, a new file will be created.
1727#
1728# @format: #optional the format of the new destination, default is to
1729# probe if @mode is 'existing', else the format of the source
1730#
1731# @mode: #optional whether and how QEMU should create a new image, default is
1732# 'absolute-paths'.
1733#
1734# @speed: #optional the maximum speed, in bytes per second
1735#
1736# @sync: what parts of the disk image should be copied to the destination
1737# (all the disk, only the sectors allocated in the topmost image, or
1738# only new I/O).
1739#
eee13dfe
PB
1740# @granularity: #optional granularity of the dirty bitmap, default is 64K
1741# if the image format doesn't have clusters, 4K if the clusters
1742# are smaller than that, else the cluster size. Must be a
1743# power of 2 between 512 and 64M (since 1.4).
1744#
08e4ed6c
PB
1745# @buf-size: #optional maximum amount of data in flight from source to
1746# target (since 1.4).
1747#
b952b558
PB
1748# @on-source-error: #optional the action to take on an error on the source,
1749# default 'report'. 'stop' and 'enospc' can only be used
1750# if the block device supports io-status (see BlockInfo).
1751#
1752# @on-target-error: #optional the action to take on an error on the target,
1753# default 'report' (no limitations, since this applies to
1754# a different block device than @device).
1755#
d9b902db
PB
1756# Returns: nothing on success
1757# If @device is not a valid block device, DeviceNotFound
1758#
1759# Since 1.3
1760##
1761{ 'command': 'drive-mirror',
1762 'data': { 'device': 'str', 'target': 'str', '*format': 'str',
1763 'sync': 'MirrorSyncMode', '*mode': 'NewImageMode',
eee13dfe 1764 '*speed': 'int', '*granularity': 'uint32',
08e4ed6c 1765 '*buf-size': 'int', '*on-source-error': 'BlockdevOnError',
b952b558 1766 '*on-target-error': 'BlockdevOnError' } }
d9b902db
PB
1767
1768##
6cdedb07
LC
1769# @migrate_cancel
1770#
1771# Cancel the current executing migration process.
1772#
1773# Returns: nothing on success
1774#
1775# Notes: This command succeeds even if there is no migration process running.
1776#
1777# Since: 0.14.0
1778##
1779{ 'command': 'migrate_cancel' }
4f0a993b
LC
1780
1781##
1782# @migrate_set_downtime
1783#
1784# Set maximum tolerated downtime for migration.
1785#
1786# @value: maximum downtime in seconds
1787#
1788# Returns: nothing on success
1789#
1790# Since: 0.14.0
1791##
1792{ 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
3dc85383
LC
1793
1794##
1795# @migrate_set_speed
1796#
1797# Set maximum speed for migration.
1798#
1799# @value: maximum speed in bytes.
1800#
1801# Returns: nothing on success
1802#
1803# Notes: A value lesser than zero will be automatically round up to zero.
1804#
1805# Since: 0.14.0
1806##
1807{ 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
b4b12c62 1808
9e1ba4cc
OW
1809##
1810# @migrate-set-cache-size
1811#
1812# Set XBZRLE cache size
1813#
1814# @value: cache size in bytes
1815#
1816# The size will be rounded down to the nearest power of 2.
1817# The cache size can be modified before and during ongoing migration
1818#
1819# Returns: nothing on success
1820#
1821# Since: 1.2
1822##
1823{ 'command': 'migrate-set-cache-size', 'data': {'value': 'int'} }
1824
1825##
1826# @query-migrate-cache-size
1827#
1828# query XBZRLE cache size
1829#
1830# Returns: XBZRLE cache size in bytes
1831#
1832# Since: 1.2
1833##
1834{ 'command': 'query-migrate-cache-size', 'returns': 'int' }
1835
b4b12c62 1836##
d03ee401 1837# @ObjectPropertyInfo:
b4b12c62
AL
1838#
1839# @name: the name of the property
1840#
1841# @type: the type of the property. This will typically come in one of four
1842# forms:
1843#
1844# 1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
1845# These types are mapped to the appropriate JSON type.
1846#
1847# 2) A legacy type in the form 'legacy<subtype>' where subtype is the
1848# legacy qdev typename. These types are always treated as strings.
1849#
1850# 3) A child type in the form 'child<subtype>' where subtype is a qdev
1851# device type name. Child properties create the composition tree.
1852#
1853# 4) A link type in the form 'link<subtype>' where subtype is a qdev
1854# device type name. Link properties form the device model graph.
1855#
51920820 1856# Since: 1.2
b4b12c62 1857##
57c9fafe 1858{ 'type': 'ObjectPropertyInfo',
b4b12c62
AL
1859 'data': { 'name': 'str', 'type': 'str' } }
1860
1861##
1862# @qom-list:
1863#
57c9fafe 1864# This command will list any properties of a object given a path in the object
b4b12c62
AL
1865# model.
1866#
57c9fafe 1867# @path: the path within the object model. See @qom-get for a description of
b4b12c62
AL
1868# this parameter.
1869#
57c9fafe
AL
1870# Returns: a list of @ObjectPropertyInfo that describe the properties of the
1871# object.
b4b12c62 1872#
51920820 1873# Since: 1.2
b4b12c62
AL
1874##
1875{ 'command': 'qom-list',
1876 'data': { 'path': 'str' },
57c9fafe 1877 'returns': [ 'ObjectPropertyInfo' ] }
eb6e8ea5
AL
1878
1879##
1880# @qom-get:
1881#
57c9fafe 1882# This command will get a property from a object model path and return the
eb6e8ea5
AL
1883# value.
1884#
57c9fafe 1885# @path: The path within the object model. There are two forms of supported
eb6e8ea5
AL
1886# paths--absolute and partial paths.
1887#
57c9fafe 1888# Absolute paths are derived from the root object and can follow child<>
eb6e8ea5
AL
1889# or link<> properties. Since they can follow link<> properties, they
1890# can be arbitrarily long. Absolute paths look like absolute filenames
1891# and are prefixed with a leading slash.
1892#
1893# Partial paths look like relative filenames. They do not begin
1894# with a prefix. The matching rules for partial paths are subtle but
57c9fafe 1895# designed to make specifying objects easy. At each level of the
eb6e8ea5
AL
1896# composition tree, the partial path is matched as an absolute path.
1897# The first match is not returned. At least two matches are searched
1898# for. A successful result is only returned if only one match is
1899# found. If more than one match is found, a flag is return to
1900# indicate that the match was ambiguous.
1901#
1902# @property: The property name to read
1903#
1904# Returns: The property value. The type depends on the property type. legacy<>
1905# properties are returned as #str. child<> and link<> properties are
1906# returns as #str pathnames. All integer property types (u8, u16, etc)
1907# are returned as #int.
1908#
51920820 1909# Since: 1.2
eb6e8ea5
AL
1910##
1911{ 'command': 'qom-get',
1912 'data': { 'path': 'str', 'property': 'str' },
1913 'returns': 'visitor',
1914 'gen': 'no' }
1915
1916##
1917# @qom-set:
1918#
57c9fafe 1919# This command will set a property from a object model path.
eb6e8ea5
AL
1920#
1921# @path: see @qom-get for a description of this parameter
1922#
1923# @property: the property name to set
1924#
1925# @value: a value who's type is appropriate for the property type. See @qom-get
1926# for a description of type mapping.
1927#
51920820 1928# Since: 1.2
eb6e8ea5
AL
1929##
1930{ 'command': 'qom-set',
1931 'data': { 'path': 'str', 'property': 'str', 'value': 'visitor' },
1932 'gen': 'no' }
fbf796fd
LC
1933
1934##
1935# @set_password:
1936#
1937# Sets the password of a remote display session.
1938#
1939# @protocol: `vnc' to modify the VNC server password
1940# `spice' to modify the Spice server password
1941#
1942# @password: the new password
1943#
1944# @connected: #optional how to handle existing clients when changing the
b80e560b 1945# password. If nothing is specified, defaults to `keep'
fbf796fd
LC
1946# `fail' to fail the command if clients are connected
1947# `disconnect' to disconnect existing clients
1948# `keep' to maintain existing clients
1949#
1950# Returns: Nothing on success
1951# If Spice is not enabled, DeviceNotFound
fbf796fd
LC
1952#
1953# Since: 0.14.0
1954##
1955{ 'command': 'set_password',
1956 'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
9ad5372d
LC
1957
1958##
1959# @expire_password:
1960#
1961# Expire the password of a remote display server.
1962#
1963# @protocol: the name of the remote display protocol `vnc' or `spice'
1964#
1965# @time: when to expire the password.
1966# `now' to expire the password immediately
1967# `never' to cancel password expiration
1968# `+INT' where INT is the number of seconds from now (integer)
1969# `INT' where INT is the absolute time in seconds
1970#
1971# Returns: Nothing on success
1972# If @protocol is `spice' and Spice is not active, DeviceNotFound
9ad5372d
LC
1973#
1974# Since: 0.14.0
1975#
1976# Notes: Time is relative to the server and currently there is no way to
1977# coordinate server time with client time. It is not recommended to
1978# use the absolute time version of the @time parameter unless you're
1979# sure you are on the same machine as the QEMU instance.
1980##
1981{ 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
c245b6a3
LC
1982
1983##
1984# @eject:
1985#
1986# Ejects a device from a removable drive.
1987#
1988# @device: The name of the device
1989#
1990# @force: @optional If true, eject regardless of whether the drive is locked.
1991# If not specified, the default value is false.
1992#
1993# Returns: Nothing on success
1994# If @device is not a valid block device, DeviceNotFound
c245b6a3
LC
1995#
1996# Notes: Ejecting a device will no media results in success
1997#
1998# Since: 0.14.0
1999##
2000{ 'command': 'eject', 'data': {'device': 'str', '*force': 'bool'} }
270b243f
LC
2001
2002##
2003# @change-vnc-password:
2004#
2005# Change the VNC server password.
2006#
2007# @target: the new password to use with VNC authentication
2008#
2009# Since: 1.1
2010#
2011# Notes: An empty password in this command will set the password to the empty
2012# string. Existing clients are unaffected by executing this command.
2013##
2014{ 'command': 'change-vnc-password', 'data': {'password': 'str'} }
333a96ec
LC
2015
2016##
2017# @change:
2018#
2019# This command is multiple commands multiplexed together.
2020#
2021# @device: This is normally the name of a block device but it may also be 'vnc'.
2022# when it's 'vnc', then sub command depends on @target
2023#
2024# @target: If @device is a block device, then this is the new filename.
2025# If @device is 'vnc', then if the value 'password' selects the vnc
2026# change password command. Otherwise, this specifies a new server URI
2027# address to listen to for VNC connections.
2028#
2029# @arg: If @device is a block device, then this is an optional format to open
2030# the device with.
2031# If @device is 'vnc' and @target is 'password', this is the new VNC
2032# password to set. If this argument is an empty string, then no future
2033# logins will be allowed.
2034#
2035# Returns: Nothing on success.
2036# If @device is not a valid block device, DeviceNotFound
333a96ec
LC
2037# If the new block device is encrypted, DeviceEncrypted. Note that
2038# if this error is returned, the device has been opened successfully
2039# and an additional call to @block_passwd is required to set the
2040# device's password. The behavior of reads and writes to the block
2041# device between when these calls are executed is undefined.
2042#
2043# Notes: It is strongly recommended that this interface is not used especially
2044# for changing block devices.
2045#
2046# Since: 0.14.0
2047##
2048{ 'command': 'change',
2049 'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
80047da5
LC
2050
2051##
2052# @block_set_io_throttle:
2053#
2054# Change I/O throttle limits for a block drive.
2055#
2056# @device: The name of the device
2057#
2058# @bps: total throughput limit in bytes per second
2059#
2060# @bps_rd: read throughput limit in bytes per second
2061#
2062# @bps_wr: write throughput limit in bytes per second
2063#
2064# @iops: total I/O operations per second
2065#
2066# @ops_rd: read I/O operations per second
2067#
2068# @iops_wr: write I/O operations per second
2069#
2070# Returns: Nothing on success
2071# If @device is not a valid block device, DeviceNotFound
80047da5
LC
2072#
2073# Since: 1.1
b80e560b 2074##
80047da5
LC
2075{ 'command': 'block_set_io_throttle',
2076 'data': { 'device': 'str', 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
2077 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int' } }
12bd451f 2078
db58f9c0
SH
2079##
2080# @block-stream:
12bd451f
SH
2081#
2082# Copy data from a backing file into a block device.
2083#
2084# The block streaming operation is performed in the background until the entire
2085# backing file has been copied. This command returns immediately once streaming
2086# has started. The status of ongoing block streaming operations can be checked
2087# with query-block-jobs. The operation can be stopped before it has completed
db58f9c0 2088# using the block-job-cancel command.
12bd451f
SH
2089#
2090# If a base file is specified then sectors are not copied from that base file and
2091# its backing chain. When streaming completes the image file will have the base
2092# file as its backing file. This can be used to stream a subset of the backing
2093# file chain instead of flattening the entire image.
2094#
2095# On successful completion the image file is updated to drop the backing file
2096# and the BLOCK_JOB_COMPLETED event is emitted.
2097#
2098# @device: the device name
2099#
2100# @base: #optional the common backing file name
2101#
c83c66c3
SH
2102# @speed: #optional the maximum speed, in bytes per second
2103#
1d809098
PB
2104# @on-error: #optional the action to take on an error (default report).
2105# 'stop' and 'enospc' can only be used if the block device
2106# supports io-status (see BlockInfo). Since 1.3.
2107#
12bd451f 2108# Returns: Nothing on success
12bd451f 2109# If @device does not exist, DeviceNotFound
12bd451f
SH
2110#
2111# Since: 1.1
2112##
1d809098
PB
2113{ 'command': 'block-stream',
2114 'data': { 'device': 'str', '*base': 'str', '*speed': 'int',
2115 '*on-error': 'BlockdevOnError' } }
2d47c6e9
SH
2116
2117##
db58f9c0 2118# @block-job-set-speed:
2d47c6e9
SH
2119#
2120# Set maximum speed for a background block operation.
2121#
2122# This command can only be issued when there is an active block job.
2123#
2124# Throttling can be disabled by setting the speed to 0.
2125#
2126# @device: the device name
2127#
c83c66c3
SH
2128# @speed: the maximum speed, in bytes per second, or 0 for unlimited.
2129# Defaults to 0.
2d47c6e9
SH
2130#
2131# Returns: Nothing on success
05290d80 2132# If no background operation is active on this device, DeviceNotActive
2d47c6e9
SH
2133#
2134# Since: 1.1
2135##
db58f9c0 2136{ 'command': 'block-job-set-speed',
882ec7ce 2137 'data': { 'device': 'str', 'speed': 'int' } }
370521a1
SH
2138
2139##
db58f9c0 2140# @block-job-cancel:
370521a1 2141#
05290d80 2142# Stop an active background block operation.
370521a1 2143#
05290d80 2144# This command returns immediately after marking the active background block
370521a1
SH
2145# operation for cancellation. It is an error to call this command if no
2146# operation is in progress.
2147#
2148# The operation will cancel as soon as possible and then emit the
2149# BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
2150# enumerated using query-block-jobs.
2151#
05290d80
PB
2152# For streaming, the image file retains its backing file unless the streaming
2153# operation happens to complete just as it is being cancelled. A new streaming
2154# operation can be started at a later time to finish copying all data from the
2155# backing file.
370521a1
SH
2156#
2157# @device: the device name
2158#
6e37fb81
PB
2159# @force: #optional whether to allow cancellation of a paused job (default
2160# false). Since 1.3.
2161#
370521a1 2162# Returns: Nothing on success
05290d80 2163# If no background operation is active on this device, DeviceNotActive
370521a1
SH
2164#
2165# Since: 1.1
2166##
6e37fb81
PB
2167{ 'command': 'block-job-cancel', 'data': { 'device': 'str', '*force': 'bool' } }
2168
2169##
2170# @block-job-pause:
2171#
2172# Pause an active background block operation.
2173#
2174# This command returns immediately after marking the active background block
2175# operation for pausing. It is an error to call this command if no
2176# operation is in progress. Pausing an already paused job has no cumulative
2177# effect; a single block-job-resume command will resume the job.
2178#
2179# The operation will pause as soon as possible. No event is emitted when
2180# the operation is actually paused. Cancelling a paused job automatically
2181# resumes it.
2182#
2183# @device: the device name
2184#
2185# Returns: Nothing on success
2186# If no background operation is active on this device, DeviceNotActive
2187#
2188# Since: 1.3
2189##
2190{ 'command': 'block-job-pause', 'data': { 'device': 'str' } }
2191
2192##
2193# @block-job-resume:
2194#
2195# Resume an active background block operation.
2196#
2197# This command returns immediately after resuming a paused background block
2198# operation. It is an error to call this command if no operation is in
2199# progress. Resuming an already running job is not an error.
2200#
32c81a4a
PB
2201# This command also clears the error status of the job.
2202#
6e37fb81
PB
2203# @device: the device name
2204#
2205# Returns: Nothing on success
2206# If no background operation is active on this device, DeviceNotActive
2207#
2208# Since: 1.3
2209##
2210{ 'command': 'block-job-resume', 'data': { 'device': 'str' } }
5eeee3fa 2211
aeae883b
PB
2212##
2213# @block-job-complete:
2214#
2215# Manually trigger completion of an active background block operation. This
2216# is supported for drive mirroring, where it also switches the device to
a66a2a36
PB
2217# write to the target path only. The ability to complete is signaled with
2218# a BLOCK_JOB_READY event.
aeae883b
PB
2219#
2220# This command completes an active background block operation synchronously.
2221# The ordering of this command's return with the BLOCK_JOB_COMPLETED event
2222# is not defined. Note that if an I/O error occurs during the processing of
2223# this command: 1) the command itself will fail; 2) the error will be processed
2224# according to the rerror/werror arguments that were specified when starting
2225# the operation.
2226#
2227# A cancelled or paused job cannot be completed.
2228#
2229# @device: the device name
2230#
2231# Returns: Nothing on success
2232# If no background operation is active on this device, DeviceNotActive
2233#
2234# Since: 1.3
2235##
2236{ 'command': 'block-job-complete', 'data': { 'device': 'str' } }
2237
5eeee3fa
AL
2238##
2239# @ObjectTypeInfo:
2240#
2241# This structure describes a search result from @qom-list-types
2242#
2243# @name: the type name found in the search
2244#
2245# Since: 1.1
2246#
2247# Notes: This command is experimental and may change syntax in future releases.
2248##
2249{ 'type': 'ObjectTypeInfo',
2250 'data': { 'name': 'str' } }
2251
2252##
2253# @qom-list-types:
2254#
2255# This command will return a list of types given search parameters
2256#
2257# @implements: if specified, only return types that implement this type name
2258#
2259# @abstract: if true, include abstract types in the results
2260#
2261# Returns: a list of @ObjectTypeInfo or an empty list if no results are found
2262#
2263# Since: 1.1
5eeee3fa
AL
2264##
2265{ 'command': 'qom-list-types',
2266 'data': { '*implements': 'str', '*abstract': 'bool' },
2267 'returns': [ 'ObjectTypeInfo' ] }
e1c37d0e 2268
1daa31b9
AL
2269##
2270# @DevicePropertyInfo:
2271#
2272# Information about device properties.
2273#
2274# @name: the name of the property
2275# @type: the typename of the property
2276#
2277# Since: 1.2
2278##
2279{ 'type': 'DevicePropertyInfo',
2280 'data': { 'name': 'str', 'type': 'str' } }
2281
2282##
2283# @device-list-properties:
2284#
2285# List properties associated with a device.
2286#
2287# @typename: the type name of a device
2288#
2289# Returns: a list of DevicePropertyInfo describing a devices properties
2290#
2291# Since: 1.2
2292##
2293{ 'command': 'device-list-properties',
2294 'data': { 'typename': 'str'},
2295 'returns': [ 'DevicePropertyInfo' ] }
2296
e1c37d0e
LC
2297##
2298# @migrate
2299#
2300# Migrates the current running guest to another Virtual Machine.
2301#
2302# @uri: the Uniform Resource Identifier of the destination VM
2303#
2304# @blk: #optional do block migration (full disk copy)
2305#
2306# @inc: #optional incremental disk copy migration
2307#
2308# @detach: this argument exists only for compatibility reasons and
2309# is ignored by QEMU
2310#
2311# Returns: nothing on success
2312#
2313# Since: 0.14.0
2314##
2315{ 'command': 'migrate',
2316 'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
33cf629a 2317
a7ae8355
SS
2318# @xen-save-devices-state:
2319#
2320# Save the state of all devices to file. The RAM and the block devices
2321# of the VM are not saved by this command.
2322#
2323# @filename: the file to save the state of the devices to as binary
2324# data. See xen-save-devices-state.txt for a description of the binary
2325# format.
2326#
2327# Returns: Nothing on success
a7ae8355
SS
2328#
2329# Since: 1.1
2330##
2331{ 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
a15fef21 2332
39f42439
AP
2333##
2334# @xen-set-global-dirty-log
2335#
2336# Enable or disable the global dirty log mode.
2337#
2338# @enable: true to enable, false to disable.
2339#
2340# Returns: nothing
2341#
2342# Since: 1.3
2343##
2344{ 'command': 'xen-set-global-dirty-log', 'data': { 'enable': 'bool' } }
2345
a15fef21
LC
2346##
2347# @device_del:
2348#
2349# Remove a device from a guest
2350#
2351# @id: the name of the device
2352#
2353# Returns: Nothing on success
2354# If @id is not a valid device, DeviceNotFound
a15fef21
LC
2355#
2356# Notes: When this command completes, the device may not be removed from the
2357# guest. Hot removal is an operation that requires guest cooperation.
2358# This command merely requests that the guest begin the hot removal
0402a5d6
MT
2359# process. Completion of the device removal process is signaled with a
2360# DEVICE_DELETED event. Guest reset will automatically complete removal
2361# for all devices.
a15fef21
LC
2362#
2363# Since: 0.14.0
2364##
2365{ 'command': 'device_del', 'data': {'id': 'str'} }
783e9b48
WC
2366
2367##
2368# @dump-guest-memory
2369#
2370# Dump guest's memory to vmcore. It is a synchronous operation that can take
2371# very long depending on the amount of guest memory. This command is only
f5b0d93b
LC
2372# supported on i386 and x86_64.
2373#
2374# @paging: if true, do paging to get guest's memory mapping. This allows
d691180e 2375# using gdb to process the core file.
f5b0d93b 2376#
d691180e
LC
2377# IMPORTANT: this option can make QEMU allocate several gigabytes
2378# of RAM. This can happen for a large guest, or a
2379# malicious guest pretending to be large.
2380#
2381# Also, paging=true has the following limitations:
2382#
2383# 1. The guest may be in a catastrophic state or can have corrupted
2384# memory, which cannot be trusted
2385# 2. The guest can be in real-mode even if paging is enabled. For
2386# example, the guest uses ACPI to sleep, and ACPI sleep state
2387# goes in real-mode
f5b0d93b 2388#
783e9b48 2389# @protocol: the filename or file descriptor of the vmcore. The supported
d691180e 2390# protocols are:
f5b0d93b 2391#
d691180e
LC
2392# 1. file: the protocol starts with "file:", and the following
2393# string is the file's path.
2394# 2. fd: the protocol starts with "fd:", and the following string
2395# is the fd's name.
f5b0d93b 2396#
783e9b48 2397# @begin: #optional if specified, the starting physical address.
f5b0d93b 2398#
783e9b48 2399# @length: #optional if specified, the memory size, in bytes. If you don't
d691180e
LC
2400# want to dump all guest's memory, please specify the start @begin
2401# and @length
783e9b48
WC
2402#
2403# Returns: nothing on success
783e9b48
WC
2404#
2405# Since: 1.2
2406##
2407{ 'command': 'dump-guest-memory',
2408 'data': { 'paging': 'bool', 'protocol': 'str', '*begin': 'int',
2409 '*length': 'int' } }
d691180e 2410
928059a3
LC
2411##
2412# @netdev_add:
2413#
2414# Add a network backend.
2415#
2416# @type: the type of network backend. Current valid values are 'user', 'tap',
2417# 'vde', 'socket', 'dump' and 'bridge'
2418#
2419# @id: the name of the new network backend
2420#
2421# @props: #optional a list of properties to be passed to the backend in
2422# the format 'name=value', like 'ifname=tap0,script=no'
2423#
2424# Notes: The semantics of @props is not well defined. Future commands will be
2425# introduced that provide stronger typing for backend creation.
2426#
2427# Since: 0.14.0
2428#
2429# Returns: Nothing on success
2430# If @type is not a valid network backend, DeviceNotFound
928059a3
LC
2431##
2432{ 'command': 'netdev_add',
2433 'data': {'type': 'str', 'id': 'str', '*props': '**'},
2434 'gen': 'no' }
5f964155
LC
2435
2436##
2437# @netdev_del:
2438#
2439# Remove a network backend.
2440#
2441# @id: the name of the network backend to remove
2442#
2443# Returns: Nothing on success
2444# If @id is not a valid network backend, DeviceNotFound
2445#
2446# Since: 0.14.0
2447##
2448{ 'command': 'netdev_del', 'data': {'id': 'str'} }
208c9d1b 2449
14aa0c2d
LE
2450##
2451# @NetdevNoneOptions
2452#
2453# Use it alone to have zero network devices.
2454#
2455# Since 1.2
2456##
2457{ 'type': 'NetdevNoneOptions',
2458 'data': { } }
2459
2460##
2461# @NetLegacyNicOptions
2462#
2463# Create a new Network Interface Card.
2464#
2465# @netdev: #optional id of -netdev to connect to
2466#
2467# @macaddr: #optional MAC address
2468#
2469# @model: #optional device model (e1000, rtl8139, virtio etc.)
2470#
2471# @addr: #optional PCI device address
2472#
2473# @vectors: #optional number of MSI-x vectors, 0 to disable MSI-X
2474#
2475# Since 1.2
2476##
2477{ 'type': 'NetLegacyNicOptions',
2478 'data': {
2479 '*netdev': 'str',
2480 '*macaddr': 'str',
2481 '*model': 'str',
2482 '*addr': 'str',
2483 '*vectors': 'uint32' } }
2484
2485##
2486# @String
2487#
2488# A fat type wrapping 'str', to be embedded in lists.
2489#
2490# Since 1.2
2491##
2492{ 'type': 'String',
2493 'data': {
2494 'str': 'str' } }
2495
2496##
2497# @NetdevUserOptions
2498#
2499# Use the user mode network stack which requires no administrator privilege to
2500# run.
2501#
2502# @hostname: #optional client hostname reported by the builtin DHCP server
2503#
2504# @restrict: #optional isolate the guest from the host
2505#
2506# @ip: #optional legacy parameter, use net= instead
2507#
2508# @net: #optional IP address and optional netmask
2509#
2510# @host: #optional guest-visible address of the host
2511#
2512# @tftp: #optional root directory of the built-in TFTP server
2513#
2514# @bootfile: #optional BOOTP filename, for use with tftp=
2515#
2516# @dhcpstart: #optional the first of the 16 IPs the built-in DHCP server can
2517# assign
2518#
2519# @dns: #optional guest-visible address of the virtual nameserver
2520#
63d2960b
KS
2521# @dnssearch: #optional list of DNS suffixes to search, passed as DHCP option
2522# to the guest
2523#
14aa0c2d
LE
2524# @smb: #optional root directory of the built-in SMB server
2525#
2526# @smbserver: #optional IP address of the built-in SMB server
2527#
2528# @hostfwd: #optional redirect incoming TCP or UDP host connections to guest
2529# endpoints
2530#
2531# @guestfwd: #optional forward guest TCP connections
2532#
2533# Since 1.2
2534##
2535{ 'type': 'NetdevUserOptions',
2536 'data': {
2537 '*hostname': 'str',
2538 '*restrict': 'bool',
2539 '*ip': 'str',
2540 '*net': 'str',
2541 '*host': 'str',
2542 '*tftp': 'str',
2543 '*bootfile': 'str',
2544 '*dhcpstart': 'str',
2545 '*dns': 'str',
63d2960b 2546 '*dnssearch': ['String'],
14aa0c2d
LE
2547 '*smb': 'str',
2548 '*smbserver': 'str',
2549 '*hostfwd': ['String'],
2550 '*guestfwd': ['String'] } }
2551
2552##
2553# @NetdevTapOptions
2554#
2555# Connect the host TAP network interface name to the VLAN.
2556#
2557# @ifname: #optional interface name
2558#
2559# @fd: #optional file descriptor of an already opened tap
2560#
2ca81baa
JW
2561# @fds: #optional multiple file descriptors of already opened multiqueue capable
2562# tap
2563#
14aa0c2d
LE
2564# @script: #optional script to initialize the interface
2565#
2566# @downscript: #optional script to shut down the interface
2567#
2568# @helper: #optional command to execute to configure bridge
2569#
2570# @sndbuf: #optional send buffer limit. Understands [TGMKkb] suffixes.
2571#
2572# @vnet_hdr: #optional enable the IFF_VNET_HDR flag on the tap interface
2573#
2574# @vhost: #optional enable vhost-net network accelerator
2575#
2576# @vhostfd: #optional file descriptor of an already opened vhost net device
2577#
2ca81baa
JW
2578# @vhostfds: #optional file descriptors of multiple already opened vhost net
2579# devices
2580#
14aa0c2d
LE
2581# @vhostforce: #optional vhost on for non-MSIX virtio guests
2582#
ec396014
JW
2583# @queues: #optional number of queues to be created for multiqueue capable tap
2584#
14aa0c2d
LE
2585# Since 1.2
2586##
2587{ 'type': 'NetdevTapOptions',
2588 'data': {
2589 '*ifname': 'str',
2590 '*fd': 'str',
264986e2 2591 '*fds': 'str',
14aa0c2d
LE
2592 '*script': 'str',
2593 '*downscript': 'str',
2594 '*helper': 'str',
2595 '*sndbuf': 'size',
2596 '*vnet_hdr': 'bool',
2597 '*vhost': 'bool',
2598 '*vhostfd': 'str',
264986e2
JW
2599 '*vhostfds': 'str',
2600 '*vhostforce': 'bool',
2601 '*queues': 'uint32'} }
14aa0c2d
LE
2602
2603##
2604# @NetdevSocketOptions
2605#
2606# Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP
2607# socket connection.
2608#
2609# @fd: #optional file descriptor of an already opened socket
2610#
2611# @listen: #optional port number, and optional hostname, to listen on
2612#
2613# @connect: #optional port number, and optional hostname, to connect to
2614#
2615# @mcast: #optional UDP multicast address and port number
2616#
2617# @localaddr: #optional source address and port for multicast and udp packets
2618#
2619# @udp: #optional UDP unicast address and port number
2620#
2621# Since 1.2
2622##
2623{ 'type': 'NetdevSocketOptions',
2624 'data': {
2625 '*fd': 'str',
2626 '*listen': 'str',
2627 '*connect': 'str',
2628 '*mcast': 'str',
2629 '*localaddr': 'str',
2630 '*udp': 'str' } }
2631
2632##
2633# @NetdevVdeOptions
2634#
2635# Connect the VLAN to a vde switch running on the host.
2636#
2637# @sock: #optional socket path
2638#
2639# @port: #optional port number
2640#
2641# @group: #optional group owner of socket
2642#
2643# @mode: #optional permissions for socket
2644#
2645# Since 1.2
2646##
2647{ 'type': 'NetdevVdeOptions',
2648 'data': {
2649 '*sock': 'str',
2650 '*port': 'uint16',
2651 '*group': 'str',
2652 '*mode': 'uint16' } }
2653
2654##
2655# @NetdevDumpOptions
2656#
2657# Dump VLAN network traffic to a file.
2658#
2659# @len: #optional per-packet size limit (64k default). Understands [TGMKkb]
2660# suffixes.
2661#
2662# @file: #optional dump file path (default is qemu-vlan0.pcap)
2663#
2664# Since 1.2
2665##
2666{ 'type': 'NetdevDumpOptions',
2667 'data': {
2668 '*len': 'size',
2669 '*file': 'str' } }
2670
2671##
2672# @NetdevBridgeOptions
2673#
2674# Connect a host TAP network interface to a host bridge device.
2675#
2676# @br: #optional bridge name
2677#
2678# @helper: #optional command to execute to configure bridge
2679#
2680# Since 1.2
2681##
2682{ 'type': 'NetdevBridgeOptions',
2683 'data': {
2684 '*br': 'str',
2685 '*helper': 'str' } }
2686
f6c874e3
SH
2687##
2688# @NetdevHubPortOptions
2689#
2690# Connect two or more net clients through a software hub.
2691#
2692# @hubid: hub identifier number
2693#
2694# Since 1.2
2695##
2696{ 'type': 'NetdevHubPortOptions',
2697 'data': {
2698 'hubid': 'int32' } }
2699
14aa0c2d
LE
2700##
2701# @NetClientOptions
2702#
2703# A discriminated record of network device traits.
2704#
2705# Since 1.2
2706##
2707{ 'union': 'NetClientOptions',
2708 'data': {
f6c874e3
SH
2709 'none': 'NetdevNoneOptions',
2710 'nic': 'NetLegacyNicOptions',
2711 'user': 'NetdevUserOptions',
2712 'tap': 'NetdevTapOptions',
2713 'socket': 'NetdevSocketOptions',
2714 'vde': 'NetdevVdeOptions',
2715 'dump': 'NetdevDumpOptions',
2716 'bridge': 'NetdevBridgeOptions',
2717 'hubport': 'NetdevHubPortOptions' } }
14aa0c2d
LE
2718
2719##
2720# @NetLegacy
2721#
2722# Captures the configuration of a network device; legacy.
2723#
2724# @vlan: #optional vlan number
2725#
2726# @id: #optional identifier for monitor commands
2727#
2728# @name: #optional identifier for monitor commands, ignored if @id is present
2729#
2730# @opts: device type specific properties (legacy)
2731#
2732# Since 1.2
2733##
2734{ 'type': 'NetLegacy',
2735 'data': {
2736 '*vlan': 'int32',
2737 '*id': 'str',
2738 '*name': 'str',
2739 'opts': 'NetClientOptions' } }
2740
2741##
2742# @Netdev
2743#
2744# Captures the configuration of a network device.
2745#
2746# @id: identifier for monitor commands.
2747#
2748# @opts: device type specific properties
2749#
2750# Since 1.2
2751##
2752{ 'type': 'Netdev',
2753 'data': {
2754 'id': 'str',
2755 'opts': 'NetClientOptions' } }
2756
5be8c759
PB
2757##
2758# @InetSocketAddress
2759#
2760# Captures a socket address or address range in the Internet namespace.
2761#
2762# @host: host part of the address
2763#
2764# @port: port part of the address, or lowest port if @to is present
2765#
2766# @to: highest port to try
2767#
2768# @ipv4: whether to accept IPv4 addresses, default try both IPv4 and IPv6
2769# #optional
2770#
2771# @ipv6: whether to accept IPv6 addresses, default try both IPv4 and IPv6
2772# #optional
2773#
2774# Since 1.3
2775##
2776{ 'type': 'InetSocketAddress',
2777 'data': {
2778 'host': 'str',
2779 'port': 'str',
2780 '*to': 'uint16',
2781 '*ipv4': 'bool',
2782 '*ipv6': 'bool' } }
2783
2784##
2785# @UnixSocketAddress
2786#
2787# Captures a socket address in the local ("Unix socket") namespace.
2788#
2789# @path: filesystem path to use
2790#
2791# Since 1.3
2792##
2793{ 'type': 'UnixSocketAddress',
2794 'data': {
2795 'path': 'str' } }
2796
2797##
2798# @SocketAddress
2799#
2800# Captures the address of a socket, which could also be a named file descriptor
2801#
2802# Since 1.3
2803##
2804{ 'union': 'SocketAddress',
2805 'data': {
2806 'inet': 'InetSocketAddress',
2807 'unix': 'UnixSocketAddress',
2808 'fd': 'String' } }
2809
208c9d1b
CB
2810##
2811# @getfd:
2812#
2813# Receive a file descriptor via SCM rights and assign it a name
2814#
2815# @fdname: file descriptor name
2816#
2817# Returns: Nothing on success
208c9d1b
CB
2818#
2819# Since: 0.14.0
2820#
2821# Notes: If @fdname already exists, the file descriptor assigned to
2822# it will be closed and replaced by the received file
2823# descriptor.
2824# The 'closefd' command can be used to explicitly close the
2825# file descriptor when it is no longer needed.
2826##
2827{ 'command': 'getfd', 'data': {'fdname': 'str'} }
2828
2829##
2830# @closefd:
2831#
2832# Close a file descriptor previously passed via SCM rights
2833#
2834# @fdname: file descriptor name
2835#
2836# Returns: Nothing on success
208c9d1b
CB
2837#
2838# Since: 0.14.0
2839##
2840{ 'command': 'closefd', 'data': {'fdname': 'str'} }
01d3c80d
AL
2841
2842##
2843# @MachineInfo:
2844#
2845# Information describing a machine.
2846#
2847# @name: the name of the machine
2848#
2849# @alias: #optional an alias for the machine name
2850#
2851# @default: #optional whether the machine is default
2852#
c72e7688
MN
2853# @cpu-max: maximum number of CPUs supported by the machine type
2854# (since 1.5.0)
2855#
01d3c80d
AL
2856# Since: 1.2.0
2857##
2858{ 'type': 'MachineInfo',
2859 'data': { 'name': 'str', '*alias': 'str',
c72e7688 2860 '*is-default': 'bool', 'cpu-max': 'int' } }
01d3c80d
AL
2861
2862##
2863# @query-machines:
2864#
2865# Return a list of supported machines
2866#
2867# Returns: a list of MachineInfo
2868#
2869# Since: 1.2.0
2870##
2871{ 'command': 'query-machines', 'returns': ['MachineInfo'] }
e4e31c63
AL
2872
2873##
2874# @CpuDefinitionInfo:
2875#
2876# Virtual CPU definition.
2877#
2878# @name: the name of the CPU definition
2879#
2880# Since: 1.2.0
2881##
2882{ 'type': 'CpuDefinitionInfo',
2883 'data': { 'name': 'str' } }
2884
2885##
2886# @query-cpu-definitions:
2887#
2888# Return a list of supported virtual CPU definitions
2889#
2890# Returns: a list of CpuDefInfo
2891#
2892# Since: 1.2.0
2893##
2894{ 'command': 'query-cpu-definitions', 'returns': ['CpuDefinitionInfo'] }
ba1c048a
CB
2895
2896# @AddfdInfo:
2897#
2898# Information about a file descriptor that was added to an fd set.
2899#
2900# @fdset-id: The ID of the fd set that @fd was added to.
2901#
2902# @fd: The file descriptor that was received via SCM rights and
2903# added to the fd set.
2904#
2905# Since: 1.2.0
2906##
2907{ 'type': 'AddfdInfo', 'data': {'fdset-id': 'int', 'fd': 'int'} }
2908
2909##
2910# @add-fd:
2911#
2912# Add a file descriptor, that was passed via SCM rights, to an fd set.
2913#
2914# @fdset-id: #optional The ID of the fd set to add the file descriptor to.
2915#
2916# @opaque: #optional A free-form string that can be used to describe the fd.
2917#
2918# Returns: @AddfdInfo on success
2919# If file descriptor was not received, FdNotSupplied
9ac54af0 2920# If @fdset-id is a negative value, InvalidParameterValue
ba1c048a
CB
2921#
2922# Notes: The list of fd sets is shared by all monitor connections.
2923#
2924# If @fdset-id is not specified, a new fd set will be created.
2925#
2926# Since: 1.2.0
2927##
2928{ 'command': 'add-fd', 'data': {'*fdset-id': 'int', '*opaque': 'str'},
2929 'returns': 'AddfdInfo' }
2930
2931##
2932# @remove-fd:
2933#
2934# Remove a file descriptor from an fd set.
2935#
2936# @fdset-id: The ID of the fd set that the file descriptor belongs to.
2937#
2938# @fd: #optional The file descriptor that is to be removed.
2939#
2940# Returns: Nothing on success
2941# If @fdset-id or @fd is not found, FdNotFound
2942#
2943# Since: 1.2.0
2944#
2945# Notes: The list of fd sets is shared by all monitor connections.
2946#
2947# If @fd is not specified, all file descriptors in @fdset-id
2948# will be removed.
2949##
2950{ 'command': 'remove-fd', 'data': {'fdset-id': 'int', '*fd': 'int'} }
2951
2952##
2953# @FdsetFdInfo:
2954#
2955# Information about a file descriptor that belongs to an fd set.
2956#
2957# @fd: The file descriptor value.
2958#
2959# @opaque: #optional A free-form string that can be used to describe the fd.
2960#
2961# Since: 1.2.0
2962##
2963{ 'type': 'FdsetFdInfo',
2964 'data': {'fd': 'int', '*opaque': 'str'} }
2965
2966##
2967# @FdsetInfo:
2968#
2969# Information about an fd set.
2970#
2971# @fdset-id: The ID of the fd set.
2972#
2973# @fds: A list of file descriptors that belong to this fd set.
2974#
2975# Since: 1.2.0
2976##
2977{ 'type': 'FdsetInfo',
2978 'data': {'fdset-id': 'int', 'fds': ['FdsetFdInfo']} }
2979
2980##
2981# @query-fdsets:
2982#
2983# Return information describing all fd sets.
2984#
2985# Returns: A list of @FdsetInfo
2986#
2987# Since: 1.2.0
2988#
2989# Note: The list of fd sets is shared by all monitor connections.
2990#
2991##
2992{ 'command': 'query-fdsets', 'returns': ['FdsetInfo'] }
99afc91d
DB
2993
2994##
2995# @TargetType
2996#
2997# Target CPU emulation type
2998#
2999# These parameters correspond to the softmmu binary CPU name that is currently
3000# running.
3001#
3002# Since: 1.2.0
3003##
3004{ 'enum': 'TargetType',
3005 'data': [ 'alpha', 'arm', 'cris', 'i386', 'lm32', 'm68k', 'microblazeel',
d15a9c23
AG
3006 'microblaze', 'mips64el', 'mips64', 'mipsel', 'mips', 'moxie',
3007 'or32', 'ppc64', 'ppcemb', 'ppc', 's390x', 'sh4eb', 'sh4',
3008 'sparc64', 'sparc', 'unicore32', 'x86_64', 'xtensaeb', 'xtensa' ] }
99afc91d
DB
3009
3010##
3011# @TargetInfo:
3012#
3013# Information describing the QEMU target.
3014#
3015# @arch: the target architecture (eg "x86_64", "i386", etc)
3016#
3017# Since: 1.2.0
3018##
3019{ 'type': 'TargetInfo',
3020 'data': { 'arch': 'TargetType' } }
3021
3022##
3023# @query-target:
3024#
3025# Return information about the target for this QEMU
3026#
3027# Returns: TargetInfo
3028#
3029# Since: 1.2.0
3030##
3031{ 'command': 'query-target', 'returns': 'TargetInfo' }
411656f4
AK
3032
3033##
3034# @QKeyCode:
3035#
3036# An enumeration of key name.
3037#
3038# This is used by the send-key command.
3039#
3040# Since: 1.3.0
3041##
3042{ 'enum': 'QKeyCode',
3043 'data': [ 'shift', 'shift_r', 'alt', 'alt_r', 'altgr', 'altgr_r', 'ctrl',
3044 'ctrl_r', 'menu', 'esc', '1', '2', '3', '4', '5', '6', '7', '8',
3045 '9', '0', 'minus', 'equal', 'backspace', 'tab', 'q', 'w', 'e',
3046 'r', 't', 'y', 'u', 'i', 'o', 'p', 'bracket_left', 'bracket_right',
3047 'ret', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'semicolon',
3048 'apostrophe', 'grave_accent', 'backslash', 'z', 'x', 'c', 'v', 'b',
3049 'n', 'm', 'comma', 'dot', 'slash', 'asterisk', 'spc', 'caps_lock',
3050 'f1', 'f2', 'f3', 'f4', 'f5', 'f6', 'f7', 'f8', 'f9', 'f10',
3051 'num_lock', 'scroll_lock', 'kp_divide', 'kp_multiply',
3052 'kp_subtract', 'kp_add', 'kp_enter', 'kp_decimal', 'sysrq', 'kp_0',
3053 'kp_1', 'kp_2', 'kp_3', 'kp_4', 'kp_5', 'kp_6', 'kp_7', 'kp_8',
3054 'kp_9', 'less', 'f11', 'f12', 'print', 'home', 'pgup', 'pgdn', 'end',
3055 'left', 'up', 'down', 'right', 'insert', 'delete', 'stop', 'again',
3056 'props', 'undo', 'front', 'copy', 'open', 'paste', 'find', 'cut',
3057 'lf', 'help', 'meta_l', 'meta_r', 'compose' ] }
e4c8f004 3058
9f328977
LC
3059##
3060# @KeyValue
3061#
3062# Represents a keyboard key.
3063#
3064# Since: 1.3.0
3065##
3066{ 'union': 'KeyValue',
3067 'data': {
3068 'number': 'int',
3069 'qcode': 'QKeyCode' } }
3070
e4c8f004
AK
3071##
3072# @send-key:
3073#
3074# Send keys to guest.
3075#
9f328977
LC
3076# @keys: An array of @KeyValue elements. All @KeyValues in this array are
3077# simultaneously sent to the guest. A @KeyValue.number value is sent
3078# directly to the guest, while @KeyValue.qcode must be a valid
3079# @QKeyCode value
e4c8f004
AK
3080#
3081# @hold-time: #optional time to delay key up events, milliseconds. Defaults
3082# to 100
3083#
3084# Returns: Nothing on success
3085# If key is unknown or redundant, InvalidParameter
3086#
3087# Since: 1.3.0
3088#
3089##
3090{ 'command': 'send-key',
9f328977 3091 'data': { 'keys': ['KeyValue'], '*hold-time': 'int' } }
ad39cf6d
LC
3092
3093##
3094# @screendump:
3095#
3096# Write a PPM of the VGA screen to a file.
3097#
3098# @filename: the path of a new PPM file to store the image
3099#
3100# Returns: Nothing on success
3101#
3102# Since: 0.14.0
3103##
3104{ 'command': 'screendump', 'data': {'filename': 'str'} }
6dd844db
PB
3105
3106##
3107# @nbd-server-start:
3108#
3109# Start an NBD server listening on the given host and port. Block
3110# devices can then be exported using @nbd-server-add. The NBD
3111# server will present them as named exports; for example, another
3112# QEMU instance could refer to them as "nbd:HOST:PORT:exportname=NAME".
3113#
3114# @addr: Address on which to listen.
3115#
3116# Returns: error if the server is already running.
3117#
3118# Since: 1.3.0
3119##
3120{ 'command': 'nbd-server-start',
3121 'data': { 'addr': 'SocketAddress' } }
3122
3123##
3124# @nbd-server-add:
3125#
3126# Export a device to QEMU's embedded NBD server.
3127#
3128# @device: Block device to be exported
3129#
3130# @writable: Whether clients should be able to write to the device via the
3131# NBD connection (default false). #optional
3132#
3133# Returns: error if the device is already marked for export.
3134#
3135# Since: 1.3.0
3136##
3137{ 'command': 'nbd-server-add', 'data': {'device': 'str', '*writable': 'bool'} }
3138
3139##
3140# @nbd-server-stop:
3141#
3142# Stop QEMU's embedded NBD server, and unregister all devices previously
3143# added via @nbd-server-add.
3144#
3145# Since: 1.3.0
3146##
3147{ 'command': 'nbd-server-stop' }
f1a1a356 3148
ffbdbe59
GH
3149##
3150# @ChardevFile:
3151#
3152# Configuration info for file chardevs.
3153#
3154# @in: #optional The name of the input file
3155# @out: The name of the output file
3156#
3157# Since: 1.4
3158##
3159{ 'type': 'ChardevFile', 'data': { '*in' : 'str',
3160 'out' : 'str' } }
3161
d59044ef 3162##
d36b2b90 3163# @ChardevHostdev:
d59044ef 3164#
548cbb36 3165# Configuration info for device and pipe chardevs.
d59044ef
GH
3166#
3167# @device: The name of the special file for the device,
3168# i.e. /dev/ttyS0 on Unix or COM1: on Windows
3169# @type: What kind of device this is.
3170#
3171# Since: 1.4
3172##
d36b2b90 3173{ 'type': 'ChardevHostdev', 'data': { 'device' : 'str' } }
d59044ef 3174
f6bd5d6e
GH
3175##
3176# @ChardevSocket:
3177#
3ecc059d 3178# Configuration info for (stream) socket chardevs.
f6bd5d6e
GH
3179#
3180# @addr: socket address to listen on (server=true)
3181# or connect to (server=false)
3182# @server: #optional create server socket (default: true)
3183# @wait: #optional wait for connect (not used for server
3184# sockets, default: false)
3185# @nodelay: #optional set TCP_NODELAY socket option (default: false)
3186# @telnet: #optional enable telnet protocol (default: false)
3187#
3188# Since: 1.4
3189##
3190{ 'type': 'ChardevSocket', 'data': { 'addr' : 'SocketAddress',
3191 '*server' : 'bool',
3192 '*wait' : 'bool',
3193 '*nodelay' : 'bool',
3194 '*telnet' : 'bool' } }
3195
3ecc059d
GH
3196##
3197# @ChardevDgram:
3198#
3199# Configuration info for datagram socket chardevs.
3200#
3201# @remote: remote address
3202# @local: #optional local address
3203#
3204# Since: 1.5
3205##
3206{ 'type': 'ChardevDgram', 'data': { 'remote' : 'SocketAddress',
3207 '*local' : 'SocketAddress' } }
3208
edb2fb3c
GH
3209##
3210# @ChardevMux:
3211#
3212# Configuration info for mux chardevs.
3213#
3214# @chardev: name of the base chardev.
3215#
3216# Since: 1.5
3217##
3218{ 'type': 'ChardevMux', 'data': { 'chardev' : 'str' } }
3219
7c358031
GH
3220##
3221# @ChardevStdio:
3222#
3223# Configuration info for stdio chardevs.
3224#
3225# @signal: #optional Allow signals (such as SIGINT triggered by ^C)
3226# be delivered to qemu. Default: true in -nographic mode,
3227# false otherwise.
3228#
3229# Since: 1.5
3230##
3231{ 'type': 'ChardevStdio', 'data': { '*signal' : 'bool' } }
3232
cd153e2a
GH
3233##
3234# @ChardevSpiceChannel:
3235#
3236# Configuration info for spice vm channel chardevs.
3237#
3238# @type: kind of channel (for example vdagent).
3239#
3240# Since: 1.5
3241##
3242{ 'type': 'ChardevSpiceChannel', 'data': { 'type' : 'str' } }
3243
3244##
3245# @ChardevSpicePort:
3246#
3247# Configuration info for spice port chardevs.
3248#
3249# @fqdn: name of the channel (see docs/spice-port-fqdn.txt)
3250#
3251# Since: 1.5
3252##
3253{ 'type': 'ChardevSpicePort', 'data': { 'fqdn' : 'str' } }
3254
702ec69c
GH
3255##
3256# @ChardevVC:
3257#
3258# Configuration info for virtual console chardevs.
3259#
3260# @width: console width, in pixels
3261# @height: console height, in pixels
3262# @cols: console width, in chars
3263# @rows: console height, in chars
3264#
3265# Since: 1.5
3266##
3267{ 'type': 'ChardevVC', 'data': { '*width' : 'int',
3268 '*height' : 'int',
3269 '*cols' : 'int',
3270 '*rows' : 'int' } }
3271
1da48c65
GH
3272##
3273# @ChardevRingbuf:
3274#
3275# Configuration info for memory chardevs
3276#
3277# @size: #optional Ringbuffer size, must be power of two, default is 65536
3278#
3279# Since: 1.5
3280##
3281{ 'type': 'ChardevRingbuf', 'data': { '*size' : 'int' } }
3282
f1a1a356
GH
3283##
3284# @ChardevBackend:
3285#
3286# Configuration info for the new chardev backend.
3287#
3288# Since: 1.4
3289##
3290{ 'type': 'ChardevDummy', 'data': { } }
3291
f6bd5d6e 3292{ 'union': 'ChardevBackend', 'data': { 'file' : 'ChardevFile',
d36b2b90
MA
3293 'serial' : 'ChardevHostdev',
3294 'parallel': 'ChardevHostdev',
548cbb36 3295 'pipe' : 'ChardevHostdev',
f6bd5d6e 3296 'socket' : 'ChardevSocket',
3ecc059d 3297 'dgram' : 'ChardevDgram',
0a1a7fab 3298 'pty' : 'ChardevDummy',
edb2fb3c 3299 'null' : 'ChardevDummy',
f5a51cab 3300 'mux' : 'ChardevMux',
2d57286d 3301 'msmouse': 'ChardevDummy',
7c358031 3302 'braille': 'ChardevDummy',
d9ac374f 3303 'stdio' : 'ChardevStdio',
cd153e2a
GH
3304 'console': 'ChardevDummy',
3305 'spicevmc' : 'ChardevSpiceChannel',
702ec69c 3306 'spiceport' : 'ChardevSpicePort',
1da48c65
GH
3307 'vc' : 'ChardevVC',
3308 'memory' : 'ChardevRingbuf' } }
f1a1a356
GH
3309
3310##
3311# @ChardevReturn:
3312#
3313# Return info about the chardev backend just created.
3314#
58fa4325
MA
3315# @pty: #optional name of the slave pseudoterminal device, present if
3316# and only if a chardev of type 'pty' was created
3317#
f1a1a356
GH
3318# Since: 1.4
3319##
0a1a7fab 3320{ 'type' : 'ChardevReturn', 'data': { '*pty' : 'str' } }
f1a1a356
GH
3321
3322##
3323# @chardev-add:
3324#
58fa4325 3325# Add a character device backend
f1a1a356
GH
3326#
3327# @id: the chardev's ID, must be unique
3328# @backend: backend type and parameters
3329#
58fa4325 3330# Returns: ChardevReturn.
f1a1a356
GH
3331#
3332# Since: 1.4
3333##
3334{ 'command': 'chardev-add', 'data': {'id' : 'str',
3335 'backend' : 'ChardevBackend' },
3336 'returns': 'ChardevReturn' }
3337
3338##
3339# @chardev-remove:
3340#
58fa4325 3341# Remove a character device backend
f1a1a356
GH
3342#
3343# @id: the chardev's ID, must exist and not be in use
3344#
3345# Returns: Nothing on success
3346#
3347# Since: 1.4
3348##
3349{ 'command': 'chardev-remove', 'data': {'id': 'str'} }
d1a0cf73
SB
3350
3351##
3352# @TpmModel:
3353#
3354# An enumeration of TPM models
3355#
3356# @tpm-tis: TPM TIS model
3357#
3358# Since: 1.5
3359##
3360{ 'enum': 'TpmModel', 'data': [ 'tpm-tis' ] }
3361
3362##
3363# @query-tpm-models:
3364#
3365# Return a list of supported TPM models
3366#
3367# Returns: a list of TpmModel
3368#
3369# Since: 1.5
3370##
3371{ 'command': 'query-tpm-models', 'returns': ['TpmModel'] }
3372
3373##
3374# @TpmType:
3375#
3376# An enumeration of TPM types
3377#
3378# @passthrough: TPM passthrough type
3379#
3380# Since: 1.5
3381##
3382{ 'enum': 'TpmType', 'data': [ 'passthrough' ] }
3383
3384##
3385# @query-tpm-types:
3386#
3387# Return a list of supported TPM types
3388#
3389# Returns: a list of TpmType
3390#
3391# Since: 1.5
3392##
3393{ 'command': 'query-tpm-types', 'returns': ['TpmType'] }
3394
3395##
3396# @TPMPassthroughOptions:
3397#
3398# Information about the TPM passthrough type
3399#
3400# @path: #optional string describing the path used for accessing the TPM device
3401#
3402# @cancel-path: #optional string showing the TPM's sysfs cancel file
3403# for cancellation of TPM commands while they are executing
3404#
3405# Since: 1.5
3406##
3407{ 'type': 'TPMPassthroughOptions', 'data': { '*path' : 'str',
3408 '*cancel-path' : 'str'} }
3409
3410##
3411# @TpmTypeOptions:
3412#
3413# A union referencing different TPM backend types' configuration options
3414#
88ca7bcf 3415# @passthrough: The configuration options for the TPM passthrough type
d1a0cf73
SB
3416#
3417# Since: 1.5
3418##
3419{ 'union': 'TpmTypeOptions',
88ca7bcf 3420 'data': { 'passthrough' : 'TPMPassthroughOptions' } }
d1a0cf73
SB
3421
3422##
3423# @TpmInfo:
3424#
3425# Information about the TPM
3426#
3427# @id: The Id of the TPM
3428#
3429# @model: The TPM frontend model
3430#
88ca7bcf 3431# @options: The TPM (backend) type configuration options
d1a0cf73
SB
3432#
3433# Since: 1.5
3434##
3435{ 'type': 'TPMInfo',
3436 'data': {'id': 'str',
3437 'model': 'TpmModel',
88ca7bcf 3438 'options': 'TpmTypeOptions' } }
d1a0cf73
SB
3439
3440##
3441# @query-tpm:
3442#
3443# Return information about the TPM device
3444#
3445# Returns: @TPMInfo on success
3446#
3447# Since: 1.5
3448##
3449{ 'command': 'query-tpm', 'returns': ['TPMInfo'] }
8ccbad5c
LE
3450
3451##
3452# @AcpiTableOptions
3453#
3454# Specify an ACPI table on the command line to load.
3455#
3456# At most one of @file and @data can be specified. The list of files specified
3457# by any one of them is loaded and concatenated in order. If both are omitted,
3458# @data is implied.
3459#
3460# Other fields / optargs can be used to override fields of the generic ACPI
3461# table header; refer to the ACPI specification 5.0, section 5.2.6 System
3462# Description Table Header. If a header field is not overridden, then the
3463# corresponding value from the concatenated blob is used (in case of @file), or
3464# it is filled in with a hard-coded value (in case of @data).
3465#
3466# String fields are copied into the matching ACPI member from lowest address
3467# upwards, and silently truncated / NUL-padded to length.
3468#
3469# @sig: #optional table signature / identifier (4 bytes)
3470#
3471# @rev: #optional table revision number (dependent on signature, 1 byte)
3472#
3473# @oem_id: #optional OEM identifier (6 bytes)
3474#
3475# @oem_table_id: #optional OEM table identifier (8 bytes)
3476#
3477# @oem_rev: #optional OEM-supplied revision number (4 bytes)
3478#
3479# @asl_compiler_id: #optional identifier of the utility that created the table
3480# (4 bytes)
3481#
3482# @asl_compiler_rev: #optional revision number of the utility that created the
3483# table (4 bytes)
3484#
3485# @file: #optional colon (:) separated list of pathnames to load and
3486# concatenate as table data. The resultant binary blob is expected to
3487# have an ACPI table header. At least one file is required. This field
3488# excludes @data.
3489#
3490# @data: #optional colon (:) separated list of pathnames to load and
3491# concatenate as table data. The resultant binary blob must not have an
3492# ACPI table header. At least one file is required. This field excludes
3493# @file.
3494#
3495# Since 1.5
3496##
3497{ 'type': 'AcpiTableOptions',
3498 'data': {
3499 '*sig': 'str',
3500 '*rev': 'uint8',
3501 '*oem_id': 'str',
3502 '*oem_table_id': 'str',
3503 '*oem_rev': 'uint32',
3504 '*asl_compiler_id': 'str',
3505 '*asl_compiler_rev': 'uint32',
3506 '*file': 'str',
3507 '*data': 'str' }}
1f8f987d
AK
3508
3509##
3510# @CommandLineParameterType:
3511#
3512# Possible types for an option parameter.
3513#
3514# @string: accepts a character string
3515#
3516# @boolean: accepts "on" or "off"
3517#
3518# @number: accepts a number
3519#
3520# @size: accepts a number followed by an optional suffix (K)ilo,
3521# (M)ega, (G)iga, (T)era
3522#
3523# Since 1.5
3524##
3525{ 'enum': 'CommandLineParameterType',
3526 'data': ['string', 'boolean', 'number', 'size'] }
3527
3528##
3529# @CommandLineParameterInfo:
3530#
3531# Details about a single parameter of a command line option.
3532#
3533# @name: parameter name
3534#
3535# @type: parameter @CommandLineParameterType
3536#
3537# @help: #optional human readable text string, not suitable for parsing.
3538#
3539# Since 1.5
3540##
3541{ 'type': 'CommandLineParameterInfo',
3542 'data': { 'name': 'str',
3543 'type': 'CommandLineParameterType',
3544 '*help': 'str' } }
3545
3546##
3547# @CommandLineOptionInfo:
3548#
3549# Details about a command line option, including its list of parameter details
3550#
3551# @option: option name
3552#
3553# @parameters: an array of @CommandLineParameterInfo
3554#
3555# Since 1.5
3556##
3557{ 'type': 'CommandLineOptionInfo',
3558 'data': { 'option': 'str', 'parameters': ['CommandLineParameterInfo'] } }
3559
3560##
3561# @query-command-line-options:
3562#
3563# Query command line option schema.
3564#
3565# @option: #optional option name
3566#
3567# Returns: list of @CommandLineOptionInfo for all options (or for the given
3568# @option). Returns an error if the given @option doesn't exist.
3569#
3570# Since 1.5
3571##
3572{'command': 'query-command-line-options', 'data': { '*option': 'str' },
3573 'returns': ['CommandLineOptionInfo'] }