From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:35008) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SztGS-0001uh-OI for qemu-devel@nongnu.org; Fri, 10 Aug 2012 13:44:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SztGR-0001bV-Hl for qemu-devel@nongnu.org; Fri, 10 Aug 2012 13:44:48 -0400 Received: from mx1.redhat.com ([209.132.183.28]:3200) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SztGR-0001bQ-8v for qemu-devel@nongnu.org; Fri, 10 Aug 2012 13:44:47 -0400 From: Luiz Capitulino Date: Fri, 10 Aug 2012 14:44:04 -0300 Message-Id: <1344620653-29067-27-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1344620653-29067-1-git-send-email-lcapitulino@redhat.com> References: <1344620653-29067-1-git-send-email-lcapitulino@redhat.com> Subject: [Qemu-devel] [PATCH 26/35] error: add error_get_class() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, aliguori@us.ibm.com, armbru@redhat.com, mdroth@linux.vnet.ibm.com, pbonzini@redhat.com, eblake@redhat.com 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 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. */ -- 1.7.11.2.249.g31c7954.dirty