[Kimchi-devel] [PATCH] Avoid useless libvirt error log produced by featuretests

Crístian Viana vianac at linux.vnet.ibm.com
Tue Jan 21 14:37:15 UTC 2014


Am 21-01-2014 05:23, schrieb apporc:
> @@ -60,6 +65,8 @@ class FeatureTests(object):
>           xml = ISO_STREAM_XML % {'protocol': protocol}
>           conn = None
>           try:
> +            # Register the error handler to hide libvirt error in stderr
> +            libvirt.registerErrorHandler(f=libvirt_errorhandler, ctx=None)
>               conn = libvirt.open('qemu:///system')
>               dom = conn.defineXML(xml)
>               dom.undefine()
Does that suppress *all* future libvirt error messages? If it does, I 
don't think that's a good idea, it's very important to see error 
messages when they happen.
If there's some way to suppress only those messages you mentioned in 
this patch's description, it would be better. I believe you can 
unregister a handler when you don't need it anymore.

> @@ -222,7 +222,6 @@ class Model(object):
>                   sys.exit(1)
>
>       def _set_capabilities(self):
> -        kimchi_log.info("*** Running feature tests ***")
>           self.qemu_stream = FeatureTests.qemu_supports_iso_stream()
>           self.qemu_stream_dns = FeatureTests.qemu_iso_stream_dns()
>
> @@ -231,7 +230,6 @@ class Model(object):
>               if FeatureTests.libvirt_supports_iso_stream(p):
>                   self.libvirt_stream_protocols.append(p)
>
> -        kimchi_log.info("*** Feature tests completed ***")
>       _set_capabilities.priority = 90
>
>       def get_capabilities(self):
I think those two messages are useful, they're reporting something 
that's happening in background. There was once a bug that occurred when 
the feature tests started but never finished, and we could tell that by 
looking at those exact two messages (the second message never showed up, 
in that case).




More information about the Kimchi-devel mailing list