From patchwork Thu Jan 28 13:42:55 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 43862 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 0571CB7CF8 for ; Fri, 29 Jan 2010 00:49:38 +1100 (EST) Received: from localhost ([127.0.0.1]:34789 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NaUkY-0002iT-2c for incoming@patchwork.ozlabs.org; Thu, 28 Jan 2010 08:49:34 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NaUed-0000Kq-11 for qemu-devel@nongnu.org; Thu, 28 Jan 2010 08:43:27 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NaUeW-0000Fb-Fg for qemu-devel@nongnu.org; Thu, 28 Jan 2010 08:43:24 -0500 Received: from [199.232.76.173] (port=57165 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NaUeW-0000FN-3a for qemu-devel@nongnu.org; Thu, 28 Jan 2010 08:43:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41873) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NaUeV-0003wi-KA for qemu-devel@nongnu.org; Thu, 28 Jan 2010 08:43:19 -0500 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o0SDhIix022025 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 28 Jan 2010 08:43:19 -0500 Received: from localhost (vpn-10-249.rdu.redhat.com [10.11.10.249]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o0SDhHvO010828 for ; Thu, 28 Jan 2010 08:43:18 -0500 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Thu, 28 Jan 2010 11:42:55 -0200 Message-Id: <1264686180-29845-4-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1264686180-29845-1-git-send-email-lcapitulino@redhat.com> References: <1264686180-29845-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. Subject: [Qemu-devel] [PATCH 3/8] QError: Add QMP mode-oriented errors 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 Two new errors: - QERR_QMP_INVALID_MODE_NAME - QERR_QMP_INVALID_MODE_TRANSITION Signed-off-by: Luiz Capitulino --- qerror.c | 8 ++++++++ qerror.h | 6 ++++++ 2 files changed, 14 insertions(+), 0 deletions(-) diff --git a/qerror.c b/qerror.c index 6c2aba0..d01354d 100644 --- a/qerror.c +++ b/qerror.c @@ -113,6 +113,14 @@ static const QErrorStringTable qerror_table[] = { .desc = "Bad QMP input object", }, { + .error_fmt = QERR_QMP_INVALID_MODE_NAME, + .desc = "Mode name %(name) is invalid", + }, + { + .error_fmt = QERR_QMP_INVALID_MODE_TRANSITION, + .desc = "Invalid mode transition", + }, + { .error_fmt = QERR_SET_PASSWD_FAILED, .desc = "Could not set password", }, diff --git a/qerror.h b/qerror.h index 57c5b97..41154b1 100644 --- a/qerror.h +++ b/qerror.h @@ -94,6 +94,12 @@ QError *qobject_to_qerror(const QObject *obj); #define QERR_QMP_BAD_INPUT_OBJECT \ "{ 'class': 'QMPBadInputObject', 'data': { 'expected': %s } }" +#define QERR_QMP_INVALID_MODE_NAME \ + "{ 'class': 'QMPInvalidModeName', 'data': { 'name': %s } }" + +#define QERR_QMP_INVALID_MODE_TRANSITION \ + "{ 'class': 'QMPInvalidModeTransition', 'data': {} }" + #define QERR_SET_PASSWD_FAILED \ "{ 'class': 'SetPasswdFailed', 'data': {} }"