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