From: Ian Campbell Subject: Re: [PATCH v2] xl: track child processes for the benefit of libxl Date: Fri, 25 May 2012 10:37:51 +0100 Message-ID: <1337938671.22311.19.camel@zakaz.uk.xensource.com> References: <20406.37918.733921.594303@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20406.37918.733921.594303@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: Roger Pau Monne , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org On Fri, 2012-05-18 at 19:25 +0100, Ian Jackson wrote: > Each time xl forks, it needs to record the pid, so that its exit I was just about to apply this but testing with pygrub gives me: libxl: critical: libxl_fork.c:314:libxl__fork_selfpipe_woken: DISASTER in event loop: reported by libxl_childproc_hooks->reaped_callback (for pid=7023, status=0; error code 1): Success libxl: critical: libxl_event.c:1005:libxl__event_disaster: DISASTER in event loop not handled by libxl application libxl: fatal error, exiting program: DISASTER in event loop not handled by libxl application I think the return codes of xl_reaped_callback are just bogus, according to the comment it should return 0 if it knows the child, ERROR_UNKNOWN_CHILD if not and anything else is a disaster. Incremental fix is: diff -r a5ff801ed897 tools/libxl/xl.c --- a/tools/libxl/xl.c Fri May 25 10:32:06 2012 +0100 +++ b/tools/libxl/xl.c Fri May 25 10:37:37 2012 +0100 @@ -163,10 +163,10 @@ static int xl_reaped_callback(pid_t got, if (ch->pid == got) { ch->reaped = 1; ch->status = status; - return 1; + return 0; } } - return 0; + return ERROR_UNKNOWN_CHILD; } static const libxl_childproc_hooks childproc_hooks = {