[libvirt] [PATCH] fix Xen event handling
Daniel P. Berrange
berrange at redhat.com
Wed Mar 11 13:31:38 UTC 2009
On Wed, Mar 11, 2009 at 02:27:39PM +0100, Daniel Veillard wrote:
> 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,
ACK, looks good & reporter confirmed that it works.
> 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)
> --
> Libvir-list mailing list
> Libvir-list at redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
--
|: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
More information about the libvir-list
mailing list