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