libxl: Introduce libxl__ev_child_kill_deregister
authorAnthony PERARD <anthony.perard@citrix.com>
Mon, 18 Nov 2019 17:13:02 +0000 (17:13 +0000)
committerWei Liu <wl@xen.org>
Mon, 18 Nov 2019 22:58:26 +0000 (22:58 +0000)
commit4abbac194f0441153f448c8e125a05a0e8cc38d5
treea61782d55148374696fded2d20d8231da895d0fb
parentb92a286cfb72eacbc988b500f4bb04dbe6bedc0c
libxl: Introduce libxl__ev_child_kill_deregister

Allow to deregister the callback associated with a child death event.

The death isn't immediate will need to be collected later, so the
ev_child machinery register its own callback.

libxl__ev_child_kill_deregister() might be called by an AO operation
that is finishing/cleaning up without a chance for libxl to be
notified of the child death (via SIGCHLD). So it is possible that the
application calls libxl_ctx_free() while there are still child around.
To avoid the application getting unexpected SIGCHLD, the libxl__ao
responsible for killing a child will have to wait until it has been
properly reaped.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Release-acked-by: Juergen Gross <jgross@suse.com>
tools/libxl/libxl_event.c
tools/libxl/libxl_fork.c
tools/libxl/libxl_internal.h