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