From patchwork Mon Dec 7 20:37:02 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markus Armbruster X-Patchwork-Id: 40534 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 009ABB6F1C for ; Tue, 8 Dec 2009 08:11:00 +1100 (EST) Received: from localhost ([127.0.0.1]:38481 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHkrB-0007ye-RT for incoming@patchwork.ozlabs.org; Mon, 07 Dec 2009 16:10:57 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NHkKs-00032a-N1 for qemu-devel@nongnu.org; Mon, 07 Dec 2009 15:37:34 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NHkKk-0002wj-Fz for qemu-devel@nongnu.org; Mon, 07 Dec 2009 15:37:31 -0500 Received: from [199.232.76.173] (port=46523 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NHkKk-0002vx-1W for qemu-devel@nongnu.org; Mon, 07 Dec 2009 15:37:26 -0500 Received: from oxygen.pond.sub.org ([213.239.205.148]:47572) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NHkKf-0001S0-Dg for qemu-devel@nongnu.org; Mon, 07 Dec 2009 15:37:22 -0500 Received: from crossbow.pond.sub.org (pD9E38C82.dip.t-dialin.net [217.227.140.130]) by oxygen.pond.sub.org (Postfix) with ESMTPA id 7E370276D54 for ; Mon, 7 Dec 2009 21:37:17 +0100 (CET) Received: by crossbow.pond.sub.org (Postfix, from userid 500) id D0E0B20BE6; Mon, 7 Dec 2009 21:37:16 +0100 (CET) From: Markus Armbruster To: qemu-devel@nongnu.org Date: Mon, 7 Dec 2009 21:37:02 +0100 Message-Id: <1260218236-22143-5-git-send-email-armbru@redhat.com> X-Mailer: git-send-email 1.6.2.5 In-Reply-To: <1260218236-22143-1-git-send-email-armbru@redhat.com> References: <1260218236-22143-1-git-send-email-armbru@redhat.com> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: lcapitulino@redhat.com Subject: [Qemu-devel] [FOR 0.12 PATCH 04/18] QError: Put error definitions in alphabetical order X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Also fix the odd typoe and clean up whitespace. Signed-off-by: Markus Armbruster --- qerror.c | 28 ++++++++++++++-------------- qerror.h | 30 +++++++++++++++--------------- 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/qerror.c b/qerror.c index d90529c..03e3b34 100644 --- a/qerror.c +++ b/qerror.c @@ -41,28 +41,32 @@ static const QType qerror_type = { */ static const QErrorStringTable qerror_table[] = { { - .error_fmt = QERR_COMMAND_NOT_FOUND, - .desc = "The command %(name) has not been found", + .error_fmt = QERR_COMMAND_NOT_FOUND, + .desc = "The command %(name) has not been found", }, { .error_fmt = QERR_DEVICE_ENCRYPTED, .desc = "The %(device) is encrypted", }, { + .error_fmt = QERR_DEVICE_NOT_ACTIVE, + .desc = "The %(device) device has not been activated by the guest", + }, + { .error_fmt = QERR_DEVICE_NOT_FOUND, .desc = "The %(device) device has not been found", }, { - .error_fmt = QERR_DEVICE_NOT_ACTIVE, - .desc = "The %(device) device has not been activated by the guest", + .error_fmt = QERR_INVALID_PARAMETER_TYPE, + .desc = "Invalid parameter type, expected: %(expected)", }, { - .error_fmt = QERR_INVALID_PARAMETER_TYPE, - .desc = "Invalid parameter type, expected: %(expected)", + .error_fmt = QERR_INVALID_PASSWORD, + .desc = "The entered password is invalid", }, { - .error_fmt = QERR_INVALID_PASSWORD, - .desc = "The entered password is invalid", + .error_fmt = QERR_JSON_PARSING, + .desc = "Invalid JSON syntax", }, { .error_fmt = QERR_KVM_MISSING_CAP, @@ -77,12 +81,8 @@ static const QErrorStringTable qerror_table[] = { .desc = "Bad QMP input object", }, { - .error_fmt = QERR_JSON_PARSING, - .desc = "Invalid JSON synaxt", - }, - { - .error_fmt = QERR_UNDEFINED_ERROR, - .desc = "An undefined error has ocurred", + .error_fmt = QERR_UNDEFINED_ERROR, + .desc = "An undefined error has ocurred", }, {} }; diff --git a/qerror.h b/qerror.h index c9fcf97..062c0c4 100644 --- a/qerror.h +++ b/qerror.h @@ -39,36 +39,36 @@ QError *qobject_to_qerror(const QObject *obj); * QError class list */ #define QERR_COMMAND_NOT_FOUND \ - "{ 'class': 'CommandNotFound', 'data': { 'name': %s } }" + "{ 'class': 'CommandNotFound', 'data': { 'name': %s } }" #define QERR_DEVICE_ENCRYPTED \ - "{ 'class': 'DeviceEncrypted', 'data': { 'device': %s } }" - -#define QERR_DEVICE_NOT_FOUND \ - "{ 'class': 'DeviceNotFound', 'data': { 'device': %s } }" + "{ 'class': 'DeviceEncrypted', 'data': { 'device': %s } }" #define QERR_DEVICE_NOT_ACTIVE \ - "{ 'class': 'DeviceNotActive', 'data': { 'device': %s } }" + "{ 'class': 'DeviceNotActive', 'data': { 'device': %s } }" + +#define QERR_DEVICE_NOT_FOUND \ + "{ 'class': 'DeviceNotFound', 'data': { 'device': %s } }" #define QERR_INVALID_PARAMETER_TYPE \ - "{ 'class': 'InvalidParameterType', 'data': { 'name': %s,'expected': %s } }" + "{ 'class': 'InvalidParameterType', 'data': { 'name': %s,'expected': %s } }" #define QERR_INVALID_PASSWORD \ - "{ 'class': 'InvalidPassword', 'data': {} }" + "{ 'class': 'InvalidPassword', 'data': {} }" + +#define QERR_JSON_PARSING \ + "{ 'class': 'JSONParsing', 'data': {} }" #define QERR_KVM_MISSING_CAP \ - "{ 'class': 'KVMMissingCap', 'data': { 'capability': %s, 'feature': %s } }" + "{ 'class': 'KVMMissingCap', 'data': { 'capability': %s, 'feature': %s } }" #define QERR_MISSING_PARAMETER \ - "{ 'class': 'MissingParameter', 'data': { 'name': %s } }" + "{ 'class': 'MissingParameter', 'data': { 'name': %s } }" #define QERR_QMP_BAD_INPUT_OBJECT \ - "{ 'class': 'QMPBadInputObject', 'data': { 'expected': %s } }" - -#define QERR_JSON_PARSING \ - "{ 'class': 'JSONParsing', 'data': {} }" + "{ 'class': 'QMPBadInputObject', 'data': { 'expected': %s } }" #define QERR_UNDEFINED_ERROR \ - "{ 'class': 'UndefinedError', 'data': {} }" + "{ 'class': 'UndefinedError', 'data': {} }" #endif /* QERROR_H */