From ab52153ab292772f3501a28b26a50515108a54a7 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Thu, 23 Aug 2012 21:39:41 +0200 Subject: [PATCH] win/vchan: remove outstanding evtchn events on libvchan_wait Windows evtchn driver can double fire on one event (details in xenpci/evtchn_device_interface.c:EvtChn_EvtIoWrite). Less intrusive way of fixing it is just remove all events from queue on libvchan_wait (to prevent queue fill). This won't hurt because we are interested in events only sent after xc_evtchn_unmask call which is one line below. --- vchan/io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vchan/io.c b/vchan/io.c index e735c86a..9709109e 100644 --- a/vchan/io.c +++ b/vchan/io.c @@ -77,7 +77,7 @@ int libvchan_wait(struct libvchan *ctrl) { int ret; - ret = xc_evtchn_pending(ctrl->evfd); + ret = xc_evtchn_pending_with_flush(ctrl->evfd); if (ret!=-1 && xc_evtchn_unmask(ctrl->evfd, ctrl->evport)) return -1; if (ret!=-1 && libvchan_is_eof(ctrl))