From patchwork Thu Aug 2 01:02:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luiz Capitulino X-Patchwork-Id: 174634 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 744422C007C for ; Thu, 2 Aug 2012 11:31:20 +1000 (EST) Received: from localhost ([::1]:33604 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SwkFy-0007Ze-IX for incoming@patchwork.ozlabs.org; Wed, 01 Aug 2012 21:31:18 -0400 Received: from eggs.gnu.org ([208.118.235.92]:35621) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Swjoi-0004SP-R4 for qemu-devel@nongnu.org; Wed, 01 Aug 2012 21:03:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Swjoh-0003QO-KC for qemu-devel@nongnu.org; Wed, 01 Aug 2012 21:03:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:9623) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Swjoh-0003Q2-9p for qemu-devel@nongnu.org; Wed, 01 Aug 2012 21:03:07 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q72135Fh021232 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 1 Aug 2012 21:03:05 -0400 Received: from localhost (ovpn-113-85.phx2.redhat.com [10.3.113.85]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q72134tw015563; Wed, 1 Aug 2012 21:03:04 -0400 From: Luiz Capitulino To: qemu-devel@nongnu.org Date: Wed, 1 Aug 2012 22:02:48 -0300 Message-Id: <1343869374-23417-29-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1343869374-23417-1-git-send-email-lcapitulino@redhat.com> References: <1343869374-23417-1-git-send-email-lcapitulino@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: kwolf@redhat.com, aliguori@us.ibm.com, armbru@redhat.com, mdroth@linux.vnet.ibm.com, pbonzini@redhat.com, eblake@redhat.com Subject: [Qemu-devel] [PATCH 28/34] 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 --- error.c | 5 +++++ error.h | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/error.c b/error.c index 6c8f7b8..15a2d06 100644 --- a/error.c +++ b/error.c @@ -69,6 +69,11 @@ const char *error_get_pretty(Error *err) return err->msg; } +ErrorClass error_get_class(const Error *err) +{ + return err->err_class; +} + void error_free(Error *err) { if (err) { diff --git a/error.h b/error.h index 905613a..7b85b50 100644 --- a/error.h +++ b/error.h @@ -46,6 +46,11 @@ Error *error_copy(const Error *err); const char *error_get_pretty(Error *err); /** + * Get the error class of an error object. + */ +ErrorClass error_get_class(const Error *err); + +/** * Propagate an error to an indirect pointer to an error. This function will * always transfer ownership of the error reference and handles the case where * dst_err is NULL correctly. Errors after the first are discarded.