]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
s/int/virLogDestination/ in logging code
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 27 Sep 2012 13:04:21 +0000 (14:04 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Fri, 28 Sep 2012 09:22:13 +0000 (10:22 +0100)
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@redhat.com>
src/util/logging.c
src/util/logging.h
tests/testutils.c

index aaebdc3f5fcceb3385e46e7866e2bd464b8a70e9..328d1f5185f2833427d74d3c9ceb4c597621bcfb 100644 (file)
@@ -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) {
index 818388ad825beed2de431141c50c1bf04ad3f69a..ccf775cc683cfc628d3882ed1d8904790850ccb2 100644 (file)
@@ -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);
 
 /*
index 82ebabf04d99b805adb0fb95b06c40ad287a87f8..eebe002c8e3ffabce217ad6112c0ae3a95b62c8f 100644 (file)
@@ -610,7 +610,7 @@ int virtTestMain(int argc,
     virLogSetFromEnv();
     if (!getenv("LIBVIRT_DEBUG") && !virLogGetNbOutputs()) {
         if (virLogDefineOutput(virtTestLogOutput, virtTestLogClose, &testLog,
-                               VIR_LOG_DEBUG, 0, NULL, 0) < 0)
+                               VIR_LOG_DEBUG, VIR_LOG_TO_STDERR, NULL, 0) < 0)
             return 1;
     }