2014-06-05 13:45:29 +02:00
|
|
|
# -*- Mode: Python -*-
|
2017-01-13 15:41:23 +01:00
|
|
|
|
|
|
|
##
|
|
|
|
# = QAPI common definitions
|
|
|
|
##
|
2014-06-05 13:45:29 +02:00
|
|
|
|
|
|
|
##
|
2016-11-17 16:54:55 +01:00
|
|
|
# @QapiErrorClass:
|
2014-06-05 13:45:29 +02:00
|
|
|
#
|
|
|
|
# QEMU error classes
|
|
|
|
#
|
|
|
|
# @GenericError: this is used for errors that don't require a specific error
|
|
|
|
# class. This should be the default case for most errors
|
|
|
|
#
|
|
|
|
# @CommandNotFound: the requested command has not been found
|
|
|
|
#
|
|
|
|
# @DeviceNotActive: a device has failed to be become active
|
|
|
|
#
|
|
|
|
# @DeviceNotFound: the requested device has not been found
|
|
|
|
#
|
|
|
|
# @KVMMissingCap: the requested operation can't be fulfilled because a
|
|
|
|
# required KVM capability is missing
|
|
|
|
#
|
|
|
|
# Since: 1.2
|
|
|
|
##
|
qapi: Add alias for ErrorClass
The qapi enum ErrorClass is unusual that it uses 'CamelCase' names,
contrary to our documented convention of preferring 'lower-case'.
However, this enum is entrenched in the API; we cannot change
what strings QMP outputs. Meanwhile, we want to simplify how
c_enum_const() is used to generate enum constants, by moving away
from the heuristics of camel_to_upper() to a more straightforward
c_name(N).upper() - but doing so will rename all of the ErrorClass
constants and cause churn to all client files, where the new names
are aesthetically less pleasing (ERROR_CLASS_DEVICENOTFOUND looks
like we can't make up our minds on whether to break between words).
So as always in computer science, solve the problem by some more
indirection: rename the qapi type to QapiErrorClass, and add a
new enum ErrorClass in error.h whose members are aliases of the
qapi type, but with the spelling expected elsewhere in the tree.
Then, when c_enum_const() changes the munging, we only have to
adjust the one alias spot.
Suggested by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
Message-Id: <1447836791-369-26-git-send-email-eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2015-11-18 09:53:00 +01:00
|
|
|
{ 'enum': 'QapiErrorClass',
|
|
|
|
# Keep this in sync with ErrorClass in error.h
|
2017-06-23 18:24:16 +02:00
|
|
|
'data': [ 'GenericError', 'CommandNotFound',
|
2014-06-05 13:45:29 +02:00
|
|
|
'DeviceNotActive', 'DeviceNotFound', 'KVMMissingCap' ] }
|
|
|
|
|
|
|
|
##
|
2016-11-17 16:54:55 +01:00
|
|
|
# @VersionTriple:
|
2014-06-05 13:45:29 +02:00
|
|
|
#
|
2015-05-04 17:05:31 +02:00
|
|
|
# A three-part version number.
|
|
|
|
#
|
2016-11-17 16:54:53 +01:00
|
|
|
# @major: The major version number.
|
2014-06-05 13:45:29 +02:00
|
|
|
#
|
2016-11-17 16:54:53 +01:00
|
|
|
# @minor: The minor version number.
|
2014-06-05 13:45:29 +02:00
|
|
|
#
|
2016-11-17 16:54:53 +01:00
|
|
|
# @micro: The micro version number.
|
2015-05-04 17:05:31 +02:00
|
|
|
#
|
|
|
|
# Since: 2.4
|
|
|
|
##
|
|
|
|
{ 'struct': 'VersionTriple',
|
|
|
|
'data': {'major': 'int', 'minor': 'int', 'micro': 'int'} }
|
|
|
|
|
|
|
|
|
|
|
|
##
|
|
|
|
# @VersionInfo:
|
|
|
|
#
|
|
|
|
# A description of QEMU's version.
|
2014-06-05 13:45:29 +02:00
|
|
|
#
|
2015-05-04 17:05:31 +02:00
|
|
|
# @qemu: The version of QEMU. By current convention, a micro
|
2014-06-05 13:45:29 +02:00
|
|
|
# version of 50 signifies a development branch. A micro version
|
|
|
|
# greater than or equal to 90 signifies a release candidate for
|
|
|
|
# the next minor version. A micro version of less than 50
|
|
|
|
# signifies a stable release.
|
|
|
|
#
|
|
|
|
# @package: QEMU will always set this field to an empty string. Downstream
|
|
|
|
# versions of QEMU should set this to a non-empty string. The
|
|
|
|
# exact format depends on the downstream however it highly
|
|
|
|
# recommended that a unique name is used.
|
|
|
|
#
|
|
|
|
# Since: 0.14.0
|
|
|
|
##
|
2015-05-04 17:05:27 +02:00
|
|
|
{ 'struct': 'VersionInfo',
|
2015-05-04 17:05:31 +02:00
|
|
|
'data': {'qemu': 'VersionTriple', 'package': 'str'} }
|
2014-06-05 13:45:29 +02:00
|
|
|
|
|
|
|
##
|
|
|
|
# @query-version:
|
|
|
|
#
|
|
|
|
# Returns the current version of QEMU.
|
|
|
|
#
|
|
|
|
# Returns: A @VersionInfo object describing the current version of QEMU.
|
|
|
|
#
|
|
|
|
# Since: 0.14.0
|
2016-06-23 15:09:51 +02:00
|
|
|
#
|
|
|
|
# Example:
|
|
|
|
#
|
|
|
|
# -> { "execute": "query-version" }
|
|
|
|
# <- {
|
|
|
|
# "return":{
|
|
|
|
# "qemu":{
|
|
|
|
# "major":0,
|
|
|
|
# "minor":11,
|
|
|
|
# "micro":5
|
|
|
|
# },
|
|
|
|
# "package":""
|
|
|
|
# }
|
|
|
|
# }
|
|
|
|
#
|
2014-06-05 13:45:29 +02:00
|
|
|
##
|
|
|
|
{ 'command': 'query-version', 'returns': 'VersionInfo' }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @CommandInfo:
|
|
|
|
#
|
|
|
|
# Information about a QMP command
|
|
|
|
#
|
|
|
|
# @name: The command name
|
|
|
|
#
|
|
|
|
# Since: 0.14.0
|
|
|
|
##
|
2015-05-04 17:05:27 +02:00
|
|
|
{ 'struct': 'CommandInfo', 'data': {'name': 'str'} }
|
2014-06-05 13:45:29 +02:00
|
|
|
|
|
|
|
##
|
|
|
|
# @query-commands:
|
|
|
|
#
|
|
|
|
# Return a list of supported QMP commands by this server
|
|
|
|
#
|
|
|
|
# Returns: A list of @CommandInfo for all supported commands
|
|
|
|
#
|
|
|
|
# Since: 0.14.0
|
2016-06-23 15:10:40 +02:00
|
|
|
#
|
|
|
|
# Example:
|
|
|
|
#
|
|
|
|
# -> { "execute": "query-commands" }
|
|
|
|
# <- {
|
|
|
|
# "return":[
|
|
|
|
# {
|
|
|
|
# "name":"query-balloon"
|
|
|
|
# },
|
|
|
|
# {
|
|
|
|
# "name":"system_powerdown"
|
|
|
|
# }
|
|
|
|
# ]
|
|
|
|
# }
|
|
|
|
#
|
|
|
|
# Note: This example has been shortened as the real response is too long.
|
|
|
|
#
|
2014-06-05 13:45:29 +02:00
|
|
|
##
|
|
|
|
{ 'command': 'query-commands', 'returns': ['CommandInfo'] }
|
|
|
|
|
2014-11-21 17:18:52 +01:00
|
|
|
##
|
2016-11-17 16:54:55 +01:00
|
|
|
# @OnOffAuto:
|
2014-11-21 17:18:52 +01:00
|
|
|
#
|
|
|
|
# An enumeration of three options: on, off, and auto
|
|
|
|
#
|
|
|
|
# @auto: QEMU selects the value between on and off
|
|
|
|
#
|
|
|
|
# @on: Enabled
|
|
|
|
#
|
|
|
|
# @off: Disabled
|
|
|
|
#
|
|
|
|
# Since: 2.2
|
|
|
|
##
|
|
|
|
{ 'enum': 'OnOffAuto',
|
|
|
|
'data': [ 'auto', 'on', 'off' ] }
|
2015-11-16 19:03:06 +01:00
|
|
|
|
|
|
|
##
|
2016-11-17 16:54:55 +01:00
|
|
|
# @OnOffSplit:
|
2015-11-16 19:03:06 +01:00
|
|
|
#
|
|
|
|
# An enumeration of three values: on, off, and split
|
|
|
|
#
|
|
|
|
# @on: Enabled
|
|
|
|
#
|
|
|
|
# @off: Disabled
|
|
|
|
#
|
|
|
|
# @split: Mixed
|
|
|
|
#
|
|
|
|
# Since: 2.6
|
|
|
|
##
|
|
|
|
{ 'enum': 'OnOffSplit',
|
|
|
|
'data': [ 'on', 'off', 'split' ] }
|