提交 9d494c4b 编写于 作者: M Markus Armbruster 提交者: Aurelien Jarno

error: Put error definitions back in alphabetical order

Add suitable comments to help keerp them in order.
Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
Signed-off-by: NLuiz Capitulino <lcapitulino@redhat.com>
上级 17a38eaa
...@@ -38,6 +38,10 @@ static const QType qerror_type = { ...@@ -38,6 +38,10 @@ static const QType qerror_type = {
* for example: * for example:
* *
* "running out of foo: %(foo)%%" * "running out of foo: %(foo)%%"
*
* Please keep the entries in alphabetical order.
* Use "sed -n '/^static.*qerror_table\[\]/,/^};/s/QERR_/&/gp' qerror.c | sort -c"
* to check.
*/ */
static const QErrorStringTable qerror_table[] = { static const QErrorStringTable qerror_table[] = {
{ {
...@@ -64,10 +68,6 @@ static const QErrorStringTable qerror_table[] = { ...@@ -64,10 +68,6 @@ static const QErrorStringTable qerror_table[] = {
.error_fmt = QERR_DEVICE_INIT_FAILED, .error_fmt = QERR_DEVICE_INIT_FAILED,
.desc = "Device '%(device)' could not be initialized", .desc = "Device '%(device)' could not be initialized",
}, },
{
.error_fmt = QERR_DEVICE_NOT_ENCRYPTED,
.desc = "Device '%(device)' is not encrypted",
},
{ {
.error_fmt = QERR_DEVICE_LOCKED, .error_fmt = QERR_DEVICE_LOCKED,
.desc = "Device '%(device)' is locked", .desc = "Device '%(device)' is locked",
...@@ -80,6 +80,10 @@ static const QErrorStringTable qerror_table[] = { ...@@ -80,6 +80,10 @@ static const QErrorStringTable qerror_table[] = {
.error_fmt = QERR_DEVICE_NOT_ACTIVE, .error_fmt = QERR_DEVICE_NOT_ACTIVE,
.desc = "Device '%(device)' has not been activated by the guest", .desc = "Device '%(device)' has not been activated by the guest",
}, },
{
.error_fmt = QERR_DEVICE_NOT_ENCRYPTED,
.desc = "Device '%(device)' is not encrypted",
},
{ {
.error_fmt = QERR_DEVICE_NOT_FOUND, .error_fmt = QERR_DEVICE_NOT_FOUND,
.desc = "Device '%(device)' not found", .desc = "Device '%(device)' not found",
......
...@@ -46,6 +46,8 @@ QError *qobject_to_qerror(const QObject *obj); ...@@ -46,6 +46,8 @@ QError *qobject_to_qerror(const QObject *obj);
/* /*
* QError class list * QError class list
* Please keep the definitions in alphabetical order.
* Use "grep '^#define QERR_' qerror.h | sort -c" to check.
*/ */
#define QERR_BAD_BUS_FOR_DEVICE \ #define QERR_BAD_BUS_FOR_DEVICE \
"{ 'class': 'BadBusForDevice', 'data': { 'device': %s, 'bad_bus_type': %s } }" "{ 'class': 'BadBusForDevice', 'data': { 'device': %s, 'bad_bus_type': %s } }"
...@@ -62,9 +64,6 @@ QError *qobject_to_qerror(const QObject *obj); ...@@ -62,9 +64,6 @@ QError *qobject_to_qerror(const QObject *obj);
#define QERR_DEVICE_ENCRYPTED \ #define QERR_DEVICE_ENCRYPTED \
"{ 'class': 'DeviceEncrypted', 'data': { 'device': %s } }" "{ 'class': 'DeviceEncrypted', 'data': { 'device': %s } }"
#define QERR_DEVICE_NOT_ENCRYPTED \
"{ 'class': 'DeviceNotEncrypted', 'data': { 'device': %s } }"
#define QERR_DEVICE_INIT_FAILED \ #define QERR_DEVICE_INIT_FAILED \
"{ 'class': 'DeviceInitFailed', 'data': { 'device': %s } }" "{ 'class': 'DeviceInitFailed', 'data': { 'device': %s } }"
...@@ -77,6 +76,9 @@ QError *qobject_to_qerror(const QObject *obj); ...@@ -77,6 +76,9 @@ QError *qobject_to_qerror(const QObject *obj);
#define QERR_DEVICE_NOT_ACTIVE \ #define QERR_DEVICE_NOT_ACTIVE \
"{ 'class': 'DeviceNotActive', 'data': { 'device': %s } }" "{ 'class': 'DeviceNotActive', 'data': { 'device': %s } }"
#define QERR_DEVICE_NOT_ENCRYPTED \
"{ 'class': 'DeviceNotEncrypted', 'data': { 'device': %s } }"
#define QERR_DEVICE_NOT_FOUND \ #define QERR_DEVICE_NOT_FOUND \
"{ 'class': 'DeviceNotFound', 'data': { 'device': %s } }" "{ 'class': 'DeviceNotFound', 'data': { 'device': %s } }"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册