From: Ian Jackson Subject: Re: [PATCH] xl: track child processes for the benefit of libxl Date: Fri, 18 May 2012 14:31:56 +0100 Message-ID: <20406.20300.380604.665069@mariner.uk.xensource.com> References: <20404.4261.794115.716972@mariner.uk.xensource.com> <1337250836.7781.46.camel@zakaz.uk.xensource.com> <20406.10969.280469.436947@mariner.uk.xensource.com> <1337343945.22316.91.camel@zakaz.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1337343945.22316.91.camel@zakaz.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 Campbell Cc: Roger Pau Monne , "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org Ian Campbell writes ("Re: [PATCH] xl: track child processes for the benefit of libxl"): > On Fri, 2012-05-18 at 11:56 +0100, Ian Jackson wrote: > > pid_t xl_waitpid(enum xlchildnum, ....); > > > Pick one; they all seem plausible to me. > > Likewise. Not that keen on the union one but the others are all broadly > similar. OK. > > My favourite is probably the one where we pass the array index to > > xl_fork and xl_waitpid. > > You mean the one I haven't trimmed above? I think I'd be happy with > that. OK. > > > > - *pid = fork(); > > > > - if (*pid < 0) { > > > > + console_child_report(); > > > > + > > > > + pid_t pid = xl_fork(&child_console); > > > > > > console_child_report doesn't seem to reset child_config.pid and xlfork > > > has an assert(!foo.pid) in it, so how does this work on the second time? > > > > xl_waitpid does it. Perhaps this is worth a comment ? > > Yes, since you rely on BSS zeroing and waitpid (i.e. teardown) to > (re)initialise the state I think a comment would be handy. OK. Ian.