[Libvirt-cim] [PATCH] [RFC] Implement libvirt event callback management
Kaitlin Rupert
kaitlin at linux.vnet.ibm.com
Mon Aug 17 20:05:36 UTC 2009
Hollis Blanchard wrote:
> # HG changeset patch
> # User Hollis Blanchard <hollisb at us.ibm.com>
> # Date 1250181138 25200
> # Node ID 36aa26ca62cabda72e027f075889c7a0973a4e6b
> # Parent c345ed88f03432da53efee161d505bd64c02c32e
> [RFC] Implement libvirt event callback management.
>
> Libvirt requires that users implement their own event monitoring and
> callback-management infrastructure. Actually, two similar lists are needed: one
> for file descriptors to monitor, and one for pending timers.
>
> This patch starts exactly one event-monitoring thread per libvirt-cim instance.
> Multiple provider threads in the same process will share this thread.
>
> Signed-off-by: Hollis Blanchard <hollisb at us.ibm.com>
>
> ---
> This builds but isn't tested, and may very well contain embarrassing list
> manipulation or locking bugs. It really needs a consumer to test, i.e. for
> someone to register a domain event callback.
>
> Comments welcome.
This looks great Hollis. Thanks!
I haven't had a chance to test it, but Richard is working on some code
that will utilize this.
> static int eventAddHandle(int fd, int events, virEventHandleCallback cb,
> + void *opaque, virFreeCallback ff)
> +{
> + struct watch *watch;
> +
> + CU_DEBUG("%s", __func__);
> +
We really should include the function name in our CU_DEBUG() statement.
I have some other ideas as to how to improve CU_DEBUG, so I will
include the function when I work on those enhancements.
--
Kaitlin Rupert
IBM Linux Technology Center
kaitlin at linux.vnet.ibm.com
More information about the Libvirt-cim
mailing list