]> git.proxmox.com Git - qemu.git/commitdiff
error: add error_setg()
authorLuiz Capitulino <lcapitulino@redhat.com>
Wed, 29 Aug 2012 14:20:57 +0000 (11:20 -0300)
committerLuiz Capitulino <lcapitulino@redhat.com>
Wed, 5 Sep 2012 18:48:57 +0000 (15:48 -0300)
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>
error.h

diff --git a/error.h b/error.h
index 96fc20328f97f80b4d38b2f9c05f37c7dcb6a70c..da7fed399e680cea77a566e7a87ee597ebc5a8a7 100644 (file)
--- a/error.h
+++ b/error.h
@@ -29,6 +29,12 @@ typedef struct Error Error;
  */
 void error_set(Error **err, ErrorClass err_class, const char *fmt, ...) GCC_FMT_ATTR(3, 4);
 
+/**
+ * Same as error_set(), but sets a generic error
+ */
+#define error_setg(err, fmt, ...) \
+    error_set(err, ERROR_CLASS_GENERIC_ERROR, fmt, ## __VA_ARGS__)
+
 /**
  * Returns true if an indirect pointer to an error is pointing to a valid
  * error object.