On Wed, Mar 16, 2016 at 12:05:34PM +0100, Erik Skultety wrote:
In order to refactor the ugly virLogParseOutputs method, this is a
neat way of
finding out whether the destination type (in the form of a string) user
provided is a valid one. As a bonus, if it turns out it is valid, we get the
actual enum which will later be passed to any of virLogAddOutput methods right
away.
---
src/util/virlog.c | 25 +++++--------------------
src/util/virlog.h | 5 ++++-
2 files changed, 9 insertions(+), 21 deletions(-)
ACK
diff --git a/src/util/virlog.h b/src/util/virlog.h
index 9ece3b5..f4e7b62 100644
--- a/src/util/virlog.h
+++ b/src/util/virlog.h
@@ -24,6 +24,7 @@
# include "internal.h"
# include "virbuffer.h"
+# include "virutil.h"
# ifdef PACKAGER_VERSION
# ifdef PACKAGER
@@ -51,13 +52,15 @@ typedef enum {
# define VIR_LOG_DEFAULT VIR_LOG_WARN
typedef enum {
- VIR_LOG_TO_STDERR = 1,
+ VIR_LOG_TO_STDERR = 0,
VIR_LOG_TO_SYSLOG,
VIR_LOG_TO_FILE,
VIR_LOG_TO_JOURNALD,
VIR_LOG_TO_OUTPUT_LAST,
} virLogDestinationType;
+VIR_ENUM_DECL(virLogDestination)
+
The Type*String functions are only used in virlog.c, moving the
VIR_ENUM_DECL there would remove the need to move the virutil include.
Jan