[libvirt] [PATCH] fix Xen event handling
Daniel Veillard
veillard at redhat.com
Wed Mar 11 13:27:39 UTC 2009
As was reported on IRC and found by Dan Berrange, sometimes Xen event
handling could start to go wild and block processing of requests in the
daemon.
The fault at least on libvirt side is that we didn't filter out non
read/write event requests when asking for watches in the xenstore. The
provided patch seems to work for the person who reported the original
problem,
Daniel
--
Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/
daniel at veillard.com | Rpmfind RPM search engine http://rpmfind.net/
http://veillard.com/ | virtualization library http://libvirt.org/
-------------- next part --------------
Index: src/xs_internal.c
===================================================================
RCS file: /data/cvs/libxen/src/xs_internal.c,v
retrieving revision 1.88
diff -u -u -r1.88 xs_internal.c
--- src/xs_internal.c 5 Feb 2009 18:14:00 -0000 1.88
+++ src/xs_internal.c 11 Mar 2009 13:23:17 -0000
@@ -1215,7 +1215,7 @@
static void
xenStoreWatchEvent(int watch ATTRIBUTE_UNUSED,
int fd ATTRIBUTE_UNUSED,
- int events ATTRIBUTE_UNUSED,
+ int events,
void *data)
{
char **event;
@@ -1226,8 +1226,12 @@
virConnectPtr conn = data;
xenUnifiedPrivatePtr priv = (xenUnifiedPrivatePtr) conn->privateData;
+
if(!priv) return;
+ /* only set a watch on read and write events */
+ if (events & (VIR_EVENT_HANDLE_ERROR | VIR_EVENT_HANDLE_HANGUP)) return;
+
xenUnifiedLock(priv);
if(!priv->xshandle)
More information about the libvir-list
mailing list