Re: [PATCH 1/9] s/int/virLogPriority/ in logging code

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

 



On 09/27/2012 12:18 PM, Eric Blake wrote:
> On 09/27/2012 10:44 AM, Daniel P. Berrange wrote:
>> From: "Daniel P. Berrange" <berrange@xxxxxxxxxx>
>>
>> The log priority levels 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 | 34 +++++++++++++++++-----------------
>>  src/util/logging.h | 14 +++++++-------
>>  2 files changed, 24 insertions(+), 24 deletions(-)
> 
> ACK.  Fairly straight-forward.

Spoke too soon; I got a test failure:

testutils.c: In function 'virtTestMain':
testutils.c:613:32: error: passing argument 1 of 'virLogDefineOutput'
from incompatible pointer type [-Werror]
In file included from testutils.c:47:0:
../src/util/logging.h:127:12: note: expected 'virLogOutputFunc' but
argument is of type 'void (*)(const char *, int,  const char *, long
long int,  const char *, unsigned int,  const char *, const char *, void *)'

Squash this in:

diff --git i/tests/testutils.c w/tests/testutils.c
index a33b10d..86be3f5 100644
--- i/tests/testutils.c
+++ w/tests/testutils.c
@@ -481,7 +481,7 @@ static struct virtTestLogData testLog = {
VIR_BUFFER_INITIALIZER };

 static void
 virtTestLogOutput(const char *category ATTRIBUTE_UNUSED,
-                  int priority ATTRIBUTE_UNUSED,
+                  virLogPriority priority ATTRIBUTE_UNUSED,
                   const char *funcname ATTRIBUTE_UNUSED,
                   long long lineno ATTRIBUTE_UNUSED,
                   const char *timestamp,
@@ -610,7 +610,7 @@ int virtTestMain(int argc,
     virLogSetFromEnv();
     if (!getenv("LIBVIRT_DEBUG") && !virLogGetNbOutputs()) {
         if (virLogDefineOutput(virtTestLogOutput, virtTestLogClose,
&testLog,
-                               0, 0, NULL, 0) < 0)
+                               VIR_LOG_DEBUG, 0, NULL, 0) < 0)
             return 1;
     }

-- 
Eric Blake   eblake@xxxxxxxxxx    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature

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