]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
python: events: Fix C->Python handle callback prototype
authorCole Robinson <crobinso@redhat.com>
Thu, 16 Jun 2011 00:02:27 +0000 (20:02 -0400)
committerCole Robinson <crobinso@redhat.com>
Tue, 21 Jun 2011 14:08:48 +0000 (10:08 -0400)
commitf2fb235b1d562a554f188bdbb8c0abca323bddbc
treee9854f6c590aac26d7ca241135df8c64e720a7f9
parentd0e3f3d6a62fa8c235afeda61a3628879eb80886
python: events: Fix C->Python handle callback prototype

If registering our own event loop implementation written in python,
any handles or timeouts callbacks registered by libvirt C code must
be wrapped in a python function. There is some argument trickery that
makes this all work, by wrapping the user passed opaque value in
a tuple, along with the callback function.

Problem is, the current setup requires the user's event loop to know
about this trickery, rather than just treating the opaque value
as truly opaque.

Fix this in a backwards compatible manner, and adjust the example
python event loop to do things the proper way.
examples/domain-events/events-python/event-test.py
python/libvirt-override.py