[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH] util: eventpoll: Survive EBADF on macOS



On Wed, Aug 22, 2018 at 10:41:18AM +0100, Daniel P. Berrangé wrote:
> I don't think we should go through the dispatch code when
> we get EBADF, as the contents of the 'revents' fields are
> undefined after we get an error.
> 
> We should jump straight to the end where we have
> "eventLoop.running = 0;"
> 
> If any FDs were in fact ready, we'll get them on the next iteration of
> the loop anyway.
> 

Alright, but the thread won't hold evenLoop.lock after such jump and
virMutexUnlock may fail with ENOPERM. I suppose that could confuse
valgrind & friends.
What if we change eventLoop.running to 0 under the eventLoop.lock right in
the macOS EBADF handler and then return?

--
Roman


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]