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

Andrea Bolognani abologna at redhat.com
Tue Oct 2 14:14:41 UTC 2018


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 at 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




More information about the libvir-list mailing list