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

Re: [Xen-devel] [PATCH 4/6] libxl: events: Tear down SIGCHLD machinery on ctx destruction



On Thu, 2014-11-27 at 18:27 +0000, Ian Jackson wrote:
> We want to have no fd events registered when we are idle.
> Also, we should put back the default SIGCHLD handler.  So:
> 
>  * In libxl_ctx_free, use libxl_childproc_setmode to set the mode to
>    the default, which is libxl_sigchld_owner_libxl (ie `libxl owns
>    SIGCHLD only when it has active children').
> 
>    But of course there are no active children at libxl teardown so
>    this results in libxl__sigchld_notneeded: the ctx loses its
>    interest in SIGCHLD (unsetting the SIGCHLD handler if we were the
>    last ctx) and deregisters the per-ctx selfpipe fd.
> 
>  * assert that this is the case: ie that we are no longer interested
>    in the selfpipe.
> 
> Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>

Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

> ---
>  tools/libxl/libxl.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/tools/libxl/libxl.c b/tools/libxl/libxl.c
> index 12a1013..785253d 100644
> --- a/tools/libxl/libxl.c
> +++ b/tools/libxl/libxl.c
> @@ -162,11 +162,12 @@ int libxl_ctx_free(libxl_ctx *ctx)
>      while ((eject = LIBXL_LIST_FIRST(&CTX->disk_eject_evgens)))
>          libxl__evdisable_disk_eject(gc, eject);
>  
> +    libxl_childproc_setmode(CTX,0,0);
>      for (i = 0; i < ctx->watch_nslots; i++)
>          assert(!libxl__watch_slot_contents(gc, i));
>      assert(!libxl__ev_fd_isregistered(&ctx->watch_efd));
>      libxl__ev_fd_deregister(gc, &ctx->evtchn_efd);
> -    libxl__ev_fd_deregister(gc, &ctx->sigchld_selfpipe_efd);
> +    assert(!libxl__ev_fd_isregistered(&ctx->sigchld_selfpipe_efd));
>  
>      /* Now there should be no more events requested from the application: */
>  



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.