[libvirt] [PATCH] build: fix VIR_DEBUG on mingw
Eric Blake
eblake at redhat.com
Tue May 24 18:37:09 UTC 2011
On 05/24/2011 12:33 PM, Matthias Bolte wrote:
> 2011/5/24 Eric Blake <eblake at redhat.com>:
>> We don't use the gnulib vsnprintf replacement, which means that
>> on mingw, vsnprintf doesn't support %sn.
I meant %zn, not %sn; and I'll also mention %llu which is another one
mingw doesn't natively know.
>>
>> But as it turns out, VIR_GET_VAR_STR was a rather inefficient
>> reimplementation of virVasprintf.
>>
>> * src/util/logging.c (VIR_GET_VAR_STR): Drop.
>> (virLogMessage): Inline a simpler version here.
>> * src/util/virterror.c (VIR_GET_VAR_STR, virRaiseErrorFull):
>> Likewise.
>> Reported by Matthias Bolte.
>> ---
>> src/util/logging.c | 45 ++++++---------------------------------------
>> src/util/virterror.c | 44 +++++---------------------------------------
>> 2 files changed, 11 insertions(+), 78 deletions(-)
>>
>
> ACK.
Thanks; pushed.
>
> This actually fixed a debug output that confused me. Before this patch
> the output claimed
>
> 19:14:15.365: 2140: debug : virEventPollCalculateTimeout:345 : Timeout
> at 0 due in 0 ms
>
> But this 0 0 case is impossible from the logic in the code. After the
> patch it is reporting correctly
>
> 20:15:25.157: 2140: debug : virEventPollCalculateTimeout:345 : Timeout
> at 0 due in -1 ms
Cool. That probably means that mingw treated %llu as %lu and only
parsed 32-bits of a 64-bit stack entity, leaving the %d for the
remaining 32 bits; whereas post-patch you get the right argument mapping.
--
Eric Blake eblake at redhat.com +1-801-349-2682
Libvirt virtualization library http://libvirt.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110524/24cfb853/attachment-0001.sig>
More information about the libvir-list
mailing list