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

Re: [Xen-devel] [PATCH 0/2] question on libxl ao [and 1 more messages]



Bamvor Jian Zhang writes ("[PATCH 0/2] question on libxl ao"):
> there are four choices for using ao_how in libvirt.
> (a), ao without callback and set libxl_sigchld_owner_mainloop
> (b), ao without callback and set libxl_sigchld_owner_libxl_always
> (c), ao with callback and set libxl_sigchld_owner_mainloop
> (d), ao with callback and set libxl_sigchld_owner_libxl_always
> 
> i got some trouble when i try (b) and (c).
> i still not decided which one is better choice for implement in
> libvirt. it would be easier if i could try above four choice.

I'm not sure I follow.  I think the right answer for libvirt is
probably aos specifying callback, and libxl_sigchld_owner_mainloop.
I'm assuming that libvirt has something for handling children
already.  But I haven't looked.  If it doesn't then
libxl_sigchld_owner_always would probably be best.

Bamvor Jian Zhang writes ("[PATCH 1/2] expose child fd in order to handle child 
exit in libvirt"):
> libvirt could handle fd and timeout event through
> libxl_osevent_hooks. either of these will not inform the child
> exit if libvirt set the libxl_sigchld_owner_libxl_always.

I don't exactly follow, but I think you have found a bug.

If libvirt specifies libxl_sigchld_owner_libxl_always then libxl will
install a SIGCHLD handler and to the self-pipe trick.  The self-pipe
fd should be registered with the fd event machinery in the normal way.
However, this doesn't actually appear to happen.  Instead the
beforepoll/afterpoll functions handle that fd ad-hoc.  The result is
that, probably, nothing will notice the selfpipe becoming writable.

I will see about writing a patch to fix this.

> add a function for returning the sigchld_selfpipe in order to
> handle the child exit in libvirt.
> meanwhile, there is only one pipe in ctx, it seems that it is
> not worth to add this to libxl_osevent_hooks.

This approach is not right, though.  There is no need to add
additional interfaces to libxl.  The bug just needs to be fixed.

Thanks,
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®.