diff options
author | Eric Blake <eblake@redhat.com> | 2012-08-31 10:07:19 -0700 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2012-08-31 14:31:13 -0700 |
commit | c7d9d7ee807b3adad2926a355d1568998dbad561 (patch) | |
tree | 2d2e89d0973681c7a20524a352ec466da66afe83 /generator.py | |
parent | 55eb5dac68a890a301c64a50253f15350996c511 (diff) | |
download | libvirt-python-v6-c7d9d7ee807b3adad2926a355d1568998dbad561.tar.gz libvirt-python-v6-c7d9d7ee807b3adad2926a355d1568998dbad561.tar.xz libvirt-python-v6-c7d9d7ee807b3adad2926a355d1568998dbad561.zip |
python: don't mask libvirt errors
A user reported this crash when using python bindings:
File "/home/nox/workspace/NOX/src/NOX/hooks.py", line 134, in trigger
hook.trigger(event)
File "/home/nox/workspace/NOX/src/NOX/hooks.py", line 33, in trigger
self.handlers[event]()
File "/home/nox/workspace/NOX/hooks/volatility.py", line 81, in memory_dump
for block in Memory(self.ctx):
File "/home/see/workspace/NOX/src/NOX/lib/libtools.py", line 179, in next
libvirt.VIR_MEMORY_PHYSICAL)
File "/usr/lib/python2.7/dist-packages/libvirt.py", line 1759, in memoryPeek
ret = libvirtmod.virDomainMemoryPeek(self._o, start, size, flags)
SystemError: error return without exception set
In the python bindings, returning NULL makes python think an
exception was thrown, while returning the None object lets the
wrappers know that a libvirt error exists.
Reported by Nox DaFox, fix suggested by Dan Berrange.
* python/libvirt-override.c (libvirt_virDomainBlockPeek)
(libvirt_virDomainMemoryPeek): Return python's None object, so
wrapper knows to check libvirt error.
Diffstat (limited to 'generator.py')
0 files changed, 0 insertions, 0 deletions