[libvirt] [RFC 2/7] util: Introduce virReportWarning()

Andrea Bolognani posted 7 patches 5 years, 7 months ago
[libvirt] [RFC 2/7] util: Introduce virReportWarning()
Posted by Andrea Bolognani 5 years, 7 months ago
This new macro can be used to conveniently report warnings,
just like the existing virReportError() is used for errors.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
---
 src/util/virerror.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/util/virerror.h b/src/util/virerror.h
index 6e089db0d0..308b49c604 100644
--- a/src/util/virerror.h
+++ b/src/util/virerror.h
@@ -189,6 +189,10 @@ void virReportOOMErrorFull(int domcode,
     virReportErrorHelper(VIR_FROM_THIS, code, VIR_ERR_ERROR, __FILE__, \
                          __FUNCTION__, __LINE__, __VA_ARGS__)
 
+# define virReportWarning(code, ...) \
+    virReportErrorHelper(VIR_FROM_THIS, code, VIR_ERR_WARNING, __FILE__, \
+                         __FUNCTION__, __LINE__, __VA_ARGS__)
+
 # define virReportErrorObject(obj) \
     virRaiseErrorObject(__FILE__, __FUNCTION__, __LINE__, obj)
 
-- 
2.17.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list