]> git.proxmox.com Git - mirror_qemu.git/blame - qapi-schema.json
qapi: mark QOM commands stable
[mirror_qemu.git] / qapi-schema.json
CommitLineData
e3193601
AL
1# -*- Mode: Python -*-
2#
3# QAPI Schema
48a32bed 4
dcafd323
LC
5##
6# @ErrorClass
7#
8# QEMU error classes
9#
10# @GenericError: this is used for errors that don't require a specific error
11# class. This should be the default case for most errors
12#
13# @CommandNotFound: the requested command has not been found
14#
15# @DeviceEncrypted: the requested operation can't be fulfilled because the
16# selected device is encrypted
17#
18# @DeviceNotActive: a device has failed to be become active
19#
20# @DeviceNotFound: the requested device has not been found
21#
22# @KVMMissingCap: the requested operation can't be fulfilled because a
23# required KVM capability is missing
24#
25# @MigrationExpected: the requested operation can't be fulfilled because a
26# migration process is expected
27#
28# Since: 1.2
29##
30{ 'enum': 'ErrorClass',
31 'data': [ 'GenericError', 'CommandNotFound', 'DeviceEncrypted',
32 'DeviceNotActive', 'DeviceNotFound', 'KVMMissingCap',
33 'MigrationExpected' ] }
34
48a32bed
AL
35##
36# @NameInfo:
37#
38# Guest name information.
39#
40# @name: #optional The name of the guest
41#
42# Since 0.14.0
43##
44{ 'type': 'NameInfo', 'data': {'*name': 'str'} }
45
46##
47# @query-name:
48#
49# Return the name information of a guest.
50#
51# Returns: @NameInfo of the guest
52#
53# Since 0.14.0
54##
55{ 'command': 'query-name', 'returns': 'NameInfo' }
b9c15f16
LC
56
57##
58# @VersionInfo:
59#
60# A description of QEMU's version.
61#
62# @qemu.major: The major version of QEMU
63#
64# @qemu.minor: The minor version of QEMU
65#
66# @qemu.micro: The micro version of QEMU. By current convention, a micro
67# version of 50 signifies a development branch. A micro version
68# greater than or equal to 90 signifies a release candidate for
69# the next minor version. A micro version of less than 50
70# signifies a stable release.
71#
72# @package: QEMU will always set this field to an empty string. Downstream
73# versions of QEMU should set this to a non-empty string. The
74# exact format depends on the downstream however it highly
75# recommended that a unique name is used.
76#
77# Since: 0.14.0
78##
79{ 'type': 'VersionInfo',
80 'data': {'qemu': {'major': 'int', 'minor': 'int', 'micro': 'int'},
81 'package': 'str'} }
82
83##
84# @query-version:
85#
86# Returns the current version of QEMU.
87#
88# Returns: A @VersionInfo object describing the current version of QEMU.
89#
90# Since: 0.14.0
91##
92{ 'command': 'query-version', 'returns': 'VersionInfo' }
292a2602
LC
93
94##
95# @KvmInfo:
96#
97# Information about support for KVM acceleration
98#
99# @enabled: true if KVM acceleration is active
100#
101# @present: true if KVM acceleration is built into this executable
102#
103# Since: 0.14.0
104##
105{ 'type': 'KvmInfo', 'data': {'enabled': 'bool', 'present': 'bool'} }
106
107##
108# @query-kvm:
109#
110# Returns information about KVM acceleration
111#
112# Returns: @KvmInfo
113#
114# Since: 0.14.0
115##
116{ 'command': 'query-kvm', 'returns': 'KvmInfo' }
117
1fa9a5e4
LC
118##
119# @RunState
120#
121# An enumation of VM run states.
122#
123# @debug: QEMU is running on a debugger
124#
0a24c7b1
LC
125# @finish-migrate: guest is paused to finish the migration process
126#
1fa9a5e4
LC
127# @inmigrate: guest is paused waiting for an incoming migration
128#
129# @internal-error: An internal error that prevents further guest execution
130# has occurred
131#
132# @io-error: the last IOP has failed and the device is configured to pause
133# on I/O errors
134#
135# @paused: guest has been paused via the 'stop' command
136#
137# @postmigrate: guest is paused following a successful 'migrate'
138#
139# @prelaunch: QEMU was started with -S and guest has not started
140#
1fa9a5e4
LC
141# @restore-vm: guest is paused to restore VM state
142#
143# @running: guest is actively running
144#
145# @save-vm: guest is paused to save the VM state
146#
147# @shutdown: guest is shut down (and -no-shutdown is in use)
148#
ad02b96a
LC
149# @suspended: guest is suspended (ACPI S3)
150#
1fa9a5e4
LC
151# @watchdog: the watchdog action is configured to pause and has been triggered
152##
153{ 'enum': 'RunState',
154 'data': [ 'debug', 'inmigrate', 'internal-error', 'io-error', 'paused',
155 'postmigrate', 'prelaunch', 'finish-migrate', 'restore-vm',
ad02b96a 156 'running', 'save-vm', 'shutdown', 'suspended', 'watchdog' ] }
1fa9a5e4
LC
157
158##
159# @StatusInfo:
160#
161# Information about VCPU run state
162#
163# @running: true if all VCPUs are runnable, false if not runnable
164#
165# @singlestep: true if VCPUs are in single-step mode
166#
167# @status: the virtual machine @RunState
168#
169# Since: 0.14.0
170#
171# Notes: @singlestep is enabled through the GDB stub
172##
173{ 'type': 'StatusInfo',
174 'data': {'running': 'bool', 'singlestep': 'bool', 'status': 'RunState'} }
175
176##
177# @query-status:
178#
179# Query the run status of all VCPUs
180#
181# Returns: @StatusInfo reflecting all VCPUs
182#
183# Since: 0.14.0
184##
185{ 'command': 'query-status', 'returns': 'StatusInfo' }
186
efab767e
LC
187##
188# @UuidInfo:
189#
190# Guest UUID information.
191#
192# @UUID: the UUID of the guest
193#
194# Since: 0.14.0
195#
196# Notes: If no UUID was specified for the guest, a null UUID is returned.
197##
198{ 'type': 'UuidInfo', 'data': {'UUID': 'str'} }
199
200##
201# @query-uuid:
202#
203# Query the guest UUID information.
204#
205# Returns: The @UuidInfo for the guest
206#
207# Since 0.14.0
208##
209{ 'command': 'query-uuid', 'returns': 'UuidInfo' }
210
c5a415a0
LC
211##
212# @ChardevInfo:
213#
214# Information about a character device.
215#
216# @label: the label of the character device
217#
218# @filename: the filename of the character device
219#
220# Notes: @filename is encoded using the QEMU command line character device
221# encoding. See the QEMU man page for details.
222#
223# Since: 0.14.0
224##
225{ 'type': 'ChardevInfo', 'data': {'label': 'str', 'filename': 'str'} }
226
227##
228# @query-chardev:
229#
230# Returns information about current character devices.
231#
232# Returns: a list of @ChardevInfo
233#
234# Since: 0.14.0
235##
236{ 'command': 'query-chardev', 'returns': ['ChardevInfo'] }
aa9b79bc
LC
237
238##
239# @CommandInfo:
240#
241# Information about a QMP command
242#
243# @name: The command name
244#
245# Since: 0.14.0
246##
247{ 'type': 'CommandInfo', 'data': {'name': 'str'} }
248
249##
250# @query-commands:
251#
252# Return a list of supported QMP commands by this server
253#
254# Returns: A list of @CommandInfo for all supported commands
255#
256# Since: 0.14.0
257##
258{ 'command': 'query-commands', 'returns': ['CommandInfo'] }
259
4860853d
DB
260##
261# @EventInfo:
262#
263# Information about a QMP event
264#
265# @name: The event name
266#
267# Since: 1.2.0
268##
269{ 'type': 'EventInfo', 'data': {'name': 'str'} }
270
271##
272# @query-events:
273#
274# Return a list of supported QMP events by this server
275#
276# Returns: A list of @EventInfo for all supported events
277#
278# Since: 1.2.0
279##
280{ 'command': 'query-events', 'returns': ['EventInfo'] }
281
791e7c82
LC
282##
283# @MigrationStats
284#
285# Detailed migration status.
286#
287# @transferred: amount of bytes already transferred to the target VM
288#
289# @remaining: amount of bytes remaining to be transferred to the target VM
290#
291# @total: total amount of bytes involved in the migration process
292#
d5f8a570
JQ
293# @total_time: tota0l amount of ms since migration started. If
294# migration has ended, it returns the total migration
295# time. (since 1.2)
296#
791e7c82
LC
297# Since: 0.14.0.
298##
299{ 'type': 'MigrationStats',
d5f8a570
JQ
300 'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' ,
301 'total_time': 'int' } }
791e7c82
LC
302
303##
304# @MigrationInfo
305#
306# Information about current migration process.
307#
308# @status: #optional string describing the current migration status.
309# As of 0.14.0 this can be 'active', 'completed', 'failed' or
310# 'cancelled'. If this field is not returned, no migration process
311# has been initiated
312#
d5f8a570
JQ
313# @ram: #optional @MigrationStats containing detailed migration
314# status, only returned if status is 'active' or
315# 'completed'. 'comppleted' (since 1.2)
791e7c82
LC
316#
317# @disk: #optional @MigrationStats containing detailed disk migration
318# status, only returned if status is 'active' and it is a block
319# migration
320#
321# Since: 0.14.0
322##
323{ 'type': 'MigrationInfo',
324 'data': {'*status': 'str', '*ram': 'MigrationStats',
325 '*disk': 'MigrationStats'} }
326
327##
328# @query-migrate
329#
330# Returns information about current migration process.
331#
332# Returns: @MigrationInfo
333#
334# Since: 0.14.0
335##
336{ 'command': 'query-migrate', 'returns': 'MigrationInfo' }
337
e235cec3
LC
338##
339# @MouseInfo:
340#
341# Information about a mouse device.
342#
343# @name: the name of the mouse device
344#
345# @index: the index of the mouse device
346#
347# @current: true if this device is currently receiving mouse events
348#
349# @absolute: true if this device supports absolute coordinates as input
350#
351# Since: 0.14.0
352##
353{ 'type': 'MouseInfo',
354 'data': {'name': 'str', 'index': 'int', 'current': 'bool',
355 'absolute': 'bool'} }
356
357##
358# @query-mice:
359#
360# Returns information about each active mouse device
361#
362# Returns: a list of @MouseInfo for each device
363#
364# Since: 0.14.0
365##
366{ 'command': 'query-mice', 'returns': ['MouseInfo'] }
367
de0b36b6
LC
368##
369# @CpuInfo:
370#
371# Information about a virtual CPU
372#
373# @CPU: the index of the virtual CPU
374#
375# @current: this only exists for backwards compatible and should be ignored
b80e560b 376#
de0b36b6
LC
377# @halted: true if the virtual CPU is in the halt state. Halt usually refers
378# to a processor specific low power mode.
379#
380# @pc: #optional If the target is i386 or x86_64, this is the 64-bit instruction
381# pointer.
382# If the target is Sparc, this is the PC component of the
383# instruction pointer.
384#
385# @nip: #optional If the target is PPC, the instruction pointer
386#
387# @npc: #optional If the target is Sparc, the NPC component of the instruction
388# pointer
389#
390# @PC: #optional If the target is MIPS, the instruction pointer
391#
392# @thread_id: ID of the underlying host thread
393#
394# Since: 0.14.0
395#
396# Notes: @halted is a transient state that changes frequently. By the time the
397# data is sent to the client, the guest may no longer be halted.
398##
399{ 'type': 'CpuInfo',
400 'data': {'CPU': 'int', 'current': 'bool', 'halted': 'bool', '*pc': 'int',
401 '*nip': 'int', '*npc': 'int', '*PC': 'int', 'thread_id': 'int'} }
402
403##
404# @query-cpus:
405#
406# Returns a list of information about each virtual CPU.
407#
408# Returns: a list of @CpuInfo for each virtual CPU
409#
410# Since: 0.14.0
411##
412{ 'command': 'query-cpus', 'returns': ['CpuInfo'] }
413
b2023818
LC
414##
415# @BlockDeviceInfo:
416#
417# Information about the backing device for a block device.
418#
419# @file: the filename of the backing device
420#
421# @ro: true if the backing device was open read-only
422#
423# @drv: the name of the block format used to open the backing device. As of
424# 0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
425# 'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
426# 'host_floppy', 'http', 'https', 'nbd', 'parallels', 'qcow',
427# 'qcow2', 'raw', 'tftp', 'vdi', 'vmdk', 'vpc', 'vvfat'
428#
429# @backing_file: #optional the name of the backing file (for copy-on-write)
430#
2e3e3317
BC
431# @backing_file_depth: number of files in the backing file chain (since: 1.2)
432#
b2023818
LC
433# @encrypted: true if the backing device is encrypted
434#
c75a1a8a
LC
435# @encryption_key_missing: true if the backing device is encrypted but an
436# valid encryption key is missing
437#
727f005e
ZYW
438# @bps: total throughput limit in bytes per second is specified
439#
440# @bps_rd: read throughput limit in bytes per second is specified
441#
442# @bps_wr: write throughput limit in bytes per second is specified
443#
444# @iops: total I/O operations per second is specified
445#
446# @iops_rd: read I/O operations per second is specified
447#
448# @iops_wr: write I/O operations per second is specified
449#
b2023818
LC
450# Since: 0.14.0
451#
452# Notes: This interface is only found in @BlockInfo.
453##
454{ 'type': 'BlockDeviceInfo',
455 'data': { 'file': 'str', 'ro': 'bool', 'drv': 'str',
2e3e3317 456 '*backing_file': 'str', 'backing_file_depth': 'int',
c75a1a8a
LC
457 'encrypted': 'bool', 'encryption_key_missing': 'bool',
458 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
459 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int'} }
b2023818
LC
460
461##
462# @BlockDeviceIoStatus:
463#
464# An enumeration of block device I/O status.
465#
466# @ok: The last I/O operation has succeeded
467#
468# @failed: The last I/O operation has failed
469#
470# @nospace: The last I/O operation has failed due to a no-space condition
471#
472# Since: 1.0
473##
474{ 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
475
476##
477# @BlockInfo:
478#
479# Block device information. This structure describes a virtual device and
480# the backing device associated with it.
481#
482# @device: The device name associated with the virtual device.
483#
484# @type: This field is returned only for compatibility reasons, it should
485# not be used (always returns 'unknown')
486#
487# @removable: True if the device supports removable media.
488#
489# @locked: True if the guest has locked this device from having its media
490# removed
491#
492# @tray_open: #optional True if the device has a tray and it is open
493# (only present if removable is true)
494#
495# @io-status: #optional @BlockDeviceIoStatus. Only present if the device
496# supports it and the VM is configured to stop on errors
497#
498# @inserted: #optional @BlockDeviceInfo describing the device if media is
499# present
500#
501# Since: 0.14.0
502##
503{ 'type': 'BlockInfo',
504 'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
505 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
506 '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus'} }
507
508##
509# @query-block:
510#
511# Get a list of BlockInfo for all virtual block devices.
512#
513# Returns: a list of @BlockInfo describing each virtual block device
514#
515# Since: 0.14.0
516##
517{ 'command': 'query-block', 'returns': ['BlockInfo'] }
518
f11f57e4
LC
519##
520# @BlockDeviceStats:
521#
522# Statistics of a virtual block device or a block backing device.
523#
524# @rd_bytes: The number of bytes read by the device.
525#
526# @wr_bytes: The number of bytes written by the device.
527#
528# @rd_operations: The number of read operations performed by the device.
529#
530# @wr_operations: The number of write operations performed by the device.
531#
532# @flush_operations: The number of cache flush operations performed by the
533# device (since 0.15.0)
534#
535# @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
536# (since 0.15.0).
537#
538# @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
539#
540# @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
541#
542# @wr_highest_offset: The offset after the greatest byte written to the
543# device. The intended use of this information is for
544# growable sparse files (like qcow2) that are used on top
545# of a physical device.
546#
547# Since: 0.14.0
548##
549{ 'type': 'BlockDeviceStats',
550 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
551 'wr_operations': 'int', 'flush_operations': 'int',
552 'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
553 'rd_total_time_ns': 'int', 'wr_highest_offset': 'int' } }
554
555##
556# @BlockStats:
557#
558# Statistics of a virtual block device or a block backing device.
559#
560# @device: #optional If the stats are for a virtual block device, the name
561# corresponding to the virtual block device.
562#
563# @stats: A @BlockDeviceStats for the device.
564#
565# @parent: #optional This may point to the backing block device if this is a
566# a virtual block device. If it's a backing block, this will point
567# to the backing file is one is present.
568#
569# Since: 0.14.0
570##
571{ 'type': 'BlockStats',
572 'data': {'*device': 'str', 'stats': 'BlockDeviceStats',
573 '*parent': 'BlockStats'} }
574
575##
576# @query-blockstats:
577#
578# Query the @BlockStats for all virtual block devices.
579#
580# Returns: A list of @BlockStats for each virtual block devices.
581#
582# Since: 0.14.0
583##
584{ 'command': 'query-blockstats', 'returns': ['BlockStats'] }
585
2b54aa87
LC
586##
587# @VncClientInfo:
588#
589# Information about a connected VNC client.
590#
591# @host: The host name of the client. QEMU tries to resolve this to a DNS name
592# when possible.
593#
594# @family: 'ipv6' if the client is connected via IPv6 and TCP
595# 'ipv4' if the client is connected via IPv4 and TCP
596# 'unix' if the client is connected via a unix domain socket
597# 'unknown' otherwise
598#
599# @service: The service name of the client's port. This may depends on the
600# host system's service database so symbolic names should not be
601# relied on.
602#
603# @x509_dname: #optional If x509 authentication is in use, the Distinguished
604# Name of the client.
605#
606# @sasl_username: #optional If SASL authentication is in use, the SASL username
607# used for authentication.
608#
609# Since: 0.14.0
610##
611{ 'type': 'VncClientInfo',
612 'data': {'host': 'str', 'family': 'str', 'service': 'str',
613 '*x509_dname': 'str', '*sasl_username': 'str'} }
614
615##
616# @VncInfo:
617#
618# Information about the VNC session.
619#
620# @enabled: true if the VNC server is enabled, false otherwise
621#
622# @host: #optional The hostname the VNC server is bound to. This depends on
623# the name resolution on the host and may be an IP address.
624#
625# @family: #optional 'ipv6' if the host is listening for IPv6 connections
626# 'ipv4' if the host is listening for IPv4 connections
627# 'unix' if the host is listening on a unix domain socket
628# 'unknown' otherwise
629#
630# @service: #optional The service name of the server's port. This may depends
631# on the host system's service database so symbolic names should not
632# be relied on.
633#
634# @auth: #optional the current authentication type used by the server
635# 'none' if no authentication is being used
636# 'vnc' if VNC authentication is being used
637# 'vencrypt+plain' if VEncrypt is used with plain text authentication
638# 'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
639# 'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
640# 'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
641# 'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
642# 'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
643# 'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
644# 'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
645# 'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
646#
647# @clients: a list of @VncClientInfo of all currently connected clients
648#
649# Since: 0.14.0
650##
651{ 'type': 'VncInfo',
652 'data': {'enabled': 'bool', '*host': 'str', '*family': 'str',
653 '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
654
655##
656# @query-vnc:
657#
658# Returns information about the current VNC server
659#
660# Returns: @VncInfo
2b54aa87
LC
661#
662# Since: 0.14.0
663##
664{ 'command': 'query-vnc', 'returns': 'VncInfo' }
665
d1f29646
LC
666##
667# @SpiceChannel
668#
669# Information about a SPICE client channel.
670#
671# @host: The host name of the client. QEMU tries to resolve this to a DNS name
672# when possible.
673#
674# @family: 'ipv6' if the client is connected via IPv6 and TCP
675# 'ipv4' if the client is connected via IPv4 and TCP
676# 'unix' if the client is connected via a unix domain socket
677# 'unknown' otherwise
678#
679# @port: The client's port number.
680#
681# @connection-id: SPICE connection id number. All channels with the same id
682# belong to the same SPICE session.
683#
419e1bdf
AL
684# @connection-type: SPICE channel type number. "1" is the main control
685# channel, filter for this one if you want to track spice
686# sessions only
d1f29646 687#
419e1bdf
AL
688# @channel-id: SPICE channel ID number. Usually "0", might be different when
689# multiple channels of the same type exist, such as multiple
d1f29646
LC
690# display channels in a multihead setup
691#
692# @tls: true if the channel is encrypted, false otherwise.
693#
694# Since: 0.14.0
695##
696{ 'type': 'SpiceChannel',
697 'data': {'host': 'str', 'family': 'str', 'port': 'str',
698 'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
699 'tls': 'bool'} }
700
4efee029
AL
701##
702# @SpiceQueryMouseMode
703#
704# An enumation of Spice mouse states.
705#
706# @client: Mouse cursor position is determined by the client.
707#
708# @server: Mouse cursor position is determined by the server.
709#
710# @unknown: No information is available about mouse mode used by
711# the spice server.
712#
713# Note: spice/enums.h has a SpiceMouseMode already, hence the name.
714#
715# Since: 1.1
716##
717{ 'enum': 'SpiceQueryMouseMode',
718 'data': [ 'client', 'server', 'unknown' ] }
719
d1f29646
LC
720##
721# @SpiceInfo
722#
723# Information about the SPICE session.
b80e560b 724#
d1f29646
LC
725# @enabled: true if the SPICE server is enabled, false otherwise
726#
727# @host: #optional The hostname the SPICE server is bound to. This depends on
728# the name resolution on the host and may be an IP address.
729#
730# @port: #optional The SPICE server's port number.
731#
732# @compiled-version: #optional SPICE server version.
733#
734# @tls-port: #optional The SPICE server's TLS port number.
735#
736# @auth: #optional the current authentication type used by the server
419e1bdf
AL
737# 'none' if no authentication is being used
738# 'spice' uses SASL or direct TLS authentication, depending on command
739# line options
d1f29646 740#
4efee029
AL
741# @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
742# be determined by the client or the server, or unknown if spice
743# server doesn't provide this information.
744#
745# Since: 1.1
746#
d1f29646
LC
747# @channels: a list of @SpiceChannel for each active spice channel
748#
749# Since: 0.14.0
750##
751{ 'type': 'SpiceInfo',
752 'data': {'enabled': 'bool', '*host': 'str', '*port': 'int',
753 '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
4efee029 754 'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
d1f29646
LC
755
756##
757# @query-spice
758#
759# Returns information about the current SPICE server
760#
761# Returns: @SpiceInfo
762#
763# Since: 0.14.0
764##
765{ 'command': 'query-spice', 'returns': 'SpiceInfo' }
766
96637bcd
LC
767##
768# @BalloonInfo:
769#
770# Information about the guest balloon device.
771#
772# @actual: the number of bytes the balloon currently contains
773#
774# @mem_swapped_in: #optional number of pages swapped in within the guest
775#
776# @mem_swapped_out: #optional number of pages swapped out within the guest
777#
778# @major_page_faults: #optional number of major page faults within the guest
779#
780# @minor_page_faults: #optional number of minor page faults within the guest
781#
782# @free_mem: #optional amount of memory (in bytes) free in the guest
783#
784# @total_mem: #optional amount of memory (in bytes) visible to the guest
785#
786# Since: 0.14.0
787#
788# Notes: all current versions of QEMU do not fill out optional information in
789# this structure.
790##
791{ 'type': 'BalloonInfo',
792 'data': {'actual': 'int', '*mem_swapped_in': 'int',
793 '*mem_swapped_out': 'int', '*major_page_faults': 'int',
794 '*minor_page_faults': 'int', '*free_mem': 'int',
795 '*total_mem': 'int'} }
796
797##
798# @query-balloon:
799#
800# Return information about the balloon device.
801#
802# Returns: @BalloonInfo on success
803# If the balloon driver is enabled but not functional because the KVM
804# kernel module cannot support it, KvmMissingCap
805# If no balloon device is present, DeviceNotActive
806#
807# Since: 0.14.0
808##
809{ 'command': 'query-balloon', 'returns': 'BalloonInfo' }
810
79627472
LC
811##
812# @PciMemoryRange:
813#
814# A PCI device memory region
815#
816# @base: the starting address (guest physical)
817#
818# @limit: the ending address (guest physical)
819#
820# Since: 0.14.0
821##
822{ 'type': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
823
824##
825# @PciMemoryRegion
826#
827# Information about a PCI device I/O region.
828#
829# @bar: the index of the Base Address Register for this region
830#
831# @type: 'io' if the region is a PIO region
832# 'memory' if the region is a MMIO region
833#
834# @prefetch: #optional if @type is 'memory', true if the memory is prefetchable
835#
836# @mem_type_64: #optional if @type is 'memory', true if the BAR is 64-bit
837#
838# Since: 0.14.0
839##
840{ 'type': 'PciMemoryRegion',
841 'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
842 '*prefetch': 'bool', '*mem_type_64': 'bool' } }
843
844##
845# @PciBridgeInfo:
846#
847# Information about a PCI Bridge device
848#
849# @bus.number: primary bus interface number. This should be the number of the
850# bus the device resides on.
851#
852# @bus.secondary: secondary bus interface number. This is the number of the
853# main bus for the bridge
854#
855# @bus.subordinate: This is the highest number bus that resides below the
856# bridge.
857#
858# @bus.io_range: The PIO range for all devices on this bridge
859#
860# @bus.memory_range: The MMIO range for all devices on this bridge
861#
862# @bus.prefetchable_range: The range of prefetchable MMIO for all devices on
863# this bridge
864#
865# @devices: a list of @PciDeviceInfo for each device on this bridge
866#
867# Since: 0.14.0
868##
869{ 'type': 'PciBridgeInfo',
870 'data': {'bus': { 'number': 'int', 'secondary': 'int', 'subordinate': 'int',
871 'io_range': 'PciMemoryRange',
872 'memory_range': 'PciMemoryRange',
873 'prefetchable_range': 'PciMemoryRange' },
874 '*devices': ['PciDeviceInfo']} }
875
876##
877# @PciDeviceInfo:
878#
879# Information about a PCI device
880#
881# @bus: the bus number of the device
882#
883# @slot: the slot the device is located in
884#
885# @function: the function of the slot used by the device
886#
887# @class_info.desc: #optional a string description of the device's class
888#
889# @class_info.class: the class code of the device
890#
891# @id.device: the PCI device id
892#
893# @id.vendor: the PCI vendor id
894#
895# @irq: #optional if an IRQ is assigned to the device, the IRQ number
896#
897# @qdev_id: the device name of the PCI device
898#
899# @pci_bridge: if the device is a PCI bridge, the bridge information
900#
901# @regions: a list of the PCI I/O regions associated with the device
902#
903# Notes: the contents of @class_info.desc are not stable and should only be
904# treated as informational.
905#
906# Since: 0.14.0
907##
908{ 'type': 'PciDeviceInfo',
909 'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
910 'class_info': {'*desc': 'str', 'class': 'int'},
911 'id': {'device': 'int', 'vendor': 'int'},
912 '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
913 'regions': ['PciMemoryRegion']} }
914
915##
916# @PciInfo:
917#
918# Information about a PCI bus
919#
920# @bus: the bus index
921#
922# @devices: a list of devices on this bus
923#
924# Since: 0.14.0
925##
926{ 'type': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
927
928##
929# @query-pci:
930#
931# Return information about the PCI bus topology of the guest.
932#
933# Returns: a list of @PciInfo for each PCI bus
934#
935# Since: 0.14.0
936##
937{ 'command': 'query-pci', 'returns': ['PciInfo'] }
938
fb5458cd
SH
939##
940# @BlockJobInfo:
941#
942# Information about a long-running block device operation.
943#
944# @type: the job type ('stream' for image streaming)
945#
946# @device: the block device name
947#
948# @len: the maximum progress value
949#
950# @offset: the current progress value
951#
952# @speed: the rate limit, bytes per second
953#
954# Since: 1.1
955##
956{ 'type': 'BlockJobInfo',
957 'data': {'type': 'str', 'device': 'str', 'len': 'int',
958 'offset': 'int', 'speed': 'int'} }
959
960##
961# @query-block-jobs:
962#
963# Return information about long-running block device operations.
964#
965# Returns: a list of @BlockJobInfo for each active block job
966#
967# Since: 1.1
968##
969{ 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
970
7a7f325e
LC
971##
972# @quit:
973#
974# This command will cause the QEMU process to exit gracefully. While every
975# attempt is made to send the QMP response before terminating, this is not
976# guaranteed. When using this interface, a premature EOF would not be
977# unexpected.
978#
979# Since: 0.14.0
980##
981{ 'command': 'quit' }
5f158f21
LC
982
983##
984# @stop:
985#
986# Stop all guest VCPU execution.
987#
988# Since: 0.14.0
989#
990# Notes: This function will succeed even if the guest is already in the stopped
991# state
992##
993{ 'command': 'stop' }
38d22653
LC
994
995##
996# @system_reset:
997#
998# Performs a hard reset of a guest.
999#
1000# Since: 0.14.0
1001##
1002{ 'command': 'system_reset' }
5bc465e4
LC
1003
1004##
1005# @system_powerdown:
1006#
1007# Requests that a guest perform a powerdown operation.
1008#
1009# Since: 0.14.0
1010#
1011# Notes: A guest may or may not respond to this command. This command
1012# returning does not indicate that a guest has accepted the request or
1013# that it has shut down. Many guests will respond to this command by
1014# prompting the user in some way.
1015##
1016{ 'command': 'system_powerdown' }
755f1968
LC
1017
1018##
1019# @cpu:
1020#
1021# This command is a nop that is only provided for the purposes of compatibility.
1022#
1023# Since: 0.14.0
1024#
1025# Notes: Do not use this command.
1026##
1027{ 'command': 'cpu', 'data': {'index': 'int'} }
0cfd6a9a
LC
1028
1029##
1030# @memsave:
1031#
1032# Save a portion of guest memory to a file.
1033#
1034# @val: the virtual address of the guest to start from
1035#
1036# @size: the size of memory region to save
1037#
1038# @filename: the file to save the memory to as binary data
1039#
1040# @cpu-index: #optional the index of the virtual CPU to use for translating the
1041# virtual address (defaults to CPU 0)
1042#
1043# Returns: Nothing on success
0cfd6a9a
LC
1044#
1045# Since: 0.14.0
1046#
1047# Notes: Errors were not reliably returned until 1.1
1048##
1049{ 'command': 'memsave',
1050 'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
6d3962bf
LC
1051
1052##
1053# @pmemsave:
1054#
1055# Save a portion of guest physical memory to a file.
1056#
1057# @val: the physical address of the guest to start from
1058#
1059# @size: the size of memory region to save
1060#
1061# @filename: the file to save the memory to as binary data
1062#
1063# Returns: Nothing on success
6d3962bf
LC
1064#
1065# Since: 0.14.0
1066#
1067# Notes: Errors were not reliably returned until 1.1
1068##
1069{ 'command': 'pmemsave',
1070 'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
e42e818b
LC
1071
1072##
1073# @cont:
1074#
1075# Resume guest VCPU execution.
1076#
1077# Since: 0.14.0
1078#
1079# Returns: If successful, nothing
1080# If the QEMU is waiting for an incoming migration, MigrationExpected
1081# If QEMU was started with an encrypted block device and a key has
1082# not yet been set, DeviceEncrypted.
1083#
1084# Notes: This command will succeed if the guest is currently running.
1085##
1086{ 'command': 'cont' }
1087
9b9df25a
GH
1088##
1089# @system_wakeup:
1090#
1091# Wakeup guest from suspend. Does nothing in case the guest isn't suspended.
1092#
1093# Since: 1.1
1094#
1095# Returns: nothing.
1096##
1097{ 'command': 'system_wakeup' }
1098
ab49ab5c
LC
1099##
1100# @inject-nmi:
1101#
1102# Injects an Non-Maskable Interrupt into all guest's VCPUs.
1103#
1104# Returns: If successful, nothing
ab49ab5c
LC
1105#
1106# Since: 0.14.0
1107#
1108# Notes: Only x86 Virtual Machines support this command.
1109##
1110{ 'command': 'inject-nmi' }
4b37156c
LC
1111
1112##
1113# @set_link:
1114#
1115# Sets the link status of a virtual network adapter.
1116#
1117# @name: the device name of the virtual network adapter
1118#
1119# @up: true to set the link status to be up
1120#
1121# Returns: Nothing on success
1122# If @name is not a valid network device, DeviceNotFound
1123#
1124# Since: 0.14.0
1125#
1126# Notes: Not all network adapters support setting link status. This command
1127# will succeed even if the network adapter does not support link status
1128# notification.
1129##
1130{ 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
a4dea8a9
LC
1131
1132##
1133# @block_passwd:
1134#
1135# This command sets the password of a block device that has not been open
1136# with a password and requires one.
1137#
1138# The two cases where this can happen are a block device is created through
1139# QEMU's initial command line or a block device is changed through the legacy
1140# @change interface.
1141#
1142# In the event that the block device is created through the initial command
1143# line, the VM will start in the stopped state regardless of whether '-S' is
1144# used. The intention is for a management tool to query the block devices to
1145# determine which ones are encrypted, set the passwords with this command, and
1146# then start the guest with the @cont command.
1147#
1148# @device: the name of the device to set the password on
1149#
1150# @password: the password to use for the device
1151#
1152# Returns: nothing on success
1153# If @device is not a valid block device, DeviceNotFound
1154# If @device is not encrypted, DeviceNotEncrypted
a4dea8a9
LC
1155#
1156# Notes: Not all block formats support encryption and some that do are not
1157# able to validate that a password is correct. Disk corruption may
1158# occur if an invalid password is specified.
1159#
1160# Since: 0.14.0
1161##
1162{ 'command': 'block_passwd', 'data': {'device': 'str', 'password': 'str'} }
d72f3264
LC
1163
1164##
1165# @balloon:
1166#
1167# Request the balloon driver to change its balloon size.
1168#
1169# @value: the target size of the balloon in bytes
1170#
1171# Returns: Nothing on success
1172# If the balloon driver is enabled but not functional because the KVM
1173# kernel module cannot support it, KvmMissingCap
1174# If no balloon device is present, DeviceNotActive
1175#
1176# Notes: This command just issues a request to the guest. When it returns,
1177# the balloon size may not have changed. A guest can change the balloon
1178# size independent of this command.
1179#
1180# Since: 0.14.0
1181##
1182{ 'command': 'balloon', 'data': {'value': 'int'} }
5e7caacb
LC
1183
1184##
1185# @block_resize
1186#
1187# Resize a block image while a guest is running.
1188#
1189# @device: the name of the device to get the image resized
1190#
1191# @size: new image size in bytes
1192#
1193# Returns: nothing on success
1194# If @device is not a valid block device, DeviceNotFound
5e7caacb
LC
1195#
1196# Since: 0.14.0
1197##
1198{ 'command': 'block_resize', 'data': { 'device': 'str', 'size': 'int' }}
6106e249 1199
8802d1fd 1200##
bc8b094f
PB
1201# @NewImageMode
1202#
1203# An enumeration that tells QEMU how to set the backing file path in
1204# a new image file.
1205#
1206# @existing: QEMU should look for an existing image file.
1207#
1208# @absolute-paths: QEMU should create a new image with absolute paths
1209# for the backing file.
1210#
1211# Since: 1.1
1212##
1213{ 'enum': 'NewImageMode'
1214 'data': [ 'existing', 'absolute-paths' ] }
1215
8802d1fd 1216##
52e7c241 1217# @BlockdevSnapshot
8802d1fd
JC
1218#
1219# @device: the name of the device to generate the snapshot from.
1220#
1221# @snapshot-file: the target of the new image. A new file will be created.
1222#
1223# @format: #optional the format of the snapshot image, default is 'qcow2'.
6cc2a415
PB
1224#
1225# @mode: #optional whether and how QEMU should create a new image, default is
1226# 'absolute-paths'.
8802d1fd 1227##
52e7c241 1228{ 'type': 'BlockdevSnapshot',
bc8b094f
PB
1229 'data': { 'device': 'str', 'snapshot-file': 'str', '*format': 'str',
1230 '*mode': 'NewImageMode' } }
8802d1fd
JC
1231
1232##
52e7c241 1233# @BlockdevAction
8802d1fd 1234#
52e7c241
PB
1235# A discriminated record of operations that can be performed with
1236# @transaction.
8802d1fd 1237##
52e7c241
PB
1238{ 'union': 'BlockdevAction',
1239 'data': {
1240 'blockdev-snapshot-sync': 'BlockdevSnapshot',
1241 } }
8802d1fd
JC
1242
1243##
52e7c241 1244# @transaction
8802d1fd 1245#
52e7c241
PB
1246# Atomically operate on a group of one or more block devices. If
1247# any operation fails, then the entire set of actions will be
1248# abandoned and the appropriate error returned. The only operation
1249# supported is currently blockdev-snapshot-sync.
8802d1fd
JC
1250#
1251# List of:
52e7c241 1252# @BlockdevAction: information needed for the device snapshot
8802d1fd
JC
1253#
1254# Returns: nothing on success
1255# If @device is not a valid block device, DeviceNotFound
8802d1fd 1256#
52e7c241
PB
1257# Note: The transaction aborts on the first failure. Therefore, there will
1258# be only one device or snapshot file returned in an error condition, and
1259# subsequent actions will not have been attempted.
1260#
1261# Since 1.1
8802d1fd 1262##
52e7c241
PB
1263{ 'command': 'transaction',
1264 'data': { 'actions': [ 'BlockdevAction' ] } }
8802d1fd 1265
6106e249
LC
1266##
1267# @blockdev-snapshot-sync
1268#
1269# Generates a synchronous snapshot of a block device.
1270#
1271# @device: the name of the device to generate the snapshot from.
1272#
1273# @snapshot-file: the target of the new image. If the file exists, or if it
1274# is a device, the snapshot will be created in the existing
1275# file/device. If does not exist, a new file will be created.
1276#
1277# @format: #optional the format of the snapshot image, default is 'qcow2'.
1278#
6cc2a415
PB
1279# @mode: #optional whether and how QEMU should create a new image, default is
1280# 'absolute-paths'.
1281#
6106e249
LC
1282# Returns: nothing on success
1283# If @device is not a valid block device, DeviceNotFound
6106e249 1284#
6106e249
LC
1285# Since 0.14.0
1286##
1287{ 'command': 'blockdev-snapshot-sync',
6cc2a415
PB
1288 'data': { 'device': 'str', 'snapshot-file': 'str', '*format': 'str',
1289 '*mode': 'NewImageMode'} }
d51a67b4
LC
1290
1291##
1292# @human-monitor-command:
1293#
1294# Execute a command on the human monitor and return the output.
1295#
1296# @command-line: the command to execute in the human monitor
1297#
1298# @cpu-index: #optional The CPU to use for commands that require an implicit CPU
1299#
1300# Returns: the output of the command as a string
1301#
1302# Since: 0.14.0
1303#
1304# Notes: This command only exists as a stop-gap. It's use is highly
1305# discouraged. The semantics of this command are not guaranteed.
1306#
1307# Known limitations:
1308#
1309# o This command is stateless, this means that commands that depend
1310# on state information (such as getfd) might not work
1311#
1312# o Commands that prompt the user for data (eg. 'cont' when the block
1313# device is encrypted) don't currently work
1314##
1315{ 'command': 'human-monitor-command',
1316 'data': {'command-line': 'str', '*cpu-index': 'int'},
b80e560b 1317 'returns': 'str' }
6cdedb07
LC
1318
1319##
1320# @migrate_cancel
1321#
1322# Cancel the current executing migration process.
1323#
1324# Returns: nothing on success
1325#
1326# Notes: This command succeeds even if there is no migration process running.
1327#
1328# Since: 0.14.0
1329##
1330{ 'command': 'migrate_cancel' }
4f0a993b
LC
1331
1332##
1333# @migrate_set_downtime
1334#
1335# Set maximum tolerated downtime for migration.
1336#
1337# @value: maximum downtime in seconds
1338#
1339# Returns: nothing on success
1340#
1341# Since: 0.14.0
1342##
1343{ 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
3dc85383
LC
1344
1345##
1346# @migrate_set_speed
1347#
1348# Set maximum speed for migration.
1349#
1350# @value: maximum speed in bytes.
1351#
1352# Returns: nothing on success
1353#
1354# Notes: A value lesser than zero will be automatically round up to zero.
1355#
1356# Since: 0.14.0
1357##
1358{ 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
b4b12c62
AL
1359
1360##
d03ee401 1361# @ObjectPropertyInfo:
b4b12c62
AL
1362#
1363# @name: the name of the property
1364#
1365# @type: the type of the property. This will typically come in one of four
1366# forms:
1367#
1368# 1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
1369# These types are mapped to the appropriate JSON type.
1370#
1371# 2) A legacy type in the form 'legacy<subtype>' where subtype is the
1372# legacy qdev typename. These types are always treated as strings.
1373#
1374# 3) A child type in the form 'child<subtype>' where subtype is a qdev
1375# device type name. Child properties create the composition tree.
1376#
1377# 4) A link type in the form 'link<subtype>' where subtype is a qdev
1378# device type name. Link properties form the device model graph.
1379#
51920820 1380# Since: 1.2
b4b12c62 1381##
57c9fafe 1382{ 'type': 'ObjectPropertyInfo',
b4b12c62
AL
1383 'data': { 'name': 'str', 'type': 'str' } }
1384
1385##
1386# @qom-list:
1387#
57c9fafe 1388# This command will list any properties of a object given a path in the object
b4b12c62
AL
1389# model.
1390#
57c9fafe 1391# @path: the path within the object model. See @qom-get for a description of
b4b12c62
AL
1392# this parameter.
1393#
57c9fafe
AL
1394# Returns: a list of @ObjectPropertyInfo that describe the properties of the
1395# object.
b4b12c62 1396#
51920820 1397# Since: 1.2
b4b12c62
AL
1398##
1399{ 'command': 'qom-list',
1400 'data': { 'path': 'str' },
57c9fafe 1401 'returns': [ 'ObjectPropertyInfo' ] }
eb6e8ea5
AL
1402
1403##
1404# @qom-get:
1405#
57c9fafe 1406# This command will get a property from a object model path and return the
eb6e8ea5
AL
1407# value.
1408#
57c9fafe 1409# @path: The path within the object model. There are two forms of supported
eb6e8ea5
AL
1410# paths--absolute and partial paths.
1411#
57c9fafe 1412# Absolute paths are derived from the root object and can follow child<>
eb6e8ea5
AL
1413# or link<> properties. Since they can follow link<> properties, they
1414# can be arbitrarily long. Absolute paths look like absolute filenames
1415# and are prefixed with a leading slash.
1416#
1417# Partial paths look like relative filenames. They do not begin
1418# with a prefix. The matching rules for partial paths are subtle but
57c9fafe 1419# designed to make specifying objects easy. At each level of the
eb6e8ea5
AL
1420# composition tree, the partial path is matched as an absolute path.
1421# The first match is not returned. At least two matches are searched
1422# for. A successful result is only returned if only one match is
1423# found. If more than one match is found, a flag is return to
1424# indicate that the match was ambiguous.
1425#
1426# @property: The property name to read
1427#
1428# Returns: The property value. The type depends on the property type. legacy<>
1429# properties are returned as #str. child<> and link<> properties are
1430# returns as #str pathnames. All integer property types (u8, u16, etc)
1431# are returned as #int.
1432#
51920820 1433# Since: 1.2
eb6e8ea5
AL
1434##
1435{ 'command': 'qom-get',
1436 'data': { 'path': 'str', 'property': 'str' },
1437 'returns': 'visitor',
1438 'gen': 'no' }
1439
1440##
1441# @qom-set:
1442#
57c9fafe 1443# This command will set a property from a object model path.
eb6e8ea5
AL
1444#
1445# @path: see @qom-get for a description of this parameter
1446#
1447# @property: the property name to set
1448#
1449# @value: a value who's type is appropriate for the property type. See @qom-get
1450# for a description of type mapping.
1451#
51920820 1452# Since: 1.2
eb6e8ea5
AL
1453##
1454{ 'command': 'qom-set',
1455 'data': { 'path': 'str', 'property': 'str', 'value': 'visitor' },
1456 'gen': 'no' }
fbf796fd
LC
1457
1458##
1459# @set_password:
1460#
1461# Sets the password of a remote display session.
1462#
1463# @protocol: `vnc' to modify the VNC server password
1464# `spice' to modify the Spice server password
1465#
1466# @password: the new password
1467#
1468# @connected: #optional how to handle existing clients when changing the
b80e560b 1469# password. If nothing is specified, defaults to `keep'
fbf796fd
LC
1470# `fail' to fail the command if clients are connected
1471# `disconnect' to disconnect existing clients
1472# `keep' to maintain existing clients
1473#
1474# Returns: Nothing on success
1475# If Spice is not enabled, DeviceNotFound
fbf796fd
LC
1476#
1477# Since: 0.14.0
1478##
1479{ 'command': 'set_password',
1480 'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
9ad5372d
LC
1481
1482##
1483# @expire_password:
1484#
1485# Expire the password of a remote display server.
1486#
1487# @protocol: the name of the remote display protocol `vnc' or `spice'
1488#
1489# @time: when to expire the password.
1490# `now' to expire the password immediately
1491# `never' to cancel password expiration
1492# `+INT' where INT is the number of seconds from now (integer)
1493# `INT' where INT is the absolute time in seconds
1494#
1495# Returns: Nothing on success
1496# If @protocol is `spice' and Spice is not active, DeviceNotFound
9ad5372d
LC
1497#
1498# Since: 0.14.0
1499#
1500# Notes: Time is relative to the server and currently there is no way to
1501# coordinate server time with client time. It is not recommended to
1502# use the absolute time version of the @time parameter unless you're
1503# sure you are on the same machine as the QEMU instance.
1504##
1505{ 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
c245b6a3
LC
1506
1507##
1508# @eject:
1509#
1510# Ejects a device from a removable drive.
1511#
1512# @device: The name of the device
1513#
1514# @force: @optional If true, eject regardless of whether the drive is locked.
1515# If not specified, the default value is false.
1516#
1517# Returns: Nothing on success
1518# If @device is not a valid block device, DeviceNotFound
c245b6a3
LC
1519#
1520# Notes: Ejecting a device will no media results in success
1521#
1522# Since: 0.14.0
1523##
1524{ 'command': 'eject', 'data': {'device': 'str', '*force': 'bool'} }
270b243f
LC
1525
1526##
1527# @change-vnc-password:
1528#
1529# Change the VNC server password.
1530#
1531# @target: the new password to use with VNC authentication
1532#
1533# Since: 1.1
1534#
1535# Notes: An empty password in this command will set the password to the empty
1536# string. Existing clients are unaffected by executing this command.
1537##
1538{ 'command': 'change-vnc-password', 'data': {'password': 'str'} }
333a96ec
LC
1539
1540##
1541# @change:
1542#
1543# This command is multiple commands multiplexed together.
1544#
1545# @device: This is normally the name of a block device but it may also be 'vnc'.
1546# when it's 'vnc', then sub command depends on @target
1547#
1548# @target: If @device is a block device, then this is the new filename.
1549# If @device is 'vnc', then if the value 'password' selects the vnc
1550# change password command. Otherwise, this specifies a new server URI
1551# address to listen to for VNC connections.
1552#
1553# @arg: If @device is a block device, then this is an optional format to open
1554# the device with.
1555# If @device is 'vnc' and @target is 'password', this is the new VNC
1556# password to set. If this argument is an empty string, then no future
1557# logins will be allowed.
1558#
1559# Returns: Nothing on success.
1560# If @device is not a valid block device, DeviceNotFound
333a96ec
LC
1561# If the new block device is encrypted, DeviceEncrypted. Note that
1562# if this error is returned, the device has been opened successfully
1563# and an additional call to @block_passwd is required to set the
1564# device's password. The behavior of reads and writes to the block
1565# device between when these calls are executed is undefined.
1566#
1567# Notes: It is strongly recommended that this interface is not used especially
1568# for changing block devices.
1569#
1570# Since: 0.14.0
1571##
1572{ 'command': 'change',
1573 'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
80047da5
LC
1574
1575##
1576# @block_set_io_throttle:
1577#
1578# Change I/O throttle limits for a block drive.
1579#
1580# @device: The name of the device
1581#
1582# @bps: total throughput limit in bytes per second
1583#
1584# @bps_rd: read throughput limit in bytes per second
1585#
1586# @bps_wr: write throughput limit in bytes per second
1587#
1588# @iops: total I/O operations per second
1589#
1590# @ops_rd: read I/O operations per second
1591#
1592# @iops_wr: write I/O operations per second
1593#
1594# Returns: Nothing on success
1595# If @device is not a valid block device, DeviceNotFound
80047da5
LC
1596#
1597# Since: 1.1
b80e560b 1598##
80047da5
LC
1599{ 'command': 'block_set_io_throttle',
1600 'data': { 'device': 'str', 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
1601 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int' } }
12bd451f 1602
db58f9c0
SH
1603##
1604# @block-stream:
12bd451f
SH
1605#
1606# Copy data from a backing file into a block device.
1607#
1608# The block streaming operation is performed in the background until the entire
1609# backing file has been copied. This command returns immediately once streaming
1610# has started. The status of ongoing block streaming operations can be checked
1611# with query-block-jobs. The operation can be stopped before it has completed
db58f9c0 1612# using the block-job-cancel command.
12bd451f
SH
1613#
1614# If a base file is specified then sectors are not copied from that base file and
1615# its backing chain. When streaming completes the image file will have the base
1616# file as its backing file. This can be used to stream a subset of the backing
1617# file chain instead of flattening the entire image.
1618#
1619# On successful completion the image file is updated to drop the backing file
1620# and the BLOCK_JOB_COMPLETED event is emitted.
1621#
1622# @device: the device name
1623#
1624# @base: #optional the common backing file name
1625#
c83c66c3
SH
1626# @speed: #optional the maximum speed, in bytes per second
1627#
12bd451f 1628# Returns: Nothing on success
12bd451f 1629# If @device does not exist, DeviceNotFound
12bd451f
SH
1630#
1631# Since: 1.1
1632##
c83c66c3
SH
1633{ 'command': 'block-stream', 'data': { 'device': 'str', '*base': 'str',
1634 '*speed': 'int' } }
2d47c6e9
SH
1635
1636##
db58f9c0 1637# @block-job-set-speed:
2d47c6e9
SH
1638#
1639# Set maximum speed for a background block operation.
1640#
1641# This command can only be issued when there is an active block job.
1642#
1643# Throttling can be disabled by setting the speed to 0.
1644#
1645# @device: the device name
1646#
c83c66c3
SH
1647# @speed: the maximum speed, in bytes per second, or 0 for unlimited.
1648# Defaults to 0.
2d47c6e9
SH
1649#
1650# Returns: Nothing on success
05290d80 1651# If no background operation is active on this device, DeviceNotActive
2d47c6e9
SH
1652#
1653# Since: 1.1
1654##
db58f9c0 1655{ 'command': 'block-job-set-speed',
882ec7ce 1656 'data': { 'device': 'str', 'speed': 'int' } }
370521a1
SH
1657
1658##
db58f9c0 1659# @block-job-cancel:
370521a1 1660#
05290d80 1661# Stop an active background block operation.
370521a1 1662#
05290d80 1663# This command returns immediately after marking the active background block
370521a1
SH
1664# operation for cancellation. It is an error to call this command if no
1665# operation is in progress.
1666#
1667# The operation will cancel as soon as possible and then emit the
1668# BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
1669# enumerated using query-block-jobs.
1670#
05290d80
PB
1671# For streaming, the image file retains its backing file unless the streaming
1672# operation happens to complete just as it is being cancelled. A new streaming
1673# operation can be started at a later time to finish copying all data from the
1674# backing file.
370521a1
SH
1675#
1676# @device: the device name
1677#
1678# Returns: Nothing on success
05290d80 1679# If no background operation is active on this device, DeviceNotActive
370521a1
SH
1680#
1681# Since: 1.1
1682##
db58f9c0 1683{ 'command': 'block-job-cancel', 'data': { 'device': 'str' } }
5eeee3fa
AL
1684
1685##
1686# @ObjectTypeInfo:
1687#
1688# This structure describes a search result from @qom-list-types
1689#
1690# @name: the type name found in the search
1691#
1692# Since: 1.1
1693#
1694# Notes: This command is experimental and may change syntax in future releases.
1695##
1696{ 'type': 'ObjectTypeInfo',
1697 'data': { 'name': 'str' } }
1698
1699##
1700# @qom-list-types:
1701#
1702# This command will return a list of types given search parameters
1703#
1704# @implements: if specified, only return types that implement this type name
1705#
1706# @abstract: if true, include abstract types in the results
1707#
1708# Returns: a list of @ObjectTypeInfo or an empty list if no results are found
1709#
1710# Since: 1.1
5eeee3fa
AL
1711##
1712{ 'command': 'qom-list-types',
1713 'data': { '*implements': 'str', '*abstract': 'bool' },
1714 'returns': [ 'ObjectTypeInfo' ] }
e1c37d0e 1715
1daa31b9
AL
1716##
1717# @DevicePropertyInfo:
1718#
1719# Information about device properties.
1720#
1721# @name: the name of the property
1722# @type: the typename of the property
1723#
1724# Since: 1.2
1725##
1726{ 'type': 'DevicePropertyInfo',
1727 'data': { 'name': 'str', 'type': 'str' } }
1728
1729##
1730# @device-list-properties:
1731#
1732# List properties associated with a device.
1733#
1734# @typename: the type name of a device
1735#
1736# Returns: a list of DevicePropertyInfo describing a devices properties
1737#
1738# Since: 1.2
1739##
1740{ 'command': 'device-list-properties',
1741 'data': { 'typename': 'str'},
1742 'returns': [ 'DevicePropertyInfo' ] }
1743
e1c37d0e
LC
1744##
1745# @migrate
1746#
1747# Migrates the current running guest to another Virtual Machine.
1748#
1749# @uri: the Uniform Resource Identifier of the destination VM
1750#
1751# @blk: #optional do block migration (full disk copy)
1752#
1753# @inc: #optional incremental disk copy migration
1754#
1755# @detach: this argument exists only for compatibility reasons and
1756# is ignored by QEMU
1757#
1758# Returns: nothing on success
1759#
1760# Since: 0.14.0
1761##
1762{ 'command': 'migrate',
1763 'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
33cf629a 1764
a7ae8355
SS
1765# @xen-save-devices-state:
1766#
1767# Save the state of all devices to file. The RAM and the block devices
1768# of the VM are not saved by this command.
1769#
1770# @filename: the file to save the state of the devices to as binary
1771# data. See xen-save-devices-state.txt for a description of the binary
1772# format.
1773#
1774# Returns: Nothing on success
a7ae8355
SS
1775#
1776# Since: 1.1
1777##
1778{ 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
a15fef21
LC
1779
1780##
1781# @device_del:
1782#
1783# Remove a device from a guest
1784#
1785# @id: the name of the device
1786#
1787# Returns: Nothing on success
1788# If @id is not a valid device, DeviceNotFound
a15fef21
LC
1789#
1790# Notes: When this command completes, the device may not be removed from the
1791# guest. Hot removal is an operation that requires guest cooperation.
1792# This command merely requests that the guest begin the hot removal
1793# process.
1794#
1795# Since: 0.14.0
1796##
1797{ 'command': 'device_del', 'data': {'id': 'str'} }
783e9b48
WC
1798
1799##
1800# @dump-guest-memory
1801#
1802# Dump guest's memory to vmcore. It is a synchronous operation that can take
1803# very long depending on the amount of guest memory. This command is only
f5b0d93b
LC
1804# supported on i386 and x86_64.
1805#
1806# @paging: if true, do paging to get guest's memory mapping. This allows
1807# using gdb to process the core file. However, setting @paging to false
1808# may be desirable because of two reasons:
1809#
1810# 1. The guest may be in a catastrophic state or can have corrupted
1811# memory, which cannot be trusted
1812# 2. The guest can be in real-mode even if paging is enabled. For example,
1813# the guest uses ACPI to sleep, and ACPI sleep state goes in real-mode
1814#
783e9b48 1815# @protocol: the filename or file descriptor of the vmcore. The supported
f5b0d93b
LC
1816# protocols are:
1817#
783e9b48
WC
1818# 1. file: the protocol starts with "file:", and the following string is
1819# the file's path.
1820# 2. fd: the protocol starts with "fd:", and the following string is the
1821# fd's name.
f5b0d93b 1822#
783e9b48 1823# @begin: #optional if specified, the starting physical address.
f5b0d93b 1824#
783e9b48 1825# @length: #optional if specified, the memory size, in bytes. If you don't
f5b0d93b 1826# want to dump all guest's memory, please specify the start @begin and @length
783e9b48
WC
1827#
1828# Returns: nothing on success
783e9b48
WC
1829#
1830# Since: 1.2
1831##
1832{ 'command': 'dump-guest-memory',
1833 'data': { 'paging': 'bool', 'protocol': 'str', '*begin': 'int',
1834 '*length': 'int' } }
928059a3
LC
1835##
1836# @netdev_add:
1837#
1838# Add a network backend.
1839#
1840# @type: the type of network backend. Current valid values are 'user', 'tap',
1841# 'vde', 'socket', 'dump' and 'bridge'
1842#
1843# @id: the name of the new network backend
1844#
1845# @props: #optional a list of properties to be passed to the backend in
1846# the format 'name=value', like 'ifname=tap0,script=no'
1847#
1848# Notes: The semantics of @props is not well defined. Future commands will be
1849# introduced that provide stronger typing for backend creation.
1850#
1851# Since: 0.14.0
1852#
1853# Returns: Nothing on success
1854# If @type is not a valid network backend, DeviceNotFound
928059a3
LC
1855##
1856{ 'command': 'netdev_add',
1857 'data': {'type': 'str', 'id': 'str', '*props': '**'},
1858 'gen': 'no' }
5f964155
LC
1859
1860##
1861# @netdev_del:
1862#
1863# Remove a network backend.
1864#
1865# @id: the name of the network backend to remove
1866#
1867# Returns: Nothing on success
1868# If @id is not a valid network backend, DeviceNotFound
1869#
1870# Since: 0.14.0
1871##
1872{ 'command': 'netdev_del', 'data': {'id': 'str'} }
208c9d1b 1873
14aa0c2d
LE
1874##
1875# @NetdevNoneOptions
1876#
1877# Use it alone to have zero network devices.
1878#
1879# Since 1.2
1880##
1881{ 'type': 'NetdevNoneOptions',
1882 'data': { } }
1883
1884##
1885# @NetLegacyNicOptions
1886#
1887# Create a new Network Interface Card.
1888#
1889# @netdev: #optional id of -netdev to connect to
1890#
1891# @macaddr: #optional MAC address
1892#
1893# @model: #optional device model (e1000, rtl8139, virtio etc.)
1894#
1895# @addr: #optional PCI device address
1896#
1897# @vectors: #optional number of MSI-x vectors, 0 to disable MSI-X
1898#
1899# Since 1.2
1900##
1901{ 'type': 'NetLegacyNicOptions',
1902 'data': {
1903 '*netdev': 'str',
1904 '*macaddr': 'str',
1905 '*model': 'str',
1906 '*addr': 'str',
1907 '*vectors': 'uint32' } }
1908
1909##
1910# @String
1911#
1912# A fat type wrapping 'str', to be embedded in lists.
1913#
1914# Since 1.2
1915##
1916{ 'type': 'String',
1917 'data': {
1918 'str': 'str' } }
1919
1920##
1921# @NetdevUserOptions
1922#
1923# Use the user mode network stack which requires no administrator privilege to
1924# run.
1925#
1926# @hostname: #optional client hostname reported by the builtin DHCP server
1927#
1928# @restrict: #optional isolate the guest from the host
1929#
1930# @ip: #optional legacy parameter, use net= instead
1931#
1932# @net: #optional IP address and optional netmask
1933#
1934# @host: #optional guest-visible address of the host
1935#
1936# @tftp: #optional root directory of the built-in TFTP server
1937#
1938# @bootfile: #optional BOOTP filename, for use with tftp=
1939#
1940# @dhcpstart: #optional the first of the 16 IPs the built-in DHCP server can
1941# assign
1942#
1943# @dns: #optional guest-visible address of the virtual nameserver
1944#
1945# @smb: #optional root directory of the built-in SMB server
1946#
1947# @smbserver: #optional IP address of the built-in SMB server
1948#
1949# @hostfwd: #optional redirect incoming TCP or UDP host connections to guest
1950# endpoints
1951#
1952# @guestfwd: #optional forward guest TCP connections
1953#
1954# Since 1.2
1955##
1956{ 'type': 'NetdevUserOptions',
1957 'data': {
1958 '*hostname': 'str',
1959 '*restrict': 'bool',
1960 '*ip': 'str',
1961 '*net': 'str',
1962 '*host': 'str',
1963 '*tftp': 'str',
1964 '*bootfile': 'str',
1965 '*dhcpstart': 'str',
1966 '*dns': 'str',
1967 '*smb': 'str',
1968 '*smbserver': 'str',
1969 '*hostfwd': ['String'],
1970 '*guestfwd': ['String'] } }
1971
1972##
1973# @NetdevTapOptions
1974#
1975# Connect the host TAP network interface name to the VLAN.
1976#
1977# @ifname: #optional interface name
1978#
1979# @fd: #optional file descriptor of an already opened tap
1980#
1981# @script: #optional script to initialize the interface
1982#
1983# @downscript: #optional script to shut down the interface
1984#
1985# @helper: #optional command to execute to configure bridge
1986#
1987# @sndbuf: #optional send buffer limit. Understands [TGMKkb] suffixes.
1988#
1989# @vnet_hdr: #optional enable the IFF_VNET_HDR flag on the tap interface
1990#
1991# @vhost: #optional enable vhost-net network accelerator
1992#
1993# @vhostfd: #optional file descriptor of an already opened vhost net device
1994#
1995# @vhostforce: #optional vhost on for non-MSIX virtio guests
1996#
1997# Since 1.2
1998##
1999{ 'type': 'NetdevTapOptions',
2000 'data': {
2001 '*ifname': 'str',
2002 '*fd': 'str',
2003 '*script': 'str',
2004 '*downscript': 'str',
2005 '*helper': 'str',
2006 '*sndbuf': 'size',
2007 '*vnet_hdr': 'bool',
2008 '*vhost': 'bool',
2009 '*vhostfd': 'str',
2010 '*vhostforce': 'bool' } }
2011
2012##
2013# @NetdevSocketOptions
2014#
2015# Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP
2016# socket connection.
2017#
2018# @fd: #optional file descriptor of an already opened socket
2019#
2020# @listen: #optional port number, and optional hostname, to listen on
2021#
2022# @connect: #optional port number, and optional hostname, to connect to
2023#
2024# @mcast: #optional UDP multicast address and port number
2025#
2026# @localaddr: #optional source address and port for multicast and udp packets
2027#
2028# @udp: #optional UDP unicast address and port number
2029#
2030# Since 1.2
2031##
2032{ 'type': 'NetdevSocketOptions',
2033 'data': {
2034 '*fd': 'str',
2035 '*listen': 'str',
2036 '*connect': 'str',
2037 '*mcast': 'str',
2038 '*localaddr': 'str',
2039 '*udp': 'str' } }
2040
2041##
2042# @NetdevVdeOptions
2043#
2044# Connect the VLAN to a vde switch running on the host.
2045#
2046# @sock: #optional socket path
2047#
2048# @port: #optional port number
2049#
2050# @group: #optional group owner of socket
2051#
2052# @mode: #optional permissions for socket
2053#
2054# Since 1.2
2055##
2056{ 'type': 'NetdevVdeOptions',
2057 'data': {
2058 '*sock': 'str',
2059 '*port': 'uint16',
2060 '*group': 'str',
2061 '*mode': 'uint16' } }
2062
2063##
2064# @NetdevDumpOptions
2065#
2066# Dump VLAN network traffic to a file.
2067#
2068# @len: #optional per-packet size limit (64k default). Understands [TGMKkb]
2069# suffixes.
2070#
2071# @file: #optional dump file path (default is qemu-vlan0.pcap)
2072#
2073# Since 1.2
2074##
2075{ 'type': 'NetdevDumpOptions',
2076 'data': {
2077 '*len': 'size',
2078 '*file': 'str' } }
2079
2080##
2081# @NetdevBridgeOptions
2082#
2083# Connect a host TAP network interface to a host bridge device.
2084#
2085# @br: #optional bridge name
2086#
2087# @helper: #optional command to execute to configure bridge
2088#
2089# Since 1.2
2090##
2091{ 'type': 'NetdevBridgeOptions',
2092 'data': {
2093 '*br': 'str',
2094 '*helper': 'str' } }
2095
f6c874e3
SH
2096##
2097# @NetdevHubPortOptions
2098#
2099# Connect two or more net clients through a software hub.
2100#
2101# @hubid: hub identifier number
2102#
2103# Since 1.2
2104##
2105{ 'type': 'NetdevHubPortOptions',
2106 'data': {
2107 'hubid': 'int32' } }
2108
14aa0c2d
LE
2109##
2110# @NetClientOptions
2111#
2112# A discriminated record of network device traits.
2113#
2114# Since 1.2
2115##
2116{ 'union': 'NetClientOptions',
2117 'data': {
f6c874e3
SH
2118 'none': 'NetdevNoneOptions',
2119 'nic': 'NetLegacyNicOptions',
2120 'user': 'NetdevUserOptions',
2121 'tap': 'NetdevTapOptions',
2122 'socket': 'NetdevSocketOptions',
2123 'vde': 'NetdevVdeOptions',
2124 'dump': 'NetdevDumpOptions',
2125 'bridge': 'NetdevBridgeOptions',
2126 'hubport': 'NetdevHubPortOptions' } }
14aa0c2d
LE
2127
2128##
2129# @NetLegacy
2130#
2131# Captures the configuration of a network device; legacy.
2132#
2133# @vlan: #optional vlan number
2134#
2135# @id: #optional identifier for monitor commands
2136#
2137# @name: #optional identifier for monitor commands, ignored if @id is present
2138#
2139# @opts: device type specific properties (legacy)
2140#
2141# Since 1.2
2142##
2143{ 'type': 'NetLegacy',
2144 'data': {
2145 '*vlan': 'int32',
2146 '*id': 'str',
2147 '*name': 'str',
2148 'opts': 'NetClientOptions' } }
2149
2150##
2151# @Netdev
2152#
2153# Captures the configuration of a network device.
2154#
2155# @id: identifier for monitor commands.
2156#
2157# @opts: device type specific properties
2158#
2159# Since 1.2
2160##
2161{ 'type': 'Netdev',
2162 'data': {
2163 'id': 'str',
2164 'opts': 'NetClientOptions' } }
2165
208c9d1b
CB
2166##
2167# @getfd:
2168#
2169# Receive a file descriptor via SCM rights and assign it a name
2170#
2171# @fdname: file descriptor name
2172#
2173# Returns: Nothing on success
208c9d1b
CB
2174#
2175# Since: 0.14.0
2176#
2177# Notes: If @fdname already exists, the file descriptor assigned to
2178# it will be closed and replaced by the received file
2179# descriptor.
2180# The 'closefd' command can be used to explicitly close the
2181# file descriptor when it is no longer needed.
2182##
2183{ 'command': 'getfd', 'data': {'fdname': 'str'} }
2184
2185##
2186# @closefd:
2187#
2188# Close a file descriptor previously passed via SCM rights
2189#
2190# @fdname: file descriptor name
2191#
2192# Returns: Nothing on success
208c9d1b
CB
2193#
2194# Since: 0.14.0
2195##
2196{ 'command': 'closefd', 'data': {'fdname': 'str'} }