From patchwork Mon Aug 13 19:48:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 177044 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 731192C0085 for ; Tue, 14 Aug 2012 05:56:11 +1000 (EST) Received: from localhost ([::1]:45777 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T10kC-0000TV-SG for incoming@patchwork.ozlabs.org; Mon, 13 Aug 2012 15:56:08 -0400 Received: from eggs.gnu.org ([208.118.235.92]:38437) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T10dX-0001In-J6 for qemu-devel@nongnu.org; Mon, 13 Aug 2012 15:49:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T10dV-0003sH-CG for qemu-devel@nongnu.org; Mon, 13 Aug 2012 15:49:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34685) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T10dV-0003s2-1a for qemu-devel@nongnu.org; Mon, 13 Aug 2012 15:49:13 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q7DJnCb1008358 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 13 Aug 2012 15:49:12 -0400 Received: from localhost (ovpn-113-98.phx2.redhat.com [10.3.113.98]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q7DJnBuC000909; Mon, 13 Aug 2012 15:49:11 -0400 From: Luiz Capitulino To: aliguori@us.ibm.com Date: Mon, 13 Aug 2012 16:48:47 -0300 Message-Id: <1344887349-13041-27-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1344887349-13041-1-git-send-email-lcapitulino@redhat.com> References: <1344887349-13041-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 26/48] error: add error_get_class() X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Luiz Capitulino Reviewed-by: Markus Armbruster --- error.c | 5 +++++ error.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/error.c b/error.c index 648706a..2d34cde 100644 --- a/error.c +++ b/error.c @@ -64,6 +64,11 @@ bool error_is_set(Error **errp) return (errp && *errp); } +ErrorClass error_get_class(const Error *err) +{ + return err->err_class; +} + const char *error_get_pretty(Error *err) { return err->msg; diff --git a/error.h b/error.h index 9678752..114e24b 100644 --- a/error.h +++ b/error.h @@ -35,6 +35,11 @@ void error_set(Error **err, ErrorClass err_class, const char *fmt, ...) GCC_FMT_ */ bool error_is_set(Error **err); +/* + * Get the error class of an error object. + */ +ErrorClass error_get_class(const Error *err); + /** * Returns an exact copy of the error passed as an argument. */