]> git.proxmox.com Git - qemu.git/commitdiff
error: add error_get_class()
authorLuiz Capitulino <lcapitulino@redhat.com>
Wed, 1 Aug 2012 19:29:38 +0000 (16:29 -0300)
committerLuiz Capitulino <lcapitulino@redhat.com>
Mon, 13 Aug 2012 16:21:31 +0000 (13:21 -0300)
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
error.c
error.h

diff --git a/error.c b/error.c
index 648706aa678a025cf0052964c15943b9506003e6..2d34cde654ff95dc10d8e280e0301d0664b3bd10 100644 (file)
--- 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 96787521526a3d3d8ac8215e23d908ca9b5b8e0e..114e24b34bfd0de83161f12f69d86d08d147a761 100644 (file)
--- 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.
  */