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

Re: [Xen-devel] [PATCH] xl: track child processes for the benefit of libxl



On Fri, 2012-05-18 at 11:56 +0100, Ian Jackson wrote:
[...]
>   typedef enum {
>       child_console, child_waitdaemon, child_migration,
>       child_max
>   } xlchildnum;
>   extern xlchild children[child_max];
> 
>   pid_t xl_waitpid(enum xlchildnum, ....);
> 
>   xl_waitpid(child_console, ....);
[...]
> Pick one; they all seem plausible to me.

Likewise. Not that keen on the union one but the others are all broadly
similar.

> 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.

> > > -    *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.

Ian.



_______________________________________________
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®.