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