<div dir="ltr">Thanks for the review, Cristian.<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jan 21, 2014 at 10:37 PM, Crístian Viana <span dir="ltr">&lt;<a href="mailto:vianac@linux.vnet.ibm.com" target="_blank">vianac@linux.vnet.ibm.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Am <a href="tel:21-01-2014%2005" value="+862101201405" target="_blank">21-01-2014 05</a>:23, schrieb apporc:<div class="im"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
@@ -60,6 +65,8 @@ class FeatureTests(object):<br>
          xml = ISO_STREAM_XML % {&#39;protocol&#39;: protocol}<br>
          conn = None<br>
          try:<br>
+            # Register the error handler to hide libvirt error in stderr<br>
+            libvirt.registerErrorHandler(<u></u>f=libvirt_errorhandler, ctx=None)<br>
              conn = libvirt.open(&#39;qemu:///system&#39;)<br>
              dom = conn.defineXML(xml)<br>
              dom.undefine()<br>
</blockquote></div>
Does that suppress *all* future libvirt error messages? If it does, I don&#39;t think that&#39;s a good idea, it&#39;s very important to see error messages when they happen.<br>
If there&#39;s some way to suppress only those messages you mentioned in this patch&#39;s description, it would be better. I believe you can unregister a handler when you don&#39;t need it anymore.<div class="im"><br></div>
</blockquote><div> In fact the libvirt error messages are always there, when we use try...except, we will get that exception with the error message. The default libvirt error handler just do one thing, that is before we get the exception it prints errors to stderr.</div>
<div>ACK, yes it&#39;s good to unregister the handler when this feature test is done.</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
@@ -222,7 +222,6 @@ class Model(object):<br>
                  sys.exit(1)<br>
<br>
      def _set_capabilities(self):<br>
-        <a href="http://kimchi_log.info" target="_blank">kimchi_log.info</a>(&quot;*** Running feature tests ***&quot;)<br>
          self.qemu_stream = FeatureTests.qemu_supports_<u></u>iso_stream()<br>
          self.qemu_stream_dns = FeatureTests.qemu_iso_stream_<u></u>dns()<br>
<br>
@@ -231,7 +230,6 @@ class Model(object):<br>
              if FeatureTests.libvirt_supports_<u></u>iso_stream(p):<br>
                  self.libvirt_stream_protocols.<u></u>append(p)<br>
<br>
-        <a href="http://kimchi_log.info" target="_blank">kimchi_log.info</a>(&quot;*** Feature tests completed ***&quot;)<br>
      _set_capabilities.priority = 90<br>
<br>
      def get_capabilities(self):<br>
</blockquote></div>
I think those two messages are useful, they&#39;re reporting something that&#39;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).<br>

<br>
</blockquote></div>Sorry, i thought this two messages were just used to wrap the mess of libvirt error.</div><div class="gmail_extra">I will resubmit this patch later.<br><br clear="all"><div><br></div>-- <br><div dir="ltr">
Regards,<div>apporc</div></div>
</div></div>