mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 02:14:37 +00:00
There are two problems. The first is CTL_TTY_OFF occupies one of the biggest available fds in the system. It's a number near service_fd_rlim_cur. Next patches want to allocate service fds lower, than service_fd_rlim_cur, and they want to know max used fd from file fles after the image reading. But since one of fds is already set very big (CTL_TTY_OFF) on a stage of collection fles, the only availabe service fds are near service_fd_rlim_cur. It's vicious circle, and the only way is to change ctl tty fd allocation way. The second problem is ctl tty is ugly out of generic file engine fixup (see open_fd()). This is made because ctl tty is the only slave fle, which needs additional actions (see tty_restore_ctl_terminal()). Another file types just receive their slave fle, and do not do anything else. This patch moves ctl tty to generic engine and solves all the above problems. To do that, we implement new CTL_TTY file type, which open method waits till slave tty is received and then calls tty_restore_ctl_terminal() for that. It fits to generic engine well, and allocates fd via find_unused_fd(), and do not polute file table by big fd numbers. Next patch will kill currently unneed CTL_TTY leftovers and will remove CTL_TTY_OFF service fd from criu. Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>
72 lines
1.6 KiB
Protocol Buffer
72 lines
1.6 KiB
Protocol Buffer
syntax = "proto2";
|
|
|
|
import "regfile.proto";
|
|
import "sk-inet.proto";
|
|
import "ns.proto";
|
|
import "packet-sock.proto";
|
|
import "sk-netlink.proto";
|
|
import "eventfd.proto";
|
|
import "eventpoll.proto";
|
|
import "signalfd.proto";
|
|
import "tun.proto";
|
|
import "timerfd.proto";
|
|
import "fsnotify.proto";
|
|
import "ext-file.proto";
|
|
import "sk-unix.proto";
|
|
import "fifo.proto";
|
|
import "pipe.proto";
|
|
import "tty.proto";
|
|
|
|
enum fd_types {
|
|
UND = 0;
|
|
REG = 1;
|
|
PIPE = 2;
|
|
FIFO = 3;
|
|
INETSK = 4;
|
|
UNIXSK = 5;
|
|
EVENTFD = 6;
|
|
EVENTPOLL = 7;
|
|
INOTIFY = 8;
|
|
SIGNALFD = 9;
|
|
PACKETSK = 10;
|
|
TTY = 11;
|
|
FANOTIFY = 12;
|
|
NETLINKSK = 13;
|
|
NS = 14;
|
|
TUNF = 15;
|
|
EXT = 16;
|
|
TIMERFD = 17;
|
|
|
|
/* Any number above the real used. Not stored to image */
|
|
CTL_TTY = 65534;
|
|
AUTOFS_PIPE = 65535;
|
|
}
|
|
|
|
message fdinfo_entry {
|
|
required uint32 id = 1;
|
|
required uint32 flags = 2;
|
|
required fd_types type = 3;
|
|
required uint32 fd = 4;
|
|
}
|
|
|
|
message file_entry {
|
|
required fd_types type = 1;
|
|
required uint32 id = 2;
|
|
optional reg_file_entry reg = 3;
|
|
optional inet_sk_entry isk = 4;
|
|
optional ns_file_entry nsf = 5;
|
|
optional packet_sock_entry psk = 6;
|
|
optional netlink_sk_entry nlsk = 7;
|
|
optional eventfd_file_entry efd = 8;
|
|
optional eventpoll_file_entry epfd = 9;
|
|
optional signalfd_entry sgfd = 10;
|
|
optional tunfile_entry tunf = 11;
|
|
optional timerfd_entry tfd = 12;
|
|
optional inotify_file_entry ify = 13;
|
|
optional fanotify_file_entry ffy = 14;
|
|
optional ext_file_entry ext = 15;
|
|
optional unix_sk_entry usk = 16;
|
|
optional fifo_entry fifo = 17;
|
|
optional pipe_entry pipe = 18;
|
|
optional tty_file_entry tty = 19;
|
|
}
|