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