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