Files
xen/tools/libxl
Ian Jackson e5b94170fd libxl: event system: properly register the SIGCHLD self-pipe
An application which uses libxl_osevent_register_hooks, and doesn't
use libxl_sigchld_owner_mainloop, would never properly experience the
deaths of its (libxl) children.

This is because the SIGCHLD self pipe would be handled using ad-hoc
code in beforepoll_internal and afterpoll_internal.  However, this is
no good if application is using the fd registration system instead; in
that case these functions would not be called and nothing would deal
with readability of the self pipe.

Fix this as follows:

The SIGCHLD self pipe now is now dealt with by a standard libxl__ev_fd
handler, which is registered and deregistered along with the SIGCHLD
handler itself.  The handler function subsumes the ad-hoc response
code removed from beforepoll_internal, and the functionality of
libxl__fork_selfpipe_woken.

This is also tidier as the SIGCHLD self pipe is no longer touched
outside libxl_fork.c other than in ctx initialisation and teardown.

(The ad-hoc arrangements for poller->wakeup_pipe in
beforepoll_internal and afterpoll_internal are OK because the
libxl__poller mechanism exists to wake up threads which are sitting
inside libxl's poll loop, so is not applicable to the application's
event loop.)

Reported-by: Bamvor Jian Zhang <bjzhang@suse.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Cc: Bamvor Jian Zhang <bjzhang@suse.com>
Cc: Ian Campbell <ian.campbell@citrix.com>
Cc: Jim Fehlig <jfehlig@suse.com>
2013-11-21 18:47:24 +00:00
..
2013-10-10 15:48:55 +01:00
2011-04-04 14:54:46 +01:00
2012-10-05 14:34:30 +01:00
2013-11-11 16:10:26 +00:00
2013-04-12 12:21:02 +01:00
2012-05-30 08:57:49 +01:00
2012-08-24 12:38:16 +01:00
2012-08-24 12:38:18 +01:00
2012-07-26 10:35:35 +01:00
2013-10-10 15:48:55 +01:00
2011-10-12 16:21:32 +01:00
2012-09-17 11:17:01 +01:00