summaryrefslogtreecommitdiffstats
path: root/libvirt-override-virConnect.py
Commit message (Collapse)AuthorAgeFilesLines
* Asynchronous event for BlockJob completionAdam Litke2011-07-221-0/+12
| | | | | | | | | | | | | | | | | | | | When an operation started by virDomainBlockPull completes (either with success or with failure), raise an event to indicate the final status. This API allow users to avoid polling on virDomainGetBlockJobInfo if they would prefer to use an event mechanism. * daemon/remote.c: Dispatch events to client * include/libvirt/libvirt.h.in: Define event ID and callback signature * src/conf/domain_event.c, src/conf/domain_event.h, src/libvirt_private.syms: Extend API to handle the new event * src/qemu/qemu_driver.c: Connect to the QEMU monitor event for block_stream completion and emit a libvirt block pull event * src/remote/remote_driver.c: Receive and dispatch events to application * src/remote/remote_protocol.x: Wire protocol definition for the event * src/remote_protocol-structs: structure definitions for protocol verification * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h, src/qemu/qemu_monitor_json.c: Watch for BLOCK_STREAM_COMPLETED event from QEMU monitor
* Revert "Asynchronous event for BlockPull completion"Eric Blake2011-06-241-9/+0
| | | | | | | | | | This reverts commit 12cd77a0c58a80179182f7d09e8e73f9f66b4677. Conflicts: python/libvirt-override-virConnect.py python/libvirt-override.c src/remote/remote_protocol.x
* python: Mark event callback wrappers as privateCole Robinson2011-06-211-58/+44
| | | | | | | | These functions aren't intended to be called directly by users, so mark them as private. While we're at it, remove unneeded exception handling, and break some long lines.
* Asynchronous event for BlockPull completionAdam Litke2011-06-141-0/+12
| | | | | | | | | | | | | | | | | | | | | When an operation started by virDomainBlockPullAll completes (either with success or with failure), raise an event to indicate the final status. This allows an API user to avoid polling on virDomainBlockPullInfo if they would prefer to use the event mechanism. * daemon/remote.c: Dispatch events to client * include/libvirt/libvirt.h.in: Define event ID and callback signature * src/conf/domain_event.c, src/conf/domain_event.h, src/libvirt_private.syms: Extend API to handle the new event * src/qemu/qemu_driver.c: Connect to the QEMU monitor event for block_stream completion and emit a libvirt block pull event * src/remote/remote_driver.c: Receive and dispatch events to application * src/remote/remote_protocol.x: Wire protocol definition for the event * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h, src/qemu/qemu_monitor_json.c: Watch for BLOCK_STREAM_COMPLETED event from QEMU monitor Signed-off-by: Adam Litke <agl@us.ibm.com>
* Fix SEGV on exit after domainEventDeregister()v0.8.4v0.8.3Philipp Hahn2010-07-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When the last callback is removed using domainEventDeregister(), the events dispatcher is deregistered from the C-library, but domainEventsCallbacks is still an empty list. On shutdown __del__() deregisters the dispatacher again, which SEGVs # You need the event-loop implementation from the Python examples; # give the file a name which is importable by Python. ln examples/domain-events/events-python/event-test.py eloop.py python -c 'from eloop import * import sys def dump(*args): print " ".join(map(str, args)) virEventLoopPureStart() c = libvirt.open("xen:///") c.domainEventRegister(dump, None) c.domainEventDeregister(dump) sys.exit(0)' domainEventDeregister() needs to delete domainEventCallbacks so subsequent calls to __del__() and domainEventRegister() choose the right code paths. Setting it to None is not enough, since calling domainEventRegiser() again would trigger an TypeError. Signed-off-by: Philipp Hahn <hahn@univention.de>
* Ensure we return the callback ID in python events bindingDaniel P. Berrange2010-07-121-0/+1
| | | | | | | | | A missing return statement in the python binding meant that the callers could not get the callback ID, and thus not be able to unregister event callbacks * python/libvirt-override-virConnect.py: Add missing return statement
* Add missing parameter in python Disk IO error callbackv0.8.2libvirt-0.8.2-9.el5libvirt-0.8.2-8.el5libvirt-0.8.2-7.el5libvirt-0.8.2-6.el5libvirt-0.8.2-4.el5libvirt-0.8.2-3.el5libvirt-0.8.2-29.el5_9.1libvirt-0.8.2-29.el5libvirt-0.8.2-28.el5libvirt-0.8.2-27.el5libvirt-0.8.2-26.el5libvirt-0.8.2-25.el5libvirt-0.8.2-24.el5libvirt-0.8.2-23.el5libvirt-0.8.2-22.el5libvirt-0.8.2-21.el5libvirt-0.8.2-20.el5libvirt-0.8.2-2.el5libvirt-0.8.2-19.el5libvirt-0.8.2-18.el5libvirt-0.8.2-17.el5libvirt-0.8.2-16.el5libvirt-0.8.2-15.el5_6.5libvirt-0.8.2-15.el5_6.4libvirt-0.8.2-15.el5_6.3libvirt-0.8.2-15.el5_6.1libvirt-0.8.2-15.el5libvirt-0.8.2-14.el5libvirt-0.8.2-13.el5libvirt-0.8.2-12.el5libvirt-0.8.2-11.el5libvirt-0.8.2-10.el5libvirt-0.8.2-1.el5git-init-libvirtRHEL-5.6Daniel P. Berrange2010-06-251-1/+1
| | | | | | | | The IO error callback was forgetting to pass the action parameter, causing a stack trace when IO errors arrive * python/libvirt-override-virConnect.py: Add missing action parameter in IO error callback
* Add support for another explicit IO error eventv0.8.1Daniel P. Berrange2010-04-301-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces a new event type VIR_DOMAIN_EVENT_ID_IO_ERROR_REASON This event is the same as the previous VIR_DOMAIN_ID_IO_ERROR event, but also includes a string describing the cause of the event. Thus there is a new callback definition for this event type typedef void (*virConnectDomainEventIOErrorReasonCallback)(virConnectPtr conn, virDomainPtr dom, const char *srcPath, const char *devAlias, int action, const char *reason, void *opaque); This is currently wired up to the QEMU block IO error events * daemon/remote.c: Dispatch IO error events to client * examples/domain-events/events-c/event-test.c: Watch for IO error events * include/libvirt/libvirt.h.in: Define new IO error event ID and callback signature * src/conf/domain_event.c, src/conf/domain_event.h, src/libvirt_private.syms: Extend API to handle IO error events * src/qemu/qemu_driver.c: Connect to the QEMU monitor event for block IO errors and emit a libvirt IO error event * src/remote/remote_driver.c: Receive and dispatch IO error events to application * src/remote/remote_protocol.x: Wire protocol definition for IO error events * src/qemu/qemu_monitor.c, src/qemu/qemu_monitor.h, src/qemu/qemu_monitor_json.c: Watch for BLOCK_IO_ERROR event from QEMU monitor
* More event callback fixesv0.8.0Daniel P. Berrange2010-04-091-2/+50
| | | | | | | | | | | In a couple of cases typos meant we were firing the wrong type of event. In the python code my previous commit accidentally missed some chunks of the code. * python/libvirt-override-virConnect.py: Add missing python glue accidentally left out of previous commit * src/conf/domain_event.c, src/qemu/qemu_monitor_json.c: Fix typos in event name / method name to invoke
* Fix up python bindings for new event callbacksDaniel P. Berrange2010-04-081-0/+45
| | | | | | | | | | | | | The generator was disabled for the new event callbacks, since they need to be hand written. This patch adds the C and python glue to expose the new APIs in the python binding. The python example program is extended to demonstrate of the code * python/libvirt-override.c: Registration and dispatch of events at the C layer * python/libvirt-override-virConnect.py: Python glue for events * examples/domain-events/events-python/event-test.py: Demo use of new event callbacks
* Re-arrange python generator to make it clear what's auto-generatedDaniel P. Berrange2009-09-211-0/+43
* README: New file describing what each file is used for * livvirt-override.c, libvirt-override.py, libvirt-override-api.xml, libvirt-override-virConnect.py: Manually written code overriding the generator * typewrappers.c, typewrappers.h: Data type wrappers * generator.py: Automatically pre-prend contents of libvirt-override.py to generated libvirt.py. Output into libvirt.py directly instead of libvirtclass.py. Don't generate libvirtclass.txt at all. Write C files into libvirt.c/.h directly * Makefile.am: Remove rule for creating libvirt.py from libvirt-override.py and libvirtclass.py, since generator.py does it directly