[libvirt] [PATCH] Fix flaw in detecting log format

Eric Blake eblake at redhat.com
Fri Oct 11 16:33:14 UTC 2013


On 10/11/2013 10:14 AM, Daniel P. Berrange wrote:
> From: "Daniel P. Berrange" <berrange at redhat.com>
> 
> The log message regex has been
> 
> [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}\.[0-9]{3}\+[0-9]{4}: [0-9]+: debug|info|warning|error :
> 

> 
> Which is clearly not what it should have done. This caused the code to
> skip over things which are not log messages. The solution is to simply
> add brackets.
> 
> A test case is also added to validate correctness.
> 
> Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
> ---
>  .gitignore         |  1 +
>  src/util/virlog.c  |  5 +++-
>  tests/Makefile.am  |  5 ++++
>  tests/virlogtest.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 77 insertions(+), 1 deletion(-)
>  create mode 100644 tests/virlogtest.c

ACK.

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 621 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20131011/564d1a2f/attachment-0001.sig>


More information about the libvir-list mailing list