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.
This commit is contained in:
Marek Marczykowski 2012-08-23 21:39:41 +02:00
parent c0455ac641
commit ab52153ab2

View File

@ -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))