2015-08-21 07:04:50 +00:00
|
|
|
# -*- Mode: Python -*-
|
|
|
|
#
|
|
|
|
# QAPI common definitions
|
|
|
|
|
|
|
|
##
|
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.
Backports commit f22a28b898322c01b0463a8b7ec551d72bc61a5b from qemu
2018-02-20 01:38:49 +00:00
|
|
|
# @QapiErrorClass
|
2015-08-21 07:04:50 +00: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
|
|
|
|
#
|
|
|
|
# @DeviceEncrypted: the requested operation can't be fulfilled because the
|
|
|
|
# selected device is encrypted
|
|
|
|
#
|
|
|
|
# @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.
Backports commit f22a28b898322c01b0463a8b7ec551d72bc61a5b from qemu
2018-02-20 01:38:49 +00:00
|
|
|
{ 'enum': 'QapiErrorClass',
|
|
|
|
# Keep this in sync with ErrorClass in error.h
|
2015-08-21 07:04:50 +00:00
|
|
|
'data': [ 'GenericError', 'CommandNotFound', 'DeviceEncrypted',
|
|
|
|
'DeviceNotActive', 'DeviceNotFound', 'KVMMissingCap' ] }
|
|
|
|
|