Re: [PATCH 3/6] c/r: [pty 2/2] support for pseudo terminals

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

 



Quoting Oren Laadan (orenl@xxxxxxxxxxx):
> This patch adds support for checkpoint and restart of pseudo terminals
> (PTYs). Since PTYs are shared (pointed to by file, and signal), they
> are managed via objhash.
> 
> PTYs are master/slave pairs; The code arranges for the master to
> always be checkpointed first, followed by the slave. This is important
> since during restart both ends are created when restoring the master.
> 
> In this patch only UNIX98 style PTYs are supported.
> 
> Currently only PTYs that are referenced by open files are handled.
> Thus PTYs checkpoint starts with a file in tty_file_checkpoint(). It
> will first checkpoint the master and slave PTYs via tty_checkpoint(),
> and then complete the saving of the file descriptor. This means that
> in the image file, the order of objects is: master-tty, slave-tty,
> file-desc.
> 
> During restart, to restore the master side, we open the /dev/ptmx
> device and get a file handle. But at this point we don't know the
> designated objref for this file, because the file is due later on in
> the image stream. On the other hand, we can't just fput() the file
> because it will close the PTY too.
> 
> Instead, when we checkpoint the master PTY, we _reserve_ an objref
> for the file (which won't be further used in checkpoint). Then at
> restart, use it to insert the file to objhash.
> 
> TODO:
> 
> * Better sanitize input from checkpoint image on restore
> * Check the locking when saving/restoring tty_struct state
> * Echo position/buffer isn't saved (is it needed ?)
> * Handle multiple devpts mounts (namespaces)
> * Paths of ptmx and slaves are hard coded (/dev/ptmx, /dev/pts/...)
> 
> Changelog[v1]:
>   - Adjust include/asm/checkpoint_hdr.h for s390 architecture
>   - Add NCC to kernel constants header (ckpt_hdr_const)
>   - [Serge Hallyn] fix calculation of canon_datalen
> 
> Signed-off-by: Oren Laadan <orenl@xxxxxxxxxxxxxxx>

First three patches can get

Acked-by: Serge Hallyn <serue@xxxxxxxxxx>
Tested-by: Serge Hallyn <serue@xxxxxxxxxx>


_______________________________________________
Containers mailing list
Containers@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/containers

[Index of Archives]     [Cgroups]     [Netdev]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux