]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
Refactor domain events to handle multiple event types
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 18 Mar 2010 14:06:09 +0000 (14:06 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Fri, 26 Mar 2010 13:52:14 +0000 (13:52 +0000)
commit747c53637088c90bbf9533187744b962d20ebbb1
tree07d1459ccf78e1c6e99c10ca94576a5f6c455be2
parentea7dc3378655baaa3f6d5b32cee89a5ad5d81262
Refactor domain events to handle multiple event types

The internal domain events APIs are designed to handle the lifecycle
events. This needs to be refactored to allow arbitrary new event
types to be handled.

 * The signature of virDomainEventDispatchFunc changes to use
   virConnectDomainEventGenericCallback instead of the lifecycle
   event specific virConnectDomainEventCallback
 * Every registered callback gains a unique ID to allow its
   removal based on ID, instead of function pointer
 * Every registered callback gains an 'eventID' to allow callbacks
   for different types of events to be distinguished
 * virDomainEventDispatch is adapted to filter out callbacks
   whose eventID does not match the eventID of the event being
   dispatched
 * virDomainEventDispatch is adapted to filter based on the
   domain name and uuid, if this filter is set for a callback.
 * virDomainEvent type/detail fields are moved into a union to
   allow different data fields for other types of events to be
   added later

* src/conf/domain_event.h, src/conf/domain_event.c: Refactor
  to allow handling of different types of events
* src/lxc/lxc_driver.c, src/qemu/qemu_driver.c,
  src/remote/remote_driver.c, src/test/test_driver.c,
  src/xen/xen_driver.c: Change dispatch function signature
  to use virConnectDomainEventGenericCallback
src/conf/domain_event.c
src/conf/domain_event.h
src/lxc/lxc_driver.c
src/qemu/qemu_driver.c
src/remote/remote_driver.c
src/test/test_driver.c
src/xen/xen_driver.c