blob: 8355d5a2f3f3121af52704c6368e6f8cfa3c6d2a [file] [log] [blame]
Benoît Canetd34bda72014-06-05 13:45:29 +02001# -*- Mode: Python -*-
Marc-André Lureaud3a48372017-01-13 15:41:23 +01002
3##
4# = QAPI common definitions
5##
Benoît Canetd34bda72014-06-05 13:45:29 +02006
7##
Marc-André Lureau5072f7b2016-11-17 19:54:55 +04008# @QapiErrorClass:
Benoît Canetd34bda72014-06-05 13:45:29 +02009#
10# QEMU error classes
11#
12# @GenericError: this is used for errors that don't require a specific error
13# class. This should be the default case for most errors
14#
15# @CommandNotFound: the requested command has not been found
16#
Benoît Canetd34bda72014-06-05 13:45:29 +020017# @DeviceNotActive: a device has failed to be become active
18#
19# @DeviceNotFound: the requested device has not been found
20#
21# @KVMMissingCap: the requested operation can't be fulfilled because a
22# required KVM capability is missing
23#
24# Since: 1.2
25##
Eric Blakef22a28b2015-11-18 01:53:00 -070026{ 'enum': 'QapiErrorClass',
27 # Keep this in sync with ErrorClass in error.h
Daniel P. Berrangec01c2142017-06-23 17:24:16 +010028 'data': [ 'GenericError', 'CommandNotFound',
Benoît Canetd34bda72014-06-05 13:45:29 +020029 'DeviceNotActive', 'DeviceNotFound', 'KVMMissingCap' ] }
30
31##
Marc-André Lureau5072f7b2016-11-17 19:54:55 +040032# @VersionTriple:
Eric Blake4752cdb2015-05-04 09:05:31 -060033#
34# A three-part version number.
35#
Marc-André Lureau4d5c8bc2016-11-17 19:54:53 +040036# @major: The major version number.
Eric Blake4752cdb2015-05-04 09:05:31 -060037#
Marc-André Lureau4d5c8bc2016-11-17 19:54:53 +040038# @minor: The minor version number.
Eric Blake4752cdb2015-05-04 09:05:31 -060039#
Marc-André Lureau4d5c8bc2016-11-17 19:54:53 +040040# @micro: The micro version number.
Eric Blake4752cdb2015-05-04 09:05:31 -060041#
42# Since: 2.4
43##
44{ 'struct': 'VersionTriple',
45 'data': {'major': 'int', 'minor': 'int', 'micro': 'int'} }
46
47
48##
Benoît Canetd34bda72014-06-05 13:45:29 +020049# @VersionInfo:
50#
51# A description of QEMU's version.
52#
Eric Blake4752cdb2015-05-04 09:05:31 -060053# @qemu: The version of QEMU. By current convention, a micro
Benoît Canetd34bda72014-06-05 13:45:29 +020054# version of 50 signifies a development branch. A micro version
55# greater than or equal to 90 signifies a release candidate for
56# the next minor version. A micro version of less than 50
57# signifies a stable release.
58#
59# @package: QEMU will always set this field to an empty string. Downstream
60# versions of QEMU should set this to a non-empty string. The
61# exact format depends on the downstream however it highly
62# recommended that a unique name is used.
63#
64# Since: 0.14.0
65##
Eric Blake895a2a82015-05-04 09:05:27 -060066{ 'struct': 'VersionInfo',
Eric Blake4752cdb2015-05-04 09:05:31 -060067 'data': {'qemu': 'VersionTriple', 'package': 'str'} }
Benoît Canetd34bda72014-06-05 13:45:29 +020068
69##
70# @query-version:
71#
72# Returns the current version of QEMU.
73#
74# Returns: A @VersionInfo object describing the current version of QEMU.
75#
76# Since: 0.14.0
Marc-André Lureaudd746af2016-06-23 15:09:51 +020077#
78# Example:
79#
80# -> { "execute": "query-version" }
81# <- {
82# "return":{
83# "qemu":{
84# "major":0,
85# "minor":11,
86# "micro":5
87# },
88# "package":""
89# }
90# }
91#
Benoît Canetd34bda72014-06-05 13:45:29 +020092##
93{ 'command': 'query-version', 'returns': 'VersionInfo' }
94
95##
96# @CommandInfo:
97#
98# Information about a QMP command
99#
100# @name: The command name
101#
102# Since: 0.14.0
103##
Eric Blake895a2a82015-05-04 09:05:27 -0600104{ 'struct': 'CommandInfo', 'data': {'name': 'str'} }
Benoît Canetd34bda72014-06-05 13:45:29 +0200105
106##
107# @query-commands:
108#
109# Return a list of supported QMP commands by this server
110#
111# Returns: A list of @CommandInfo for all supported commands
112#
113# Since: 0.14.0
Marc-André Lureau8b0ffce2016-06-23 15:10:40 +0200114#
115# Example:
116#
117# -> { "execute": "query-commands" }
118# <- {
119# "return":[
120# {
121# "name":"query-balloon"
122# },
123# {
124# "name":"system_powerdown"
125# }
126# ]
127# }
128#
129# Note: This example has been shortened as the real response is too long.
130#
Benoît Canetd34bda72014-06-05 13:45:29 +0200131##
132{ 'command': 'query-commands', 'returns': ['CommandInfo'] }
133
Don Slutzd1048be2014-11-21 11:18:52 -0500134##
Marc-André Lureau5072f7b2016-11-17 19:54:55 +0400135# @OnOffAuto:
Don Slutzd1048be2014-11-21 11:18:52 -0500136#
137# An enumeration of three options: on, off, and auto
138#
139# @auto: QEMU selects the value between on and off
140#
141# @on: Enabled
142#
143# @off: Disabled
144#
145# Since: 2.2
146##
147{ 'enum': 'OnOffAuto',
148 'data': [ 'auto', 'on', 'off' ] }
Matt Gingell32c18a22015-11-16 10:03:06 -0800149
150##
Marc-André Lureau5072f7b2016-11-17 19:54:55 +0400151# @OnOffSplit:
Matt Gingell32c18a22015-11-16 10:03:06 -0800152#
153# An enumeration of three values: on, off, and split
154#
155# @on: Enabled
156#
157# @off: Disabled
158#
159# @split: Mixed
160#
161# Since: 2.6
162##
163{ 'enum': 'OnOffSplit',
164 'data': [ 'on', 'off', 'split' ] }