blob: 3b6e3468b440b4b681f321c9525a3d83bea2137a [file] [log] [blame]
Anthony Liguorie3193602011-09-02 12:34:47 -05001# -*- Mode: Python -*-
2#
3# QAPI Schema
Anthony Liguori48a32be2011-09-02 12:34:48 -05004
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' }
Luiz Capitulinob9c15f12011-08-26 17:38:13 -030026
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' }
Luiz Capitulino292a2602011-09-12 15:10:53 -030063
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
Luiz Capitulino1fa9a5e2011-09-12 17:54:20 -030088##
89# @RunState
90#
91# An enumation of VM run states.
92#
93# @debug: QEMU is running on a debugger
94#
Luiz Capitulino0a24c7b2012-04-27 13:16:41 -030095# @finish-migrate: guest is paused to finish the migration process
96#
Luiz Capitulino1fa9a5e2011-09-12 17:54:20 -030097# @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#
Luiz Capitulino1fa9a5e2011-09-12 17:54:20 -0300111# @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#
Luiz Capitulinoad02b962012-04-27 13:33:36 -0300119# @suspended: guest is suspended (ACPI S3)
120#
Luiz Capitulino1fa9a5e2011-09-12 17:54:20 -0300121# @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',
Luiz Capitulinoad02b962012-04-27 13:33:36 -0300126 'running', 'save-vm', 'shutdown', 'suspended', 'watchdog' ] }
Luiz Capitulino1fa9a5e2011-09-12 17:54:20 -0300127
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
Luiz Capitulinoefab7672011-09-13 17:16:25 -0300157##
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
Luiz Capitulinoc5a415a2011-09-14 16:05:49 -0300181##
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'] }
Luiz Capitulinoaa9b79b2011-09-21 14:31:51 -0300207
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
Luiz Capitulino7a7f3252011-09-15 14:20:28 -0300230##
Daniel P. Berrange48608532012-05-21 17:59:51 +0100231# @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
252##
Luiz Capitulino791e7c82011-09-13 17:37:16 -0300253# @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#
263# Since: 0.14.0.
264##
265{ 'type': 'MigrationStats',
266 'data': {'transferred': 'int', 'remaining': 'int', 'total': 'int' } }
267
268##
269# @MigrationInfo
270#
271# Information about current migration process.
272#
273# @status: #optional string describing the current migration status.
274# As of 0.14.0 this can be 'active', 'completed', 'failed' or
275# 'cancelled'. If this field is not returned, no migration process
276# has been initiated
277#
278# @ram: #optional @MigrationStats containing detailed migration status,
279# only returned if status is 'active'
280#
281# @disk: #optional @MigrationStats containing detailed disk migration
282# status, only returned if status is 'active' and it is a block
283# migration
284#
285# Since: 0.14.0
286##
287{ 'type': 'MigrationInfo',
288 'data': {'*status': 'str', '*ram': 'MigrationStats',
289 '*disk': 'MigrationStats'} }
290
291##
292# @query-migrate
293#
294# Returns information about current migration process.
295#
296# Returns: @MigrationInfo
297#
298# Since: 0.14.0
299##
300{ 'command': 'query-migrate', 'returns': 'MigrationInfo' }
301
302##
Luiz Capitulinoe235cec2011-09-21 15:29:55 -0300303# @MouseInfo:
304#
305# Information about a mouse device.
306#
307# @name: the name of the mouse device
308#
309# @index: the index of the mouse device
310#
311# @current: true if this device is currently receiving mouse events
312#
313# @absolute: true if this device supports absolute coordinates as input
314#
315# Since: 0.14.0
316##
317{ 'type': 'MouseInfo',
318 'data': {'name': 'str', 'index': 'int', 'current': 'bool',
319 'absolute': 'bool'} }
320
321##
322# @query-mice:
323#
324# Returns information about each active mouse device
325#
326# Returns: a list of @MouseInfo for each device
327#
328# Since: 0.14.0
329##
330{ 'command': 'query-mice', 'returns': ['MouseInfo'] }
331
332##
Luiz Capitulinode0b36b2011-09-21 16:38:35 -0300333# @CpuInfo:
334#
335# Information about a virtual CPU
336#
337# @CPU: the index of the virtual CPU
338#
339# @current: this only exists for backwards compatible and should be ignored
340#
341# @halted: true if the virtual CPU is in the halt state. Halt usually refers
342# to a processor specific low power mode.
343#
344# @pc: #optional If the target is i386 or x86_64, this is the 64-bit instruction
345# pointer.
346# If the target is Sparc, this is the PC component of the
347# instruction pointer.
348#
349# @nip: #optional If the target is PPC, the instruction pointer
350#
351# @npc: #optional If the target is Sparc, the NPC component of the instruction
352# pointer
353#
354# @PC: #optional If the target is MIPS, the instruction pointer
355#
356# @thread_id: ID of the underlying host thread
357#
358# Since: 0.14.0
359#
360# Notes: @halted is a transient state that changes frequently. By the time the
361# data is sent to the client, the guest may no longer be halted.
362##
363{ 'type': 'CpuInfo',
364 'data': {'CPU': 'int', 'current': 'bool', 'halted': 'bool', '*pc': 'int',
365 '*nip': 'int', '*npc': 'int', '*PC': 'int', 'thread_id': 'int'} }
366
367##
368# @query-cpus:
369#
370# Returns a list of information about each virtual CPU.
371#
372# Returns: a list of @CpuInfo for each virtual CPU
373#
374# Since: 0.14.0
375##
376{ 'command': 'query-cpus', 'returns': ['CpuInfo'] }
377
378##
Luiz Capitulinob2023812011-09-21 17:16:47 -0300379# @BlockDeviceInfo:
380#
381# Information about the backing device for a block device.
382#
383# @file: the filename of the backing device
384#
385# @ro: true if the backing device was open read-only
386#
387# @drv: the name of the block format used to open the backing device. As of
388# 0.14.0 this can be: 'blkdebug', 'bochs', 'cloop', 'cow', 'dmg',
389# 'file', 'file', 'ftp', 'ftps', 'host_cdrom', 'host_device',
390# 'host_floppy', 'http', 'https', 'nbd', 'parallels', 'qcow',
391# 'qcow2', 'raw', 'tftp', 'vdi', 'vmdk', 'vpc', 'vvfat'
392#
393# @backing_file: #optional the name of the backing file (for copy-on-write)
394#
395# @encrypted: true if the backing device is encrypted
396#
Zhi Yong Wu727f0052011-11-08 13:00:31 +0800397# @bps: total throughput limit in bytes per second is specified
398#
399# @bps_rd: read throughput limit in bytes per second is specified
400#
401# @bps_wr: write throughput limit in bytes per second is specified
402#
403# @iops: total I/O operations per second is specified
404#
405# @iops_rd: read I/O operations per second is specified
406#
407# @iops_wr: write I/O operations per second is specified
408#
Luiz Capitulinob2023812011-09-21 17:16:47 -0300409# Since: 0.14.0
410#
411# Notes: This interface is only found in @BlockInfo.
412##
413{ 'type': 'BlockDeviceInfo',
414 'data': { 'file': 'str', 'ro': 'bool', 'drv': 'str',
Zhi Yong Wu727f0052011-11-08 13:00:31 +0800415 '*backing_file': 'str', 'encrypted': 'bool',
416 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
417 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int'} }
Luiz Capitulinob2023812011-09-21 17:16:47 -0300418
419##
420# @BlockDeviceIoStatus:
421#
422# An enumeration of block device I/O status.
423#
424# @ok: The last I/O operation has succeeded
425#
426# @failed: The last I/O operation has failed
427#
428# @nospace: The last I/O operation has failed due to a no-space condition
429#
430# Since: 1.0
431##
432{ 'enum': 'BlockDeviceIoStatus', 'data': [ 'ok', 'failed', 'nospace' ] }
433
434##
435# @BlockInfo:
436#
437# Block device information. This structure describes a virtual device and
438# the backing device associated with it.
439#
440# @device: The device name associated with the virtual device.
441#
442# @type: This field is returned only for compatibility reasons, it should
443# not be used (always returns 'unknown')
444#
445# @removable: True if the device supports removable media.
446#
447# @locked: True if the guest has locked this device from having its media
448# removed
449#
450# @tray_open: #optional True if the device has a tray and it is open
451# (only present if removable is true)
452#
453# @io-status: #optional @BlockDeviceIoStatus. Only present if the device
454# supports it and the VM is configured to stop on errors
455#
456# @inserted: #optional @BlockDeviceInfo describing the device if media is
457# present
458#
459# Since: 0.14.0
460##
461{ 'type': 'BlockInfo',
462 'data': {'device': 'str', 'type': 'str', 'removable': 'bool',
463 'locked': 'bool', '*inserted': 'BlockDeviceInfo',
464 '*tray_open': 'bool', '*io-status': 'BlockDeviceIoStatus'} }
465
466##
467# @query-block:
468#
469# Get a list of BlockInfo for all virtual block devices.
470#
471# Returns: a list of @BlockInfo describing each virtual block device
472#
473# Since: 0.14.0
474##
475{ 'command': 'query-block', 'returns': ['BlockInfo'] }
476
477##
Luiz Capitulinof11f57e2011-09-22 15:56:36 -0300478# @BlockDeviceStats:
479#
480# Statistics of a virtual block device or a block backing device.
481#
482# @rd_bytes: The number of bytes read by the device.
483#
484# @wr_bytes: The number of bytes written by the device.
485#
486# @rd_operations: The number of read operations performed by the device.
487#
488# @wr_operations: The number of write operations performed by the device.
489#
490# @flush_operations: The number of cache flush operations performed by the
491# device (since 0.15.0)
492#
493# @flush_total_time_ns: Total time spend on cache flushes in nano-seconds
494# (since 0.15.0).
495#
496# @wr_total_time_ns: Total time spend on writes in nano-seconds (since 0.15.0).
497#
498# @rd_total_time_ns: Total_time_spend on reads in nano-seconds (since 0.15.0).
499#
500# @wr_highest_offset: The offset after the greatest byte written to the
501# device. The intended use of this information is for
502# growable sparse files (like qcow2) that are used on top
503# of a physical device.
504#
505# Since: 0.14.0
506##
507{ 'type': 'BlockDeviceStats',
508 'data': {'rd_bytes': 'int', 'wr_bytes': 'int', 'rd_operations': 'int',
509 'wr_operations': 'int', 'flush_operations': 'int',
510 'flush_total_time_ns': 'int', 'wr_total_time_ns': 'int',
511 'rd_total_time_ns': 'int', 'wr_highest_offset': 'int' } }
512
513##
514# @BlockStats:
515#
516# Statistics of a virtual block device or a block backing device.
517#
518# @device: #optional If the stats are for a virtual block device, the name
519# corresponding to the virtual block device.
520#
521# @stats: A @BlockDeviceStats for the device.
522#
523# @parent: #optional This may point to the backing block device if this is a
524# a virtual block device. If it's a backing block, this will point
525# to the backing file is one is present.
526#
527# Since: 0.14.0
528##
529{ 'type': 'BlockStats',
530 'data': {'*device': 'str', 'stats': 'BlockDeviceStats',
531 '*parent': 'BlockStats'} }
532
533##
534# @query-blockstats:
535#
536# Query the @BlockStats for all virtual block devices.
537#
538# Returns: A list of @BlockStats for each virtual block devices.
539#
540# Since: 0.14.0
541##
542{ 'command': 'query-blockstats', 'returns': ['BlockStats'] }
543
544##
Luiz Capitulino2b54aa82011-10-17 16:41:22 -0200545# @VncClientInfo:
546#
547# Information about a connected VNC client.
548#
549# @host: The host name of the client. QEMU tries to resolve this to a DNS name
550# when possible.
551#
552# @family: 'ipv6' if the client is connected via IPv6 and TCP
553# 'ipv4' if the client is connected via IPv4 and TCP
554# 'unix' if the client is connected via a unix domain socket
555# 'unknown' otherwise
556#
557# @service: The service name of the client's port. This may depends on the
558# host system's service database so symbolic names should not be
559# relied on.
560#
561# @x509_dname: #optional If x509 authentication is in use, the Distinguished
562# Name of the client.
563#
564# @sasl_username: #optional If SASL authentication is in use, the SASL username
565# used for authentication.
566#
567# Since: 0.14.0
568##
569{ 'type': 'VncClientInfo',
570 'data': {'host': 'str', 'family': 'str', 'service': 'str',
571 '*x509_dname': 'str', '*sasl_username': 'str'} }
572
573##
574# @VncInfo:
575#
576# Information about the VNC session.
577#
578# @enabled: true if the VNC server is enabled, false otherwise
579#
580# @host: #optional The hostname the VNC server is bound to. This depends on
581# the name resolution on the host and may be an IP address.
582#
583# @family: #optional 'ipv6' if the host is listening for IPv6 connections
584# 'ipv4' if the host is listening for IPv4 connections
585# 'unix' if the host is listening on a unix domain socket
586# 'unknown' otherwise
587#
588# @service: #optional The service name of the server's port. This may depends
589# on the host system's service database so symbolic names should not
590# be relied on.
591#
592# @auth: #optional the current authentication type used by the server
593# 'none' if no authentication is being used
594# 'vnc' if VNC authentication is being used
595# 'vencrypt+plain' if VEncrypt is used with plain text authentication
596# 'vencrypt+tls+none' if VEncrypt is used with TLS and no authentication
597# 'vencrypt+tls+vnc' if VEncrypt is used with TLS and VNC authentication
598# 'vencrypt+tls+plain' if VEncrypt is used with TLS and plain text auth
599# 'vencrypt+x509+none' if VEncrypt is used with x509 and no auth
600# 'vencrypt+x509+vnc' if VEncrypt is used with x509 and VNC auth
601# 'vencrypt+x509+plain' if VEncrypt is used with x509 and plain text auth
602# 'vencrypt+tls+sasl' if VEncrypt is used with TLS and SASL auth
603# 'vencrypt+x509+sasl' if VEncrypt is used with x509 and SASL auth
604#
605# @clients: a list of @VncClientInfo of all currently connected clients
606#
607# Since: 0.14.0
608##
609{ 'type': 'VncInfo',
610 'data': {'enabled': 'bool', '*host': 'str', '*family': 'str',
611 '*service': 'str', '*auth': 'str', '*clients': ['VncClientInfo']} }
612
613##
614# @query-vnc:
615#
616# Returns information about the current VNC server
617#
618# Returns: @VncInfo
619# If VNC support is not compiled in, FeatureDisabled
620#
621# Since: 0.14.0
622##
623{ 'command': 'query-vnc', 'returns': 'VncInfo' }
624
625##
Luiz Capitulinod1f29642011-10-20 17:01:33 -0200626# @SpiceChannel
627#
628# Information about a SPICE client channel.
629#
630# @host: The host name of the client. QEMU tries to resolve this to a DNS name
631# when possible.
632#
633# @family: 'ipv6' if the client is connected via IPv6 and TCP
634# 'ipv4' if the client is connected via IPv4 and TCP
635# 'unix' if the client is connected via a unix domain socket
636# 'unknown' otherwise
637#
638# @port: The client's port number.
639#
640# @connection-id: SPICE connection id number. All channels with the same id
641# belong to the same SPICE session.
642#
Alon Levy419e1bd2012-03-05 15:13:27 +0200643# @connection-type: SPICE channel type number. "1" is the main control
644# channel, filter for this one if you want to track spice
645# sessions only
Luiz Capitulinod1f29642011-10-20 17:01:33 -0200646#
Alon Levy419e1bd2012-03-05 15:13:27 +0200647# @channel-id: SPICE channel ID number. Usually "0", might be different when
648# multiple channels of the same type exist, such as multiple
Luiz Capitulinod1f29642011-10-20 17:01:33 -0200649# display channels in a multihead setup
650#
651# @tls: true if the channel is encrypted, false otherwise.
652#
653# Since: 0.14.0
654##
655{ 'type': 'SpiceChannel',
656 'data': {'host': 'str', 'family': 'str', 'port': 'str',
657 'connection-id': 'int', 'channel-type': 'int', 'channel-id': 'int',
658 'tls': 'bool'} }
659
660##
Alon Levy4efee022012-03-29 23:23:14 +0200661# @SpiceQueryMouseMode
662#
663# An enumation of Spice mouse states.
664#
665# @client: Mouse cursor position is determined by the client.
666#
667# @server: Mouse cursor position is determined by the server.
668#
669# @unknown: No information is available about mouse mode used by
670# the spice server.
671#
672# Note: spice/enums.h has a SpiceMouseMode already, hence the name.
673#
674# Since: 1.1
675##
676{ 'enum': 'SpiceQueryMouseMode',
677 'data': [ 'client', 'server', 'unknown' ] }
678
679##
Luiz Capitulinod1f29642011-10-20 17:01:33 -0200680# @SpiceInfo
681#
682# Information about the SPICE session.
683#
684# @enabled: true if the SPICE server is enabled, false otherwise
685#
686# @host: #optional The hostname the SPICE server is bound to. This depends on
687# the name resolution on the host and may be an IP address.
688#
689# @port: #optional The SPICE server's port number.
690#
691# @compiled-version: #optional SPICE server version.
692#
693# @tls-port: #optional The SPICE server's TLS port number.
694#
695# @auth: #optional the current authentication type used by the server
Alon Levy419e1bd2012-03-05 15:13:27 +0200696# 'none' if no authentication is being used
697# 'spice' uses SASL or direct TLS authentication, depending on command
698# line options
Luiz Capitulinod1f29642011-10-20 17:01:33 -0200699#
Alon Levy4efee022012-03-29 23:23:14 +0200700# @mouse-mode: The mode in which the mouse cursor is displayed currently. Can
701# be determined by the client or the server, or unknown if spice
702# server doesn't provide this information.
703#
704# Since: 1.1
705#
Luiz Capitulinod1f29642011-10-20 17:01:33 -0200706# @channels: a list of @SpiceChannel for each active spice channel
707#
708# Since: 0.14.0
709##
710{ 'type': 'SpiceInfo',
711 'data': {'enabled': 'bool', '*host': 'str', '*port': 'int',
712 '*tls-port': 'int', '*auth': 'str', '*compiled-version': 'str',
Alon Levy4efee022012-03-29 23:23:14 +0200713 'mouse-mode': 'SpiceQueryMouseMode', '*channels': ['SpiceChannel']} }
Luiz Capitulinod1f29642011-10-20 17:01:33 -0200714
715##
716# @query-spice
717#
718# Returns information about the current SPICE server
719#
720# Returns: @SpiceInfo
721#
722# Since: 0.14.0
723##
724{ 'command': 'query-spice', 'returns': 'SpiceInfo' }
725
726##
Luiz Capitulino96637bc2011-10-21 11:41:37 -0200727# @BalloonInfo:
728#
729# Information about the guest balloon device.
730#
731# @actual: the number of bytes the balloon currently contains
732#
733# @mem_swapped_in: #optional number of pages swapped in within the guest
734#
735# @mem_swapped_out: #optional number of pages swapped out within the guest
736#
737# @major_page_faults: #optional number of major page faults within the guest
738#
739# @minor_page_faults: #optional number of minor page faults within the guest
740#
741# @free_mem: #optional amount of memory (in bytes) free in the guest
742#
743# @total_mem: #optional amount of memory (in bytes) visible to the guest
744#
745# Since: 0.14.0
746#
747# Notes: all current versions of QEMU do not fill out optional information in
748# this structure.
749##
750{ 'type': 'BalloonInfo',
751 'data': {'actual': 'int', '*mem_swapped_in': 'int',
752 '*mem_swapped_out': 'int', '*major_page_faults': 'int',
753 '*minor_page_faults': 'int', '*free_mem': 'int',
754 '*total_mem': 'int'} }
755
756##
757# @query-balloon:
758#
759# Return information about the balloon device.
760#
761# Returns: @BalloonInfo on success
762# If the balloon driver is enabled but not functional because the KVM
763# kernel module cannot support it, KvmMissingCap
764# If no balloon device is present, DeviceNotActive
765#
766# Since: 0.14.0
767##
768{ 'command': 'query-balloon', 'returns': 'BalloonInfo' }
769
770##
Luiz Capitulino79627472011-10-21 14:15:33 -0200771# @PciMemoryRange:
772#
773# A PCI device memory region
774#
775# @base: the starting address (guest physical)
776#
777# @limit: the ending address (guest physical)
778#
779# Since: 0.14.0
780##
781{ 'type': 'PciMemoryRange', 'data': {'base': 'int', 'limit': 'int'} }
782
783##
784# @PciMemoryRegion
785#
786# Information about a PCI device I/O region.
787#
788# @bar: the index of the Base Address Register for this region
789#
790# @type: 'io' if the region is a PIO region
791# 'memory' if the region is a MMIO region
792#
793# @prefetch: #optional if @type is 'memory', true if the memory is prefetchable
794#
795# @mem_type_64: #optional if @type is 'memory', true if the BAR is 64-bit
796#
797# Since: 0.14.0
798##
799{ 'type': 'PciMemoryRegion',
800 'data': {'bar': 'int', 'type': 'str', 'address': 'int', 'size': 'int',
801 '*prefetch': 'bool', '*mem_type_64': 'bool' } }
802
803##
804# @PciBridgeInfo:
805#
806# Information about a PCI Bridge device
807#
808# @bus.number: primary bus interface number. This should be the number of the
809# bus the device resides on.
810#
811# @bus.secondary: secondary bus interface number. This is the number of the
812# main bus for the bridge
813#
814# @bus.subordinate: This is the highest number bus that resides below the
815# bridge.
816#
817# @bus.io_range: The PIO range for all devices on this bridge
818#
819# @bus.memory_range: The MMIO range for all devices on this bridge
820#
821# @bus.prefetchable_range: The range of prefetchable MMIO for all devices on
822# this bridge
823#
824# @devices: a list of @PciDeviceInfo for each device on this bridge
825#
826# Since: 0.14.0
827##
828{ 'type': 'PciBridgeInfo',
829 'data': {'bus': { 'number': 'int', 'secondary': 'int', 'subordinate': 'int',
830 'io_range': 'PciMemoryRange',
831 'memory_range': 'PciMemoryRange',
832 'prefetchable_range': 'PciMemoryRange' },
833 '*devices': ['PciDeviceInfo']} }
834
835##
836# @PciDeviceInfo:
837#
838# Information about a PCI device
839#
840# @bus: the bus number of the device
841#
842# @slot: the slot the device is located in
843#
844# @function: the function of the slot used by the device
845#
846# @class_info.desc: #optional a string description of the device's class
847#
848# @class_info.class: the class code of the device
849#
850# @id.device: the PCI device id
851#
852# @id.vendor: the PCI vendor id
853#
854# @irq: #optional if an IRQ is assigned to the device, the IRQ number
855#
856# @qdev_id: the device name of the PCI device
857#
858# @pci_bridge: if the device is a PCI bridge, the bridge information
859#
860# @regions: a list of the PCI I/O regions associated with the device
861#
862# Notes: the contents of @class_info.desc are not stable and should only be
863# treated as informational.
864#
865# Since: 0.14.0
866##
867{ 'type': 'PciDeviceInfo',
868 'data': {'bus': 'int', 'slot': 'int', 'function': 'int',
869 'class_info': {'*desc': 'str', 'class': 'int'},
870 'id': {'device': 'int', 'vendor': 'int'},
871 '*irq': 'int', 'qdev_id': 'str', '*pci_bridge': 'PciBridgeInfo',
872 'regions': ['PciMemoryRegion']} }
873
874##
875# @PciInfo:
876#
877# Information about a PCI bus
878#
879# @bus: the bus index
880#
881# @devices: a list of devices on this bus
882#
883# Since: 0.14.0
884##
885{ 'type': 'PciInfo', 'data': {'bus': 'int', 'devices': ['PciDeviceInfo']} }
886
887##
888# @query-pci:
889#
890# Return information about the PCI bus topology of the guest.
891#
892# Returns: a list of @PciInfo for each PCI bus
893#
894# Since: 0.14.0
895##
896{ 'command': 'query-pci', 'returns': ['PciInfo'] }
897
898##
Stefan Hajnoczifb5458c2012-01-18 14:40:49 +0000899# @BlockJobInfo:
900#
901# Information about a long-running block device operation.
902#
903# @type: the job type ('stream' for image streaming)
904#
905# @device: the block device name
906#
907# @len: the maximum progress value
908#
909# @offset: the current progress value
910#
911# @speed: the rate limit, bytes per second
912#
913# Since: 1.1
914##
915{ 'type': 'BlockJobInfo',
916 'data': {'type': 'str', 'device': 'str', 'len': 'int',
917 'offset': 'int', 'speed': 'int'} }
918
919##
920# @query-block-jobs:
921#
922# Return information about long-running block device operations.
923#
924# Returns: a list of @BlockJobInfo for each active block job
925#
926# Since: 1.1
927##
928{ 'command': 'query-block-jobs', 'returns': ['BlockJobInfo'] }
929
930##
Luiz Capitulino7a7f3252011-09-15 14:20:28 -0300931# @quit:
932#
933# This command will cause the QEMU process to exit gracefully. While every
934# attempt is made to send the QMP response before terminating, this is not
935# guaranteed. When using this interface, a premature EOF would not be
936# unexpected.
937#
938# Since: 0.14.0
939##
940{ 'command': 'quit' }
Luiz Capitulino5f158f22011-09-15 14:34:39 -0300941
942##
943# @stop:
944#
945# Stop all guest VCPU execution.
946#
947# Since: 0.14.0
948#
949# Notes: This function will succeed even if the guest is already in the stopped
950# state
951##
952{ 'command': 'stop' }
Luiz Capitulino38d22652011-09-15 14:41:46 -0300953
954##
955# @system_reset:
956#
957# Performs a hard reset of a guest.
958#
959# Since: 0.14.0
960##
961{ 'command': 'system_reset' }
Luiz Capitulino5bc465e2011-09-28 11:06:15 -0300962
963##
964# @system_powerdown:
965#
966# Requests that a guest perform a powerdown operation.
967#
968# Since: 0.14.0
969#
970# Notes: A guest may or may not respond to this command. This command
971# returning does not indicate that a guest has accepted the request or
972# that it has shut down. Many guests will respond to this command by
973# prompting the user in some way.
974##
975{ 'command': 'system_powerdown' }
Luiz Capitulino755f1962011-10-06 14:31:39 -0300976
977##
978# @cpu:
979#
980# This command is a nop that is only provided for the purposes of compatibility.
981#
982# Since: 0.14.0
983#
984# Notes: Do not use this command.
985##
986{ 'command': 'cpu', 'data': {'index': 'int'} }
Luiz Capitulino0cfd6a92011-11-22 16:32:37 -0200987
988##
989# @memsave:
990#
991# Save a portion of guest memory to a file.
992#
993# @val: the virtual address of the guest to start from
994#
995# @size: the size of memory region to save
996#
997# @filename: the file to save the memory to as binary data
998#
999# @cpu-index: #optional the index of the virtual CPU to use for translating the
1000# virtual address (defaults to CPU 0)
1001#
1002# Returns: Nothing on success
1003# If @cpu is not a valid VCPU, InvalidParameterValue
1004# If @filename cannot be opened, OpenFileFailed
1005# If an I/O error occurs while writing the file, IOError
1006#
1007# Since: 0.14.0
1008#
1009# Notes: Errors were not reliably returned until 1.1
1010##
1011{ 'command': 'memsave',
1012 'data': {'val': 'int', 'size': 'int', 'filename': 'str', '*cpu-index': 'int'} }
Luiz Capitulino6d3962b2011-11-22 17:26:46 -02001013
1014##
1015# @pmemsave:
1016#
1017# Save a portion of guest physical memory to a file.
1018#
1019# @val: the physical address of the guest to start from
1020#
1021# @size: the size of memory region to save
1022#
1023# @filename: the file to save the memory to as binary data
1024#
1025# Returns: Nothing on success
1026# If @filename cannot be opened, OpenFileFailed
1027# If an I/O error occurs while writing the file, IOError
1028#
1029# Since: 0.14.0
1030#
1031# Notes: Errors were not reliably returned until 1.1
1032##
1033{ 'command': 'pmemsave',
1034 'data': {'val': 'int', 'size': 'int', 'filename': 'str'} }
Luiz Capitulinoe42e8182011-11-22 17:58:31 -02001035
1036##
1037# @cont:
1038#
1039# Resume guest VCPU execution.
1040#
1041# Since: 0.14.0
1042#
1043# Returns: If successful, nothing
1044# If the QEMU is waiting for an incoming migration, MigrationExpected
1045# If QEMU was started with an encrypted block device and a key has
1046# not yet been set, DeviceEncrypted.
1047#
1048# Notes: This command will succeed if the guest is currently running.
1049##
1050{ 'command': 'cont' }
1051
Luiz Capitulinoab49ab52011-11-23 12:55:53 -02001052##
Gerd Hoffmann9b9df252012-02-23 13:45:21 +01001053# @system_wakeup:
1054#
1055# Wakeup guest from suspend. Does nothing in case the guest isn't suspended.
1056#
1057# Since: 1.1
1058#
1059# Returns: nothing.
1060##
1061{ 'command': 'system_wakeup' }
1062
1063##
Luiz Capitulinoab49ab52011-11-23 12:55:53 -02001064# @inject-nmi:
1065#
1066# Injects an Non-Maskable Interrupt into all guest's VCPUs.
1067#
1068# Returns: If successful, nothing
1069# If the Virtual Machine doesn't support NMI injection, Unsupported
1070#
1071# Since: 0.14.0
1072#
1073# Notes: Only x86 Virtual Machines support this command.
1074##
1075{ 'command': 'inject-nmi' }
Luiz Capitulino4b371562011-11-23 13:11:55 -02001076
1077##
1078# @set_link:
1079#
1080# Sets the link status of a virtual network adapter.
1081#
1082# @name: the device name of the virtual network adapter
1083#
1084# @up: true to set the link status to be up
1085#
1086# Returns: Nothing on success
1087# If @name is not a valid network device, DeviceNotFound
1088#
1089# Since: 0.14.0
1090#
1091# Notes: Not all network adapters support setting link status. This command
1092# will succeed even if the network adapter does not support link status
1093# notification.
1094##
1095{ 'command': 'set_link', 'data': {'name': 'str', 'up': 'bool'} }
Luiz Capitulinoa4dea8a2011-11-23 13:28:21 -02001096
1097##
1098# @block_passwd:
1099#
1100# This command sets the password of a block device that has not been open
1101# with a password and requires one.
1102#
1103# The two cases where this can happen are a block device is created through
1104# QEMU's initial command line or a block device is changed through the legacy
1105# @change interface.
1106#
1107# In the event that the block device is created through the initial command
1108# line, the VM will start in the stopped state regardless of whether '-S' is
1109# used. The intention is for a management tool to query the block devices to
1110# determine which ones are encrypted, set the passwords with this command, and
1111# then start the guest with the @cont command.
1112#
1113# @device: the name of the device to set the password on
1114#
1115# @password: the password to use for the device
1116#
1117# Returns: nothing on success
1118# If @device is not a valid block device, DeviceNotFound
1119# If @device is not encrypted, DeviceNotEncrypted
1120# If @password is not valid for this device, InvalidPassword
1121#
1122# Notes: Not all block formats support encryption and some that do are not
1123# able to validate that a password is correct. Disk corruption may
1124# occur if an invalid password is specified.
1125#
1126# Since: 0.14.0
1127##
1128{ 'command': 'block_passwd', 'data': {'device': 'str', 'password': 'str'} }
Luiz Capitulinod72f3262011-11-25 14:38:09 -02001129
1130##
1131# @balloon:
1132#
1133# Request the balloon driver to change its balloon size.
1134#
1135# @value: the target size of the balloon in bytes
1136#
1137# Returns: Nothing on success
1138# If the balloon driver is enabled but not functional because the KVM
1139# kernel module cannot support it, KvmMissingCap
1140# If no balloon device is present, DeviceNotActive
1141#
1142# Notes: This command just issues a request to the guest. When it returns,
1143# the balloon size may not have changed. A guest can change the balloon
1144# size independent of this command.
1145#
1146# Since: 0.14.0
1147##
1148{ 'command': 'balloon', 'data': {'value': 'int'} }
Luiz Capitulino5e7caac2011-11-25 14:57:10 -02001149
1150##
1151# @block_resize
1152#
1153# Resize a block image while a guest is running.
1154#
1155# @device: the name of the device to get the image resized
1156#
1157# @size: new image size in bytes
1158#
1159# Returns: nothing on success
1160# If @device is not a valid block device, DeviceNotFound
Stefan Hajnoczi939a1cc2012-01-04 22:23:34 +00001161# If @size is negative, InvalidParameterValue
1162# If the block device has no medium inserted, DeviceHasNoMedium
1163# If the block device does not support resize, Unsupported
1164# If the block device is read-only, DeviceIsReadOnly
1165# If a long-running operation is using the device, DeviceInUse
Luiz Capitulino5e7caac2011-11-25 14:57:10 -02001166#
1167# Since: 0.14.0
1168##
1169{ 'command': 'block_resize', 'data': { 'device': 'str', 'size': 'int' }}
Luiz Capitulino6106e242011-11-25 16:15:19 -02001170
1171##
Paolo Bonzinibc8b0942012-03-06 18:55:58 +01001172# @NewImageMode
1173#
1174# An enumeration that tells QEMU how to set the backing file path in
1175# a new image file.
1176#
1177# @existing: QEMU should look for an existing image file.
1178#
1179# @absolute-paths: QEMU should create a new image with absolute paths
1180# for the backing file.
1181#
1182# Since: 1.1
1183##
1184{ 'enum': 'NewImageMode'
1185 'data': [ 'existing', 'absolute-paths' ] }
1186
1187##
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001188# @BlockdevSnapshot
Jeff Cody8802d1f2012-02-28 15:54:06 -05001189#
1190# @device: the name of the device to generate the snapshot from.
1191#
1192# @snapshot-file: the target of the new image. A new file will be created.
1193#
1194# @format: #optional the format of the snapshot image, default is 'qcow2'.
Paolo Bonzini6cc2a412012-03-06 18:55:59 +01001195#
1196# @mode: #optional whether and how QEMU should create a new image, default is
1197# 'absolute-paths'.
Jeff Cody8802d1f2012-02-28 15:54:06 -05001198##
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001199{ 'type': 'BlockdevSnapshot',
Paolo Bonzinibc8b0942012-03-06 18:55:58 +01001200 'data': { 'device': 'str', 'snapshot-file': 'str', '*format': 'str',
1201 '*mode': 'NewImageMode' } }
Jeff Cody8802d1f2012-02-28 15:54:06 -05001202
1203##
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001204# @BlockdevAction
Jeff Cody8802d1f2012-02-28 15:54:06 -05001205#
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001206# A discriminated record of operations that can be performed with
1207# @transaction.
1208##
1209{ 'union': 'BlockdevAction',
1210 'data': {
1211 'blockdev-snapshot-sync': 'BlockdevSnapshot',
1212 } }
1213
1214##
1215# @transaction
1216#
1217# Atomically operate on a group of one or more block devices. If
1218# any operation fails, then the entire set of actions will be
1219# abandoned and the appropriate error returned. The only operation
1220# supported is currently blockdev-snapshot-sync.
Jeff Cody8802d1f2012-02-28 15:54:06 -05001221#
1222# List of:
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001223# @BlockdevAction: information needed for the device snapshot
Jeff Cody8802d1f2012-02-28 15:54:06 -05001224#
1225# Returns: nothing on success
1226# If @device is not a valid block device, DeviceNotFound
1227# If @device is busy, DeviceInUse will be returned
1228# If @snapshot-file can't be created, OpenFileFailed
1229# If @snapshot-file can't be opened, OpenFileFailed
1230# If @format is invalid, InvalidBlockFormat
1231#
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001232# Note: The transaction aborts on the first failure. Therefore, there will
1233# be only one device or snapshot file returned in an error condition, and
1234# subsequent actions will not have been attempted.
1235#
1236# Since 1.1
Jeff Cody8802d1f2012-02-28 15:54:06 -05001237##
Paolo Bonzini52e7c242012-03-06 18:55:57 +01001238{ 'command': 'transaction',
1239 'data': { 'actions': [ 'BlockdevAction' ] } }
Jeff Cody8802d1f2012-02-28 15:54:06 -05001240
1241##
Luiz Capitulino6106e242011-11-25 16:15:19 -02001242# @blockdev-snapshot-sync
1243#
1244# Generates a synchronous snapshot of a block device.
1245#
1246# @device: the name of the device to generate the snapshot from.
1247#
1248# @snapshot-file: the target of the new image. If the file exists, or if it
1249# is a device, the snapshot will be created in the existing
1250# file/device. If does not exist, a new file will be created.
1251#
1252# @format: #optional the format of the snapshot image, default is 'qcow2'.
1253#
Paolo Bonzini6cc2a412012-03-06 18:55:59 +01001254# @mode: #optional whether and how QEMU should create a new image, default is
1255# 'absolute-paths'.
1256#
Luiz Capitulino6106e242011-11-25 16:15:19 -02001257# Returns: nothing on success
1258# If @device is not a valid block device, DeviceNotFound
1259# If @snapshot-file can't be opened, OpenFileFailed
1260# If @format is invalid, InvalidBlockFormat
1261#
Luiz Capitulino6106e242011-11-25 16:15:19 -02001262# Since 0.14.0
1263##
1264{ 'command': 'blockdev-snapshot-sync',
Paolo Bonzini6cc2a412012-03-06 18:55:59 +01001265 'data': { 'device': 'str', 'snapshot-file': 'str', '*format': 'str',
1266 '*mode': 'NewImageMode'} }
Luiz Capitulinod51a67b2011-11-25 17:52:45 -02001267
1268##
1269# @human-monitor-command:
1270#
1271# Execute a command on the human monitor and return the output.
1272#
1273# @command-line: the command to execute in the human monitor
1274#
1275# @cpu-index: #optional The CPU to use for commands that require an implicit CPU
1276#
1277# Returns: the output of the command as a string
1278#
1279# Since: 0.14.0
1280#
1281# Notes: This command only exists as a stop-gap. It's use is highly
1282# discouraged. The semantics of this command are not guaranteed.
1283#
1284# Known limitations:
1285#
1286# o This command is stateless, this means that commands that depend
1287# on state information (such as getfd) might not work
1288#
1289# o Commands that prompt the user for data (eg. 'cont' when the block
1290# device is encrypted) don't currently work
1291##
1292{ 'command': 'human-monitor-command',
1293 'data': {'command-line': 'str', '*cpu-index': 'int'},
1294 'returns': 'str' }
Luiz Capitulino6cdedb02011-11-27 22:54:09 -02001295
1296##
1297# @migrate_cancel
1298#
1299# Cancel the current executing migration process.
1300#
1301# Returns: nothing on success
1302#
1303# Notes: This command succeeds even if there is no migration process running.
1304#
1305# Since: 0.14.0
1306##
1307{ 'command': 'migrate_cancel' }
Luiz Capitulino4f0a9932011-11-27 23:18:01 -02001308
1309##
1310# @migrate_set_downtime
1311#
1312# Set maximum tolerated downtime for migration.
1313#
1314# @value: maximum downtime in seconds
1315#
1316# Returns: nothing on success
1317#
1318# Since: 0.14.0
1319##
1320{ 'command': 'migrate_set_downtime', 'data': {'value': 'number'} }
Luiz Capitulino3dc85382011-11-28 11:59:37 -02001321
1322##
1323# @migrate_set_speed
1324#
1325# Set maximum speed for migration.
1326#
1327# @value: maximum speed in bytes.
1328#
1329# Returns: nothing on success
1330#
1331# Notes: A value lesser than zero will be automatically round up to zero.
1332#
1333# Since: 0.14.0
1334##
1335{ 'command': 'migrate_set_speed', 'data': {'value': 'int'} }
Anthony Liguorib4b12c62011-12-12 14:29:34 -06001336
1337##
Alon Levyd03ee402012-03-05 15:13:28 +02001338# @ObjectPropertyInfo:
Anthony Liguorib4b12c62011-12-12 14:29:34 -06001339#
1340# @name: the name of the property
1341#
1342# @type: the type of the property. This will typically come in one of four
1343# forms:
1344#
1345# 1) A primitive type such as 'u8', 'u16', 'bool', 'str', or 'double'.
1346# These types are mapped to the appropriate JSON type.
1347#
1348# 2) A legacy type in the form 'legacy<subtype>' where subtype is the
1349# legacy qdev typename. These types are always treated as strings.
1350#
1351# 3) A child type in the form 'child<subtype>' where subtype is a qdev
1352# device type name. Child properties create the composition tree.
1353#
1354# 4) A link type in the form 'link<subtype>' where subtype is a qdev
1355# device type name. Link properties form the device model graph.
1356#
1357# Since: 1.1
1358#
1359# Notes: This type is experimental. Its syntax may change in future releases.
1360##
Anthony Liguori57c9faf2012-01-30 08:55:55 -06001361{ 'type': 'ObjectPropertyInfo',
Anthony Liguorib4b12c62011-12-12 14:29:34 -06001362 'data': { 'name': 'str', 'type': 'str' } }
1363
1364##
1365# @qom-list:
1366#
Anthony Liguori57c9faf2012-01-30 08:55:55 -06001367# This command will list any properties of a object given a path in the object
Anthony Liguorib4b12c62011-12-12 14:29:34 -06001368# model.
1369#
Anthony Liguori57c9faf2012-01-30 08:55:55 -06001370# @path: the path within the object model. See @qom-get for a description of
Anthony Liguorib4b12c62011-12-12 14:29:34 -06001371# this parameter.
1372#
Anthony Liguori57c9faf2012-01-30 08:55:55 -06001373# Returns: a list of @ObjectPropertyInfo that describe the properties of the
1374# object.
Anthony Liguorib4b12c62011-12-12 14:29:34 -06001375#
1376# Since: 1.1
1377#
1378# Notes: This command is experimental. It's syntax may change in future
1379# releases.
1380##
1381{ 'command': 'qom-list',
1382 'data': { 'path': 'str' },
Anthony Liguori57c9faf2012-01-30 08:55:55 -06001383 'returns': [ 'ObjectPropertyInfo' ] }
Anthony Liguorieb6e8ea2011-12-12 14:29:35 -06001384
1385##
1386# @qom-get:
1387#
Anthony Liguori57c9faf2012-01-30 08:55:55 -06001388# This command will get a property from a object model path and return the
Anthony Liguorieb6e8ea2011-12-12 14:29:35 -06001389# value.
1390#
Anthony Liguori57c9faf2012-01-30 08:55:55 -06001391# @path: The path within the object model. There are two forms of supported
Anthony Liguorieb6e8ea2011-12-12 14:29:35 -06001392# paths--absolute and partial paths.
1393#
Anthony Liguori57c9faf2012-01-30 08:55:55 -06001394# Absolute paths are derived from the root object and can follow child<>
Anthony Liguorieb6e8ea2011-12-12 14:29:35 -06001395# or link<> properties. Since they can follow link<> properties, they
1396# can be arbitrarily long. Absolute paths look like absolute filenames
1397# and are prefixed with a leading slash.
1398#
1399# Partial paths look like relative filenames. They do not begin
1400# with a prefix. The matching rules for partial paths are subtle but
Anthony Liguori57c9faf2012-01-30 08:55:55 -06001401# designed to make specifying objects easy. At each level of the
Anthony Liguorieb6e8ea2011-12-12 14:29:35 -06001402# composition tree, the partial path is matched as an absolute path.
1403# The first match is not returned. At least two matches are searched
1404# for. A successful result is only returned if only one match is
1405# found. If more than one match is found, a flag is return to
1406# indicate that the match was ambiguous.
1407#
1408# @property: The property name to read
1409#
1410# Returns: The property value. The type depends on the property type. legacy<>
1411# properties are returned as #str. child<> and link<> properties are
1412# returns as #str pathnames. All integer property types (u8, u16, etc)
1413# are returned as #int.
1414#
1415# Since: 1.1
1416#
1417# Notes: This command is experimental and may change syntax in future releases.
1418##
1419{ 'command': 'qom-get',
1420 'data': { 'path': 'str', 'property': 'str' },
1421 'returns': 'visitor',
1422 'gen': 'no' }
1423
1424##
1425# @qom-set:
1426#
Anthony Liguori57c9faf2012-01-30 08:55:55 -06001427# This command will set a property from a object model path.
Anthony Liguorieb6e8ea2011-12-12 14:29:35 -06001428#
1429# @path: see @qom-get for a description of this parameter
1430#
1431# @property: the property name to set
1432#
1433# @value: a value who's type is appropriate for the property type. See @qom-get
1434# for a description of type mapping.
1435#
1436# Since: 1.1
1437#
1438# Notes: This command is experimental and may change syntax in future releases.
1439##
1440{ 'command': 'qom-set',
1441 'data': { 'path': 'str', 'property': 'str', 'value': 'visitor' },
1442 'gen': 'no' }
Luiz Capitulinofbf796f2011-12-07 11:17:51 -02001443
1444##
1445# @set_password:
1446#
1447# Sets the password of a remote display session.
1448#
1449# @protocol: `vnc' to modify the VNC server password
1450# `spice' to modify the Spice server password
1451#
1452# @password: the new password
1453#
1454# @connected: #optional how to handle existing clients when changing the
1455# password. If nothing is specified, defaults to `keep'
1456# `fail' to fail the command if clients are connected
1457# `disconnect' to disconnect existing clients
1458# `keep' to maintain existing clients
1459#
1460# Returns: Nothing on success
1461# If Spice is not enabled, DeviceNotFound
1462# If @protocol does not support connected, InvalidParameter
1463# If @protocol is invalid, InvalidParameter
1464# If any other error occurs, SetPasswdFailed
1465#
1466# Notes: If VNC is not enabled, SetPasswdFailed is returned.
1467#
1468# Since: 0.14.0
1469##
1470{ 'command': 'set_password',
1471 'data': {'protocol': 'str', 'password': 'str', '*connected': 'str'} }
Luiz Capitulino9ad53722011-12-07 11:47:57 -02001472
1473##
1474# @expire_password:
1475#
1476# Expire the password of a remote display server.
1477#
1478# @protocol: the name of the remote display protocol `vnc' or `spice'
1479#
1480# @time: when to expire the password.
1481# `now' to expire the password immediately
1482# `never' to cancel password expiration
1483# `+INT' where INT is the number of seconds from now (integer)
1484# `INT' where INT is the absolute time in seconds
1485#
1486# Returns: Nothing on success
1487# If @protocol is `spice' and Spice is not active, DeviceNotFound
1488# If an error occurs setting password expiration, SetPasswdFailed
1489# If @protocol is not `spice' or 'vnc', InvalidParameter
1490#
1491# Since: 0.14.0
1492#
1493# Notes: Time is relative to the server and currently there is no way to
1494# coordinate server time with client time. It is not recommended to
1495# use the absolute time version of the @time parameter unless you're
1496# sure you are on the same machine as the QEMU instance.
1497##
1498{ 'command': 'expire_password', 'data': {'protocol': 'str', 'time': 'str'} }
Luiz Capitulinoc245b6a2011-12-07 16:02:36 -02001499
1500##
1501# @eject:
1502#
1503# Ejects a device from a removable drive.
1504#
1505# @device: The name of the device
1506#
1507# @force: @optional If true, eject regardless of whether the drive is locked.
1508# If not specified, the default value is false.
1509#
1510# Returns: Nothing on success
1511# If @device is not a valid block device, DeviceNotFound
1512# If @device is not removable and @force is false, DeviceNotRemovable
1513# If @force is false and @device is locked, DeviceLocked
1514#
1515# Notes: Ejecting a device will no media results in success
1516#
1517# Since: 0.14.0
1518##
1519{ 'command': 'eject', 'data': {'device': 'str', '*force': 'bool'} }
Luiz Capitulino270b2432011-12-08 11:45:55 -02001520
1521##
1522# @change-vnc-password:
1523#
1524# Change the VNC server password.
1525#
1526# @target: the new password to use with VNC authentication
1527#
1528# Since: 1.1
1529#
1530# Notes: An empty password in this command will set the password to the empty
1531# string. Existing clients are unaffected by executing this command.
1532##
1533{ 'command': 'change-vnc-password', 'data': {'password': 'str'} }
Luiz Capitulino333a96e2011-12-08 11:13:50 -02001534
1535##
1536# @change:
1537#
1538# This command is multiple commands multiplexed together.
1539#
1540# @device: This is normally the name of a block device but it may also be 'vnc'.
1541# when it's 'vnc', then sub command depends on @target
1542#
1543# @target: If @device is a block device, then this is the new filename.
1544# If @device is 'vnc', then if the value 'password' selects the vnc
1545# change password command. Otherwise, this specifies a new server URI
1546# address to listen to for VNC connections.
1547#
1548# @arg: If @device is a block device, then this is an optional format to open
1549# the device with.
1550# If @device is 'vnc' and @target is 'password', this is the new VNC
1551# password to set. If this argument is an empty string, then no future
1552# logins will be allowed.
1553#
1554# Returns: Nothing on success.
1555# If @device is not a valid block device, DeviceNotFound
1556# If @format is not a valid block format, InvalidBlockFormat
1557# If the new block device is encrypted, DeviceEncrypted. Note that
1558# if this error is returned, the device has been opened successfully
1559# and an additional call to @block_passwd is required to set the
1560# device's password. The behavior of reads and writes to the block
1561# device between when these calls are executed is undefined.
1562#
1563# Notes: It is strongly recommended that this interface is not used especially
1564# for changing block devices.
1565#
1566# Since: 0.14.0
1567##
1568{ 'command': 'change',
1569 'data': {'device': 'str', 'target': 'str', '*arg': 'str'} }
Luiz Capitulino80047da2011-12-14 16:49:14 -02001570
1571##
1572# @block_set_io_throttle:
1573#
1574# Change I/O throttle limits for a block drive.
1575#
1576# @device: The name of the device
1577#
1578# @bps: total throughput limit in bytes per second
1579#
1580# @bps_rd: read throughput limit in bytes per second
1581#
1582# @bps_wr: write throughput limit in bytes per second
1583#
1584# @iops: total I/O operations per second
1585#
1586# @ops_rd: read I/O operations per second
1587#
1588# @iops_wr: write I/O operations per second
1589#
1590# Returns: Nothing on success
1591# If @device is not a valid block device, DeviceNotFound
1592# If the argument combination is invalid, InvalidParameterCombination
1593#
1594# Since: 1.1
1595##
1596{ 'command': 'block_set_io_throttle',
1597 'data': { 'device': 'str', 'bps': 'int', 'bps_rd': 'int', 'bps_wr': 'int',
1598 'iops': 'int', 'iops_rd': 'int', 'iops_wr': 'int' } }
Stefan Hajnoczi12bd4512012-01-18 14:40:46 +00001599
Stefan Hajnoczidb58f9c2012-04-11 16:27:10 +01001600##
1601# @block-stream:
Stefan Hajnoczi12bd4512012-01-18 14:40:46 +00001602#
1603# Copy data from a backing file into a block device.
1604#
1605# The block streaming operation is performed in the background until the entire
1606# backing file has been copied. This command returns immediately once streaming
1607# has started. The status of ongoing block streaming operations can be checked
1608# with query-block-jobs. The operation can be stopped before it has completed
Stefan Hajnoczidb58f9c2012-04-11 16:27:10 +01001609# using the block-job-cancel command.
Stefan Hajnoczi12bd4512012-01-18 14:40:46 +00001610#
1611# If a base file is specified then sectors are not copied from that base file and
1612# its backing chain. When streaming completes the image file will have the base
1613# file as its backing file. This can be used to stream a subset of the backing
1614# file chain instead of flattening the entire image.
1615#
1616# On successful completion the image file is updated to drop the backing file
1617# and the BLOCK_JOB_COMPLETED event is emitted.
1618#
1619# @device: the device name
1620#
1621# @base: #optional the common backing file name
1622#
Stefan Hajnoczic83c66c2012-04-25 16:51:03 +01001623# @speed: #optional the maximum speed, in bytes per second
1624#
Stefan Hajnoczi12bd4512012-01-18 14:40:46 +00001625# Returns: Nothing on success
1626# If streaming is already active on this device, DeviceInUse
1627# If @device does not exist, DeviceNotFound
1628# If image streaming is not supported by this device, NotSupported
Marcelo Tosatti019b8cb2012-01-18 14:40:52 +00001629# If @base does not exist, BaseNotFound
Stefan Hajnoczic83c66c2012-04-25 16:51:03 +01001630# If @speed is invalid, InvalidParameter
Stefan Hajnoczi12bd4512012-01-18 14:40:46 +00001631#
1632# Since: 1.1
1633##
Stefan Hajnoczic83c66c2012-04-25 16:51:03 +01001634{ 'command': 'block-stream', 'data': { 'device': 'str', '*base': 'str',
1635 '*speed': 'int' } }
Stefan Hajnoczi2d47c6e2012-01-18 14:40:47 +00001636
1637##
Stefan Hajnoczidb58f9c2012-04-11 16:27:10 +01001638# @block-job-set-speed:
Stefan Hajnoczi2d47c6e2012-01-18 14:40:47 +00001639#
1640# Set maximum speed for a background block operation.
1641#
1642# This command can only be issued when there is an active block job.
1643#
1644# Throttling can be disabled by setting the speed to 0.
1645#
1646# @device: the device name
1647#
Stefan Hajnoczic83c66c2012-04-25 16:51:03 +01001648# @speed: the maximum speed, in bytes per second, or 0 for unlimited.
1649# Defaults to 0.
Stefan Hajnoczi2d47c6e2012-01-18 14:40:47 +00001650#
1651# Returns: Nothing on success
1652# If the job type does not support throttling, NotSupported
Stefan Hajnoczi9e6636c2012-04-25 16:51:01 +01001653# If the speed value is invalid, InvalidParameter
Stefan Hajnoczi2d47c6e2012-01-18 14:40:47 +00001654# If streaming is not active on this device, DeviceNotActive
1655#
1656# Since: 1.1
1657##
Stefan Hajnoczidb58f9c2012-04-11 16:27:10 +01001658{ 'command': 'block-job-set-speed',
Stefan Hajnoczi882ec7c2012-04-25 16:51:02 +01001659 'data': { 'device': 'str', 'speed': 'int' } }
Stefan Hajnoczi370521a2012-01-18 14:40:48 +00001660
1661##
Stefan Hajnoczidb58f9c2012-04-11 16:27:10 +01001662# @block-job-cancel:
Stefan Hajnoczi370521a2012-01-18 14:40:48 +00001663#
1664# Stop an active block streaming operation.
1665#
1666# This command returns immediately after marking the active block streaming
1667# operation for cancellation. It is an error to call this command if no
1668# operation is in progress.
1669#
1670# The operation will cancel as soon as possible and then emit the
1671# BLOCK_JOB_CANCELLED event. Before that happens the job is still visible when
1672# enumerated using query-block-jobs.
1673#
1674# The image file retains its backing file unless the streaming operation happens
1675# to complete just as it is being cancelled.
1676#
1677# A new block streaming operation can be started at a later time to finish
1678# copying all data from the backing file.
1679#
1680# @device: the device name
1681#
1682# Returns: Nothing on success
1683# If streaming is not active on this device, DeviceNotActive
1684# If cancellation already in progress, DeviceInUse
1685#
1686# Since: 1.1
1687##
Stefan Hajnoczidb58f9c2012-04-11 16:27:10 +01001688{ 'command': 'block-job-cancel', 'data': { 'device': 'str' } }
Anthony Liguori5eeee3f2011-12-22 14:40:54 -06001689
1690##
1691# @ObjectTypeInfo:
1692#
1693# This structure describes a search result from @qom-list-types
1694#
1695# @name: the type name found in the search
1696#
1697# Since: 1.1
1698#
1699# Notes: This command is experimental and may change syntax in future releases.
1700##
1701{ 'type': 'ObjectTypeInfo',
1702 'data': { 'name': 'str' } }
1703
1704##
1705# @qom-list-types:
1706#
1707# This command will return a list of types given search parameters
1708#
1709# @implements: if specified, only return types that implement this type name
1710#
1711# @abstract: if true, include abstract types in the results
1712#
1713# Returns: a list of @ObjectTypeInfo or an empty list if no results are found
1714#
1715# Since: 1.1
1716#
1717# Notes: This command is experimental and may change syntax in future releases.
1718##
1719{ 'command': 'qom-list-types',
1720 'data': { '*implements': 'str', '*abstract': 'bool' },
1721 'returns': [ 'ObjectTypeInfo' ] }
Luiz Capitulinoe1c37d02011-12-05 14:48:01 -02001722
1723##
1724# @migrate
1725#
1726# Migrates the current running guest to another Virtual Machine.
1727#
1728# @uri: the Uniform Resource Identifier of the destination VM
1729#
1730# @blk: #optional do block migration (full disk copy)
1731#
1732# @inc: #optional incremental disk copy migration
1733#
1734# @detach: this argument exists only for compatibility reasons and
1735# is ignored by QEMU
1736#
1737# Returns: nothing on success
1738#
1739# Since: 0.14.0
1740##
1741{ 'command': 'migrate',
1742 'data': {'uri': 'str', '*blk': 'bool', '*inc': 'bool', '*detach': 'bool' } }
Anthony Liguori33cf6292012-03-19 13:39:42 -05001743
Stefano Stabellinia7ae8352012-01-25 12:24:51 +00001744# @xen-save-devices-state:
1745#
1746# Save the state of all devices to file. The RAM and the block devices
1747# of the VM are not saved by this command.
1748#
1749# @filename: the file to save the state of the devices to as binary
1750# data. See xen-save-devices-state.txt for a description of the binary
1751# format.
1752#
1753# Returns: Nothing on success
1754# If @filename cannot be opened, OpenFileFailed
1755# If an I/O error occurs while writing the file, IOError
1756#
1757# Since: 1.1
1758##
1759{ 'command': 'xen-save-devices-state', 'data': {'filename': 'str'} }
Luiz Capitulinoa15fef22012-03-29 12:38:50 -03001760
1761##
1762# @device_del:
1763#
1764# Remove a device from a guest
1765#
1766# @id: the name of the device
1767#
1768# Returns: Nothing on success
1769# If @id is not a valid device, DeviceNotFound
1770# If the device does not support unplug, BusNoHotplug
1771#
1772# Notes: When this command completes, the device may not be removed from the
1773# guest. Hot removal is an operation that requires guest cooperation.
1774# This command merely requests that the guest begin the hot removal
1775# process.
1776#
1777# Since: 0.14.0
1778##
1779{ 'command': 'device_del', 'data': {'id': 'str'} }
Wen Congyang783e9b42012-05-07 12:10:47 +08001780
1781##
1782# @dump-guest-memory
1783#
1784# Dump guest's memory to vmcore. It is a synchronous operation that can take
1785# very long depending on the amount of guest memory. This command is only
1786# supported only on i386 and x86_64
1787#
1788# @paging: if true, do paging to get guest's memory mapping. The @paging's
1789# default value of @paging is false, If you want to use gdb to process the
1790# core, please set @paging to true. The reason why the @paging's value is
1791# false:
1792# 1. guest machine in a catastrophic state can have corrupted memory,
1793# which we cannot trust.
1794# 2. The guest machine can be in read-mode even if paging is enabled.
1795# For example: the guest machine uses ACPI to sleep, and ACPI sleep
1796# state goes in real-mode
1797# @protocol: the filename or file descriptor of the vmcore. The supported
1798# protocol can be file or fd:
1799# 1. file: the protocol starts with "file:", and the following string is
1800# the file's path.
1801# 2. fd: the protocol starts with "fd:", and the following string is the
1802# fd's name.
1803# @begin: #optional if specified, the starting physical address.
1804# @length: #optional if specified, the memory size, in bytes. If you don't
1805# want to dump all guest's memory, please specify the start @begin and
1806# @length
1807#
1808# Returns: nothing on success
1809# If @begin contains an invalid address, InvalidParameter
1810# If only one of @begin and @length is specified, MissingParameter
1811# If @protocol stats with "fd:", and the fd cannot be found, FdNotFound
1812# If @protocol starts with "file:", and the file cannot be
1813# opened, OpenFileFailed
1814# If @protocol does not start with "fd:" or "file:", InvalidParameter
1815# If an I/O error occurs while writing the file, IOError
1816# If the target does not support this command, Unsupported
1817#
1818# Since: 1.2
1819##
1820{ 'command': 'dump-guest-memory',
1821 'data': { 'paging': 'bool', 'protocol': 'str', '*begin': 'int',
1822 '*length': 'int' } }
Luiz Capitulino928059a2012-04-18 17:34:15 -03001823##
1824# @netdev_add:
1825#
1826# Add a network backend.
1827#
1828# @type: the type of network backend. Current valid values are 'user', 'tap',
1829# 'vde', 'socket', 'dump' and 'bridge'
1830#
1831# @id: the name of the new network backend
1832#
1833# @props: #optional a list of properties to be passed to the backend in
1834# the format 'name=value', like 'ifname=tap0,script=no'
1835#
1836# Notes: The semantics of @props is not well defined. Future commands will be
1837# introduced that provide stronger typing for backend creation.
1838#
1839# Since: 0.14.0
1840#
1841# Returns: Nothing on success
1842# If @type is not a valid network backend, DeviceNotFound
1843# If @id is not a valid identifier, InvalidParameterValue
1844# if @id already exists, DuplicateId
1845# If @props contains an invalid parameter for this backend,
1846# InvalidParameter
1847##
1848{ 'command': 'netdev_add',
1849 'data': {'type': 'str', 'id': 'str', '*props': '**'},
1850 'gen': 'no' }
Luiz Capitulino5f964152012-04-16 14:36:32 -03001851
1852##
1853# @netdev_del:
1854#
1855# Remove a network backend.
1856#
1857# @id: the name of the network backend to remove
1858#
1859# Returns: Nothing on success
1860# If @id is not a valid network backend, DeviceNotFound
1861#
1862# Since: 0.14.0
1863##
1864{ 'command': 'netdev_del', 'data': {'id': 'str'} }