[libvirt] [PATCH] build: fix VIR_DEBUG on mingw

Matthias Bolte matthias.bolte at googlemail.com
Tue May 24 18:33:57 UTC 2011


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

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

Matthias




More information about the libvir-list mailing list