[Devel] [PATCH rh7]: ve: Provide interface for current tty inheritance

Cyrill Gorcunov gorcunov at virtuozzo.com
Fri Feb 16 10:27:16 MSK 2018


On Thu, Feb 15, 2018 at 02:18:27PM -0800, Andrey Vagin wrote:
> On Thu, Feb 15, 2018 at 09:54:39PM +0300, Cyrill Gorcunov wrote:
> > When fork() is called the current controlling terminal is inherited
> > by a child process. But in criu we fork all process first and then
> > restore their files, thus if terminal is opened in some children
> > its reference get lost. We refuse to checkpoint such configurations
> > at the moment in criu itself.
> > 
> > So to be able to restore this kind of container we need a way to
> > propagate controlling terminal to children processes, and here
> > is an interface "ve.ctty" entry on toplevel ve cgroup. One have
> > to pass pid of the donor task in first position followed by a series
> > of recipient pids.
> 
> Cyrill, you chose a very weird interface. I think we can add an ioctl to
> set a current terminal for a task. And I think we have a good chance to
> push it into the upstream kernle.

This kind of interface is for several reasons:

1) We should be able to setup ctty for a number of tasks in one
   call, I can easily generate any number of forks with ctty propagated,
   you think calling ioctl for every of it is a good idea?

   Instead we collect all pids in one place and process inside one call.

2) The cgroup interface is chosen to not interfere with any constants from
   vanilla kernel, so that we can easily rebase when needed.

But thinking more I agree that pushing something similar to vanilla might
be a good idea, the vanilla criu needs this ability too. I think maybe
instead of ioctl we could use some netlink interface?

Again, I think passing all pids needed in one call is better than doing
per-task ioctl, no?


More information about the Devel mailing list