]> git.proxmox.com Git - qemu.git/blame - qapi-schema.json
qmp: add SUSPEND_DISK event
[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#
1380# Since: 1.1
1381#
1382# Notes: This type is experimental. Its syntax may change in future releases.
1383##
57c9fafe 1384{ 'type': 'ObjectPropertyInfo',
b4b12c62
AL
1385 'data': { 'name': 'str', 'type': 'str' } }
1386
1387##
1388# @qom-list:
1389#
57c9fafe 1390# This command will list any properties of a object given a path in the object
b4b12c62
AL
1391# model.
1392#
57c9fafe 1393# @path: the path within the object model. See @qom-get for a description of
b4b12c62
AL
1394# this parameter.
1395#
57c9fafe
AL
1396# Returns: a list of @ObjectPropertyInfo that describe the properties of the
1397# object.
b4b12c62
AL
1398#
1399# Since: 1.1
1400#
1401# Notes: This command is experimental. It's syntax may change in future
1402# releases.
1403##
1404{ 'command': 'qom-list',
1405 'data': { 'path': 'str' },
57c9fafe 1406 'returns': [ 'ObjectPropertyInfo' ] }
eb6e8ea5
AL
1407
1408##
1409# @qom-get:
1410#
57c9fafe 1411# This command will get a property from a object model path and return the
eb6e8ea5
AL
1412# value.
1413#
57c9fafe 1414# @path: The path within the object model. There are two forms of supported
eb6e8ea5
AL
1415# paths--absolute and partial paths.
1416#
57c9fafe 1417# Absolute paths are derived from the root object and can follow child<>
eb6e8ea5
AL
1418# or link<> properties. Since they can follow link<> properties, they
1419# can be arbitrarily long. Absolute paths look like absolute filenames
1420# and are prefixed with a leading slash.
1421#
1422# Partial paths look like relative filenames. They do not begin
1423# with a prefix. The matching rules for partial paths are subtle but
57c9fafe 1424# designed to make specifying objects easy. At each level of the
eb6e8ea5
AL
1425# composition tree, the partial path is matched as an absolute path.
1426# The first match is not returned. At least two matches are searched
1427# for. A successful result is only returned if only one match is
1428# found. If more than one match is found, a flag is return to
1429# indicate that the match was ambiguous.
1430#
1431# @property: The property name to read
1432#
1433# Returns: The property value. The type depends on the property type. legacy<>
1434# properties are returned as #str. child<> and link<> properties are
1435# returns as #str pathnames. All integer property types (u8, u16, etc)
1436# are returned as #int.
1437#
1438# Since: 1.1
1439#
1440# Notes: This command is experimental and may change syntax in future releases.
1441##
1442{ 'command': 'qom-get',
1443 'data': { 'path': 'str', 'property': 'str' },
1444 'returns': 'visitor',
1445 'gen': 'no' }
1446
1447##
1448# @qom-set:
1449#
57c9fafe 1450# This command will set a property from a object model path.
eb6e8ea5
AL
1451#
1452# @path: see @qom-get for a description of this parameter
1453#
1454# @property: the property name to set
1455#
1456# @value: a value who's type is appropriate for the property type. See @qom-get
1457# for a description of type mapping.
1458#
1459# Since: 1.1
1460#
1461# Notes: This command is experimental and may change syntax in future releases.
1462##
1463{ 'command': 'qom-set',
1464 'data': { 'path': 'str', 'property': 'str', 'value': 'visitor' },
1465 'gen': 'no' }
fbf796fd
LC
1466
1467##
1468# @set_password:
1469#
1470# Sets the password of a remote display session.
1471#
1472# @protocol: `vnc' to modify the VNC server password
1473# `spice' to modify the Spice server password
1474#
1475# @password: the new password
1476#
1477# @connected: #optional how to handle existing clients when changing the
b80e560b 1478# password. If nothing is specified, defaults to `keep'
fbf796fd
LC
1479# `fail' to fail the command if clients are connected
1480# `disconnect' to disconnect existing clients
1481# `keep' to maintain existing clients
1482#
1483# Returns: Nothing on success
1484# If Spice is not enabled, DeviceNotFound
fbf796fd
LC
1485#
1486# Since: 0.14.0
1487##
1488{ 'command': 'set_password',
1489 'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
9ad5372d
LC
1490
1491##
1492# @expire_password:
1493#
1494# Expire the password of a remote display server.
1495#
1496# @protocol: the name of the remote display protocol `vnc' or `spice'
1497#
1498# @time: when to expire the password.
1499# `now' to expire the password immediately
1500# `never' to cancel password expiration
1501# `+INT' where INT is the number of seconds from now (integer)
1502# `INT' where INT is the absolute time in seconds
1503#
1504# Returns: Nothing on success
1505# If @protocol is `spice' and Spice is not active, DeviceNotFound
9ad5372d
LC
1506#
1507# Since: 0.14.0
1508#
1509# Notes: Time is relative to the server and currently there is no way to
1510# coordinate server time with client time. It is not recommended to
1511# use the absolute time version of the @time parameter unless you're
1512# sure you are on the same machine as the QEMU instance.
1513##
1514{ 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
c245b6a3
LC
1515
1516##
1517# @eject:
1518#
1519# Ejects a device from a removable drive.
1520#
1521# @device: The name of the device
1522#
1523# @force: @optional If true, eject regardless of whether the drive is locked.
1524# If not specified, the default value is false.
1525#
1526# Returns: Nothing on success
1527# If @device is not a valid block device, DeviceNotFound
c245b6a3
LC
1528#
1529# Notes: Ejecting a device will no media results in success
1530#
1531# Since: 0.14.0
1532##
1533{ 'command': 'eject', 'data': {'device': 'str', '*force': 'bool'} }
270b243f
LC
1534
1535##
1536# @change-vnc-password:
1537#
1538# Change the VNC server password.
1539#
1540# @target: the new password to use with VNC authentication
1541#
1542# Since: 1.1
1543#
1544# Notes: An empty password in this command will set the password to the empty
1545# string. Existing clients are unaffected by executing this command.
1546##
1547{ 'command': 'change-vnc-password', 'data': {'password': 'str'} }
333a96ec
LC
1548
1549##
1550# @change:
1551#
1552# This command is multiple commands multiplexed together.
1553#
1554# @device: This is normally the name of a block device but it may also be 'vnc'.
1555# when it's 'vnc', then sub command depends on @target
1556#
1557# @target: If @device is a block device, then this is the new filename.
1558# If @device is 'vnc', then if the value 'password' selects the vnc
1559# change password command. Otherwise, this specifies a new server URI
1560# address to listen to for VNC connections.
1561#
1562# @arg: If @device is a block device, then this is an optional format to open
1563# the device with.
1564# If @device is 'vnc' and @target is 'password', this is the new VNC
1565# password to set. If this argument is an empty string, then no future
1566# logins will be allowed.
1567#
1568# Returns: Nothing on success.
1569# If @device is not a valid block device, DeviceNotFound
333a96ec
LC
1570# If the new block device is encrypted, DeviceEncrypted. Note that
1571# if this error is returned, the device has been opened successfully
1572# and an additional call to @block_passwd is required to set the
1573# device's password. The behavior of reads and writes to the block
1574# device between when these calls are executed is undefined.
1575#
1576# Notes: It is strongly recommended that this interface is not used especially
1577# for changing block devices.
1578#
1579# Since: 0.14.0
1580##
1581{ 'command': 'change',
1582 'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
80047da5
LC
1583
1584##
1585# @block_set_io_throttle:
1586#
1587# Change I/O throttle limits for a block drive.
1588#
1589# @device: The name of the device
1590#
1591# @bps: total throughput limit in bytes per second
1592#
1593# @bps_rd: read throughput limit in bytes per second
1594#
1595# @bps_wr: write throughput limit in bytes per second
1596#
1597# @iops: total I/O operations per second
1598#
1599# @ops_rd: read I/O operations per second
1600#
1601# @iops_wr: write I/O operations per second
1602#
1603# Returns: Nothing on success
1604# If @device is not a valid block device, DeviceNotFound
80047da5
LC
1605#
1606# Since: 1.1
b80e560b 1607##
80047da5
LC
1608{ 'command': 'block_set_io_throttle',
1609 'data': { 'device': 'str', 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
1610 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int' } }
12bd451f 1611
db58f9c0
SH
1612##
1613# @block-stream:
12bd451f
SH
1614#
1615# Copy data from a backing file into a block device.
1616#
1617# The block streaming operation is performed in the background until the entire
1618# backing file has been copied. This command returns immediately once streaming
1619# has started. The status of ongoing block streaming operations can be checked
1620# with query-block-jobs. The operation can be stopped before it has completed
db58f9c0 1621# using the block-job-cancel command.
12bd451f
SH
1622#
1623# If a base file is specified then sectors are not copied from that base file and
1624# its backing chain. When streaming completes the image file will have the base
1625# file as its backing file. This can be used to stream a subset of the backing
1626# file chain instead of flattening the entire image.
1627#
1628# On successful completion the image file is updated to drop the backing file
1629# and the BLOCK_JOB_COMPLETED event is emitted.
1630#
1631# @device: the device name
1632#
1633# @base: #optional the common backing file name
1634#
c83c66c3
SH
1635# @speed: #optional the maximum speed, in bytes per second
1636#
12bd451f 1637# Returns: Nothing on success
12bd451f 1638# If @device does not exist, DeviceNotFound
12bd451f
SH
1639#
1640# Since: 1.1
1641##
c83c66c3
SH
1642{ 'command': 'block-stream', 'data': { 'device': 'str', '*base': 'str',
1643 '*speed': 'int' } }
2d47c6e9
SH
1644
1645##
db58f9c0 1646# @block-job-set-speed:
2d47c6e9
SH
1647#
1648# Set maximum speed for a background block operation.
1649#
1650# This command can only be issued when there is an active block job.
1651#
1652# Throttling can be disabled by setting the speed to 0.
1653#
1654# @device: the device name
1655#
c83c66c3
SH
1656# @speed: the maximum speed, in bytes per second, or 0 for unlimited.
1657# Defaults to 0.
2d47c6e9
SH
1658#
1659# Returns: Nothing on success
05290d80 1660# If no background operation is active on this device, DeviceNotActive
2d47c6e9
SH
1661#
1662# Since: 1.1
1663##
db58f9c0 1664{ 'command': 'block-job-set-speed',
882ec7ce 1665 'data': { 'device': 'str', 'speed': 'int' } }
370521a1
SH
1666
1667##
db58f9c0 1668# @block-job-cancel:
370521a1 1669#
05290d80 1670# Stop an active background block operation.
370521a1 1671#
05290d80 1672# This command returns immediately after marking the active background block
370521a1
SH
1673# operation for cancellation. It is an error to call this command if no
1674# operation is in progress.
1675#
1676# The operation will cancel as soon as possible and then emit the
1677# BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
1678# enumerated using query-block-jobs.
1679#
05290d80
PB
1680# For streaming, the image file retains its backing file unless the streaming
1681# operation happens to complete just as it is being cancelled. A new streaming
1682# operation can be started at a later time to finish copying all data from the
1683# backing file.
370521a1
SH
1684#
1685# @device: the device name
1686#
1687# Returns: Nothing on success
05290d80 1688# If no background operation is active on this device, DeviceNotActive
370521a1
SH
1689#
1690# Since: 1.1
1691##
db58f9c0 1692{ 'command': 'block-job-cancel', 'data': { 'device': 'str' } }
5eeee3fa
AL
1693
1694##
1695# @ObjectTypeInfo:
1696#
1697# This structure describes a search result from @qom-list-types
1698#
1699# @name: the type name found in the search
1700#
1701# Since: 1.1
1702#
1703# Notes: This command is experimental and may change syntax in future releases.
1704##
1705{ 'type': 'ObjectTypeInfo',
1706 'data': { 'name': 'str' } }
1707
1708##
1709# @qom-list-types:
1710#
1711# This command will return a list of types given search parameters
1712#
1713# @implements: if specified, only return types that implement this type name
1714#
1715# @abstract: if true, include abstract types in the results
1716#
1717# Returns: a list of @ObjectTypeInfo or an empty list if no results are found
1718#
1719# Since: 1.1
1720#
1721# Notes: This command is experimental and may change syntax in future releases.
1722##
1723{ 'command': 'qom-list-types',
1724 'data': { '*implements': 'str', '*abstract': 'bool' },
1725 'returns': [ 'ObjectTypeInfo' ] }
e1c37d0e
LC
1726
1727##
1728# @migrate
1729#
1730# Migrates the current running guest to another Virtual Machine.
1731#
1732# @uri: the Uniform Resource Identifier of the destination VM
1733#
1734# @blk: #optional do block migration (full disk copy)
1735#
1736# @inc: #optional incremental disk copy migration
1737#
1738# @detach: this argument exists only for compatibility reasons and
1739# is ignored by QEMU
1740#
1741# Returns: nothing on success
1742#
1743# Since: 0.14.0
1744##
1745{ 'command': 'migrate',
1746 'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
33cf629a 1747
a7ae8355
SS
1748# @xen-save-devices-state:
1749#
1750# Save the state of all devices to file. The RAM and the block devices
1751# of the VM are not saved by this command.
1752#
1753# @filename: the file to save the state of the devices to as binary
1754# data. See xen-save-devices-state.txt for a description of the binary
1755# format.
1756#
1757# Returns: Nothing on success
a7ae8355
SS
1758#
1759# Since: 1.1
1760##
1761{ 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
a15fef21
LC
1762
1763##
1764# @device_del:
1765#
1766# Remove a device from a guest
1767#
1768# @id: the name of the device
1769#
1770# Returns: Nothing on success
1771# If @id is not a valid device, DeviceNotFound
a15fef21
LC
1772#
1773# Notes: When this command completes, the device may not be removed from the
1774# guest. Hot removal is an operation that requires guest cooperation.
1775# This command merely requests that the guest begin the hot removal
1776# process.
1777#
1778# Since: 0.14.0
1779##
1780{ 'command': 'device_del', 'data': {'id': 'str'} }
783e9b48
WC
1781
1782##
1783# @dump-guest-memory
1784#
1785# Dump guest's memory to vmcore. It is a synchronous operation that can take
1786# very long depending on the amount of guest memory. This command is only
f5b0d93b
LC
1787# supported on i386 and x86_64.
1788#
1789# @paging: if true, do paging to get guest's memory mapping. This allows
1790# using gdb to process the core file. However, setting @paging to false
1791# may be desirable because of two reasons:
1792#
1793# 1. The guest may be in a catastrophic state or can have corrupted
1794# memory, which cannot be trusted
1795# 2. The guest can be in real-mode even if paging is enabled. For example,
1796# the guest uses ACPI to sleep, and ACPI sleep state goes in real-mode
1797#
783e9b48 1798# @protocol: the filename or file descriptor of the vmcore. The supported
f5b0d93b
LC
1799# protocols are:
1800#
783e9b48
WC
1801# 1. file: the protocol starts with "file:", and the following string is
1802# the file's path.
1803# 2. fd: the protocol starts with "fd:", and the following string is the
1804# fd's name.
f5b0d93b 1805#
783e9b48 1806# @begin: #optional if specified, the starting physical address.
f5b0d93b 1807#
783e9b48 1808# @length: #optional if specified, the memory size, in bytes. If you don't
f5b0d93b 1809# want to dump all guest's memory, please specify the start @begin and @length
783e9b48
WC
1810#
1811# Returns: nothing on success
783e9b48
WC
1812#
1813# Since: 1.2
1814##
1815{ 'command': 'dump-guest-memory',
1816 'data': { 'paging': 'bool', 'protocol': 'str', '*begin': 'int',
1817 '*length': 'int' } }
928059a3
LC
1818##
1819# @netdev_add:
1820#
1821# Add a network backend.
1822#
1823# @type: the type of network backend. Current valid values are 'user', 'tap',
1824# 'vde', 'socket', 'dump' and 'bridge'
1825#
1826# @id: the name of the new network backend
1827#
1828# @props: #optional a list of properties to be passed to the backend in
1829# the format 'name=value', like 'ifname=tap0,script=no'
1830#
1831# Notes: The semantics of @props is not well defined. Future commands will be
1832# introduced that provide stronger typing for backend creation.
1833#
1834# Since: 0.14.0
1835#
1836# Returns: Nothing on success
1837# If @type is not a valid network backend, DeviceNotFound
928059a3
LC
1838##
1839{ 'command': 'netdev_add',
1840 'data': {'type': 'str', 'id': 'str', '*props': '**'},
1841 'gen': 'no' }
5f964155
LC
1842
1843##
1844# @netdev_del:
1845#
1846# Remove a network backend.
1847#
1848# @id: the name of the network backend to remove
1849#
1850# Returns: Nothing on success
1851# If @id is not a valid network backend, DeviceNotFound
1852#
1853# Since: 0.14.0
1854##
1855{ 'command': 'netdev_del', 'data': {'id': 'str'} }
208c9d1b 1856
14aa0c2d
LE
1857##
1858# @NetdevNoneOptions
1859#
1860# Use it alone to have zero network devices.
1861#
1862# Since 1.2
1863##
1864{ 'type': 'NetdevNoneOptions',
1865 'data': { } }
1866
1867##
1868# @NetLegacyNicOptions
1869#
1870# Create a new Network Interface Card.
1871#
1872# @netdev: #optional id of -netdev to connect to
1873#
1874# @macaddr: #optional MAC address
1875#
1876# @model: #optional device model (e1000, rtl8139, virtio etc.)
1877#
1878# @addr: #optional PCI device address
1879#
1880# @vectors: #optional number of MSI-x vectors, 0 to disable MSI-X
1881#
1882# Since 1.2
1883##
1884{ 'type': 'NetLegacyNicOptions',
1885 'data': {
1886 '*netdev': 'str',
1887 '*macaddr': 'str',
1888 '*model': 'str',
1889 '*addr': 'str',
1890 '*vectors': 'uint32' } }
1891
1892##
1893# @String
1894#
1895# A fat type wrapping 'str', to be embedded in lists.
1896#
1897# Since 1.2
1898##
1899{ 'type': 'String',
1900 'data': {
1901 'str': 'str' } }
1902
1903##
1904# @NetdevUserOptions
1905#
1906# Use the user mode network stack which requires no administrator privilege to
1907# run.
1908#
1909# @hostname: #optional client hostname reported by the builtin DHCP server
1910#
1911# @restrict: #optional isolate the guest from the host
1912#
1913# @ip: #optional legacy parameter, use net= instead
1914#
1915# @net: #optional IP address and optional netmask
1916#
1917# @host: #optional guest-visible address of the host
1918#
1919# @tftp: #optional root directory of the built-in TFTP server
1920#
1921# @bootfile: #optional BOOTP filename, for use with tftp=
1922#
1923# @dhcpstart: #optional the first of the 16 IPs the built-in DHCP server can
1924# assign
1925#
1926# @dns: #optional guest-visible address of the virtual nameserver
1927#
1928# @smb: #optional root directory of the built-in SMB server
1929#
1930# @smbserver: #optional IP address of the built-in SMB server
1931#
1932# @hostfwd: #optional redirect incoming TCP or UDP host connections to guest
1933# endpoints
1934#
1935# @guestfwd: #optional forward guest TCP connections
1936#
1937# Since 1.2
1938##
1939{ 'type': 'NetdevUserOptions',
1940 'data': {
1941 '*hostname': 'str',
1942 '*restrict': 'bool',
1943 '*ip': 'str',
1944 '*net': 'str',
1945 '*host': 'str',
1946 '*tftp': 'str',
1947 '*bootfile': 'str',
1948 '*dhcpstart': 'str',
1949 '*dns': 'str',
1950 '*smb': 'str',
1951 '*smbserver': 'str',
1952 '*hostfwd': ['String'],
1953 '*guestfwd': ['String'] } }
1954
1955##
1956# @NetdevTapOptions
1957#
1958# Connect the host TAP network interface name to the VLAN.
1959#
1960# @ifname: #optional interface name
1961#
1962# @fd: #optional file descriptor of an already opened tap
1963#
1964# @script: #optional script to initialize the interface
1965#
1966# @downscript: #optional script to shut down the interface
1967#
1968# @helper: #optional command to execute to configure bridge
1969#
1970# @sndbuf: #optional send buffer limit. Understands [TGMKkb] suffixes.
1971#
1972# @vnet_hdr: #optional enable the IFF_VNET_HDR flag on the tap interface
1973#
1974# @vhost: #optional enable vhost-net network accelerator
1975#
1976# @vhostfd: #optional file descriptor of an already opened vhost net device
1977#
1978# @vhostforce: #optional vhost on for non-MSIX virtio guests
1979#
1980# Since 1.2
1981##
1982{ 'type': 'NetdevTapOptions',
1983 'data': {
1984 '*ifname': 'str',
1985 '*fd': 'str',
1986 '*script': 'str',
1987 '*downscript': 'str',
1988 '*helper': 'str',
1989 '*sndbuf': 'size',
1990 '*vnet_hdr': 'bool',
1991 '*vhost': 'bool',
1992 '*vhostfd': 'str',
1993 '*vhostforce': 'bool' } }
1994
1995##
1996# @NetdevSocketOptions
1997#
1998# Connect the VLAN to a remote VLAN in another QEMU virtual machine using a TCP
1999# socket connection.
2000#
2001# @fd: #optional file descriptor of an already opened socket
2002#
2003# @listen: #optional port number, and optional hostname, to listen on
2004#
2005# @connect: #optional port number, and optional hostname, to connect to
2006#
2007# @mcast: #optional UDP multicast address and port number
2008#
2009# @localaddr: #optional source address and port for multicast and udp packets
2010#
2011# @udp: #optional UDP unicast address and port number
2012#
2013# Since 1.2
2014##
2015{ 'type': 'NetdevSocketOptions',
2016 'data': {
2017 '*fd': 'str',
2018 '*listen': 'str',
2019 '*connect': 'str',
2020 '*mcast': 'str',
2021 '*localaddr': 'str',
2022 '*udp': 'str' } }
2023
2024##
2025# @NetdevVdeOptions
2026#
2027# Connect the VLAN to a vde switch running on the host.
2028#
2029# @sock: #optional socket path
2030#
2031# @port: #optional port number
2032#
2033# @group: #optional group owner of socket
2034#
2035# @mode: #optional permissions for socket
2036#
2037# Since 1.2
2038##
2039{ 'type': 'NetdevVdeOptions',
2040 'data': {
2041 '*sock': 'str',
2042 '*port': 'uint16',
2043 '*group': 'str',
2044 '*mode': 'uint16' } }
2045
2046##
2047# @NetdevDumpOptions
2048#
2049# Dump VLAN network traffic to a file.
2050#
2051# @len: #optional per-packet size limit (64k default). Understands [TGMKkb]
2052# suffixes.
2053#
2054# @file: #optional dump file path (default is qemu-vlan0.pcap)
2055#
2056# Since 1.2
2057##
2058{ 'type': 'NetdevDumpOptions',
2059 'data': {
2060 '*len': 'size',
2061 '*file': 'str' } }
2062
2063##
2064# @NetdevBridgeOptions
2065#
2066# Connect a host TAP network interface to a host bridge device.
2067#
2068# @br: #optional bridge name
2069#
2070# @helper: #optional command to execute to configure bridge
2071#
2072# Since 1.2
2073##
2074{ 'type': 'NetdevBridgeOptions',
2075 'data': {
2076 '*br': 'str',
2077 '*helper': 'str' } }
2078
f6c874e3
SH
2079##
2080# @NetdevHubPortOptions
2081#
2082# Connect two or more net clients through a software hub.
2083#
2084# @hubid: hub identifier number
2085#
2086# Since 1.2
2087##
2088{ 'type': 'NetdevHubPortOptions',
2089 'data': {
2090 'hubid': 'int32' } }
2091
14aa0c2d
LE
2092##
2093# @NetClientOptions
2094#
2095# A discriminated record of network device traits.
2096#
2097# Since 1.2
2098##
2099{ 'union': 'NetClientOptions',
2100 'data': {
f6c874e3
SH
2101 'none': 'NetdevNoneOptions',
2102 'nic': 'NetLegacyNicOptions',
2103 'user': 'NetdevUserOptions',
2104 'tap': 'NetdevTapOptions',
2105 'socket': 'NetdevSocketOptions',
2106 'vde': 'NetdevVdeOptions',
2107 'dump': 'NetdevDumpOptions',
2108 'bridge': 'NetdevBridgeOptions',
2109 'hubport': 'NetdevHubPortOptions' } }
14aa0c2d
LE
2110
2111##
2112# @NetLegacy
2113#
2114# Captures the configuration of a network device; legacy.
2115#
2116# @vlan: #optional vlan number
2117#
2118# @id: #optional identifier for monitor commands
2119#
2120# @name: #optional identifier for monitor commands, ignored if @id is present
2121#
2122# @opts: device type specific properties (legacy)
2123#
2124# Since 1.2
2125##
2126{ 'type': 'NetLegacy',
2127 'data': {
2128 '*vlan': 'int32',
2129 '*id': 'str',
2130 '*name': 'str',
2131 'opts': 'NetClientOptions' } }
2132
2133##
2134# @Netdev
2135#
2136# Captures the configuration of a network device.
2137#
2138# @id: identifier for monitor commands.
2139#
2140# @opts: device type specific properties
2141#
2142# Since 1.2
2143##
2144{ 'type': 'Netdev',
2145 'data': {
2146 'id': 'str',
2147 'opts': 'NetClientOptions' } }
2148
208c9d1b
CB
2149##
2150# @getfd:
2151#
2152# Receive a file descriptor via SCM rights and assign it a name
2153#
2154# @fdname: file descriptor name
2155#
2156# Returns: Nothing on success
208c9d1b
CB
2157#
2158# Since: 0.14.0
2159#
2160# Notes: If @fdname already exists, the file descriptor assigned to
2161# it will be closed and replaced by the received file
2162# descriptor.
2163# The 'closefd' command can be used to explicitly close the
2164# file descriptor when it is no longer needed.
2165##
2166{ 'command': 'getfd', 'data': {'fdname': 'str'} }
2167
2168##
2169# @closefd:
2170#
2171# Close a file descriptor previously passed via SCM rights
2172#
2173# @fdname: file descriptor name
2174#
2175# Returns: Nothing on success
208c9d1b
CB
2176#
2177# Since: 0.14.0
2178##
2179{ 'command': 'closefd', 'data': {'fdname': 'str'} }