xref: /openbmc/qemu/qapi/common.json (revision d40d3da0)
1# -*- Mode: Python -*-
2
3##
4# = QAPI common definitions
5##
6
7##
8# @QapiErrorClass:
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#
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##
26{ 'enum': 'QapiErrorClass',
27  # Keep this in sync with ErrorClass in error.h
28  'data': [ 'GenericError', 'CommandNotFound',
29            'DeviceNotActive', 'DeviceNotFound', 'KVMMissingCap' ] }
30
31##
32# @VersionTriple:
33#
34# A three-part version number.
35#
36# @major:  The major version number.
37#
38# @minor:  The minor version number.
39#
40# @micro:  The micro version number.
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.
52#
53# @qemu:        The version of QEMU.  By current convention, a micro
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##
66{ 'struct': 'VersionInfo',
67  'data': {'qemu': 'VersionTriple', 'package': 'str'} }
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
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#
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##
104{ 'struct': 'CommandInfo', 'data': {'name': 'str'} }
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
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#
131##
132{ 'command': 'query-commands', 'returns': ['CommandInfo'] }
133
134##
135# @OnOffAuto:
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' ] }
149
150##
151# @OnOffSplit:
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' ] }
165