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