Dear developers,
As we know libvirt.py using libvirtmod.so, eg:
def defineXML(self, xml):
"""Define a domain, but does not start it.
This definition is persistent, until explicitly undefined with
virDomainUndefine(). A previous definition for this domain would be
overriden if it already exists. """
ret = libvirtmod.virDomainDefineXML(self._o, xml)
if ret is None:raise libvirtError('virDomainDefineXML() failed',
conn=self)
__tmp = virDomain(self,_obj=ret)
return __tmp
In my python program
#test.py
import libvirt
conn=libvirt.open("qemu:///system")
xml=...
conn.defineXML(xml) # Because i need this xml to be wrong for feature
testing here
# Error will happen here, and error message is printed to stderr.
The error message is annoying.
I need to know how to hide the error message printing to stderr by
libvirtmod.
After i add sys.stderr = open('xxx', 'w') before invoking
conn.defineXML(xml), the error message is still printed to the terminal.
Which means, i can redirect stderr to anywhere else in my python program,
but it changes back to terminal when control flow go to libvirtmod.
Any ideas?
--
Regards,
apporc