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