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