]> git.proxmox.com Git - mirror_qemu.git/blame - qapi/common.json
qapi-schema: Fold event.json back into qapi-schema.json
[mirror_qemu.git] / qapi / common.json
CommitLineData
d34bda71 1# -*- Mode: Python -*-
d3a48372
MAL
2
3##
4# = QAPI common definitions
5##
d34bda71
BC
6
7##
5072f7b3 8# @QapiErrorClass:
d34bda71
BC
9#
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#
d34bda71
BC
17# @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##
f22a28b8
EB
26{ 'enum': 'QapiErrorClass',
27 # Keep this in sync with ErrorClass in error.h
c01c214b 28 'data': [ 'GenericError', 'CommandNotFound',
d34bda71
BC
29 'DeviceNotActive', 'DeviceNotFound', 'KVMMissingCap' ] }
30
31##
5072f7b3 32# @VersionTriple:
d34bda71 33#
4752cdbb
EB
34# A three-part version number.
35#
4d5c8bc4 36# @major: The major version number.
d34bda71 37#
4d5c8bc4 38# @minor: The minor version number.
d34bda71 39#
4d5c8bc4 40# @micro: The micro version number.
4752cdbb
EB
41#
42# Since: 2.4
43##
44{ 'struct': 'VersionTriple',
45 'data': {'major': 'int', 'minor': 'int', 'micro': 'int'} }
46
47
48##
49# @VersionInfo:
50#
51# A description of QEMU's version.
d34bda71 52#
4752cdbb 53# @qemu: The version of QEMU. By current convention, a micro
d34bda71
BC
54# 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##
895a2a80 66{ 'struct': 'VersionInfo',
4752cdbb 67 'data': {'qemu': 'VersionTriple', 'package': 'str'} }
d34bda71
BC
68
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
dd746afb
MAL
77#
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#
d34bda71
BC
92##
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##
895a2a80 104{ 'struct': 'CommandInfo', 'data': {'name': 'str'} }
d34bda71
BC
105
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
8b0ffce4
MAL
114#
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#
d34bda71
BC
131##
132{ 'command': 'query-commands', 'returns': ['CommandInfo'] }
133
d1048bef 134##
5072f7b3 135# @OnOffAuto:
d1048bef
DS
136#
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' ] }
32c18a2d
MG
149
150##
5072f7b3 151# @OnOffSplit:
32c18a2d
MG
152#
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' ] }
a2ff5a48
MA
165
166##
167# @String:
168#
169# A fat type wrapping 'str', to be embedded in lists.
170#
171# Since: 1.2
172##
173{ 'struct': 'String',
174 'data': {
175 'str': 'str' } }
48685a8e
MA
176
177##
178# @StrOrNull:
179#
180# This is a string value or the explicit lack of a string (null
181# pointer in C). Intended for cases when 'optional absent' already
182# has a different meaning.
183#
184# @s: the string value
185# @n: no string value
186#
187# Since: 2.10
188##
189{ 'alternate': 'StrOrNull',
190 'data': { 's': 'str',
191 'n': 'null' } }