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