[PATCH 3/9] s/int/virLogDestination/ in logging code

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>

The log destinations are an enum, but most of the code was
just using a plain 'int' for function params / variables.

Signed-off-by: Daniel P. Berrange <berrange@xxxxxxxxxx>
---
 src/util/logging.c | 4 ++--
 src/util/logging.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/util/logging.c b/src/util/logging.c
index f47b98f..d8c9b75 100644
--- a/src/util/logging.c
+++ b/src/util/logging.c
@@ -564,7 +564,7 @@ static int virLogResetOutputs(void) {
  * Returns -1 in case of failure or the output number if successful
  */
 int virLogDefineOutput(virLogOutputFunc f, virLogCloseFunc c, void *data,
-                       virLogPriority priority, int dest, const char *name,
+                       virLogPriority priority, virLogDestination dest, const char *name,
                        unsigned int flags)
 {
     int ret = -1;
@@ -1139,7 +1139,7 @@ char *virLogGetOutputs(void) {
 
     virLogLock();
     for (i = 0; i < virLogNbOutputs; i++) {
-        int dest = virLogOutputs[i].dest;
+        virLogDestination dest = virLogOutputs[i].dest;
         if (i)
             virBufferAsprintf(&outputbuf, " ");
         switch (dest) {
diff --git a/src/util/logging.h b/src/util/logging.h
index 32d14a8..2d500a4 100644
--- a/src/util/logging.h
+++ b/src/util/logging.h
@@ -125,7 +125,7 @@ extern void virLogSetFromEnv(void);
 extern int virLogDefineFilter(const char *match, virLogPriority priority,
                               unsigned int flags);
 extern int virLogDefineOutput(virLogOutputFunc f, virLogCloseFunc c, void *data,
-                              virLogPriority priority, int dest, const char *name,
+                              virLogPriority priority, virLogDestination dest, const char *name,
                               unsigned int flags);
 
 /*
-- 
1.7.11.4

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


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]