2020-05-08 11:36:57 +00:00
|
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
|
2016-07-01 21:49:54 +02:00
|
|
|
syntax = "proto2";
|
|
|
|
|
2017-06-30 13:57:39 +03:00
|
|
|
import "regfile.proto";
|
2017-06-30 13:57:56 +03:00
|
|
|
import "sk-inet.proto";
|
2017-06-30 13:58:13 +03:00
|
|
|
import "ns.proto";
|
2017-06-30 13:59:37 +03:00
|
|
|
import "packet-sock.proto";
|
2017-06-30 13:59:53 +03:00
|
|
|
import "sk-netlink.proto";
|
2017-06-30 14:00:09 +03:00
|
|
|
import "eventfd.proto";
|
2017-06-30 14:00:26 +03:00
|
|
|
import "eventpoll.proto";
|
2017-06-30 14:00:42 +03:00
|
|
|
import "signalfd.proto";
|
2017-06-30 14:00:58 +03:00
|
|
|
import "tun.proto";
|
2017-06-30 14:01:14 +03:00
|
|
|
import "timerfd.proto";
|
2017-06-30 14:01:30 +03:00
|
|
|
import "fsnotify.proto";
|
2017-06-30 14:02:03 +03:00
|
|
|
import "ext-file.proto";
|
2017-06-30 14:02:20 +03:00
|
|
|
import "sk-unix.proto";
|
2017-06-30 14:02:38 +03:00
|
|
|
import "fifo.proto";
|
2017-06-30 14:02:54 +03:00
|
|
|
import "pipe.proto";
|
2024-06-13 20:00:09 +05:30
|
|
|
import "pidfd.proto";
|
2017-07-19 14:20:48 +03:00
|
|
|
import "tty.proto";
|
2019-12-18 23:32:32 +00:00
|
|
|
import "memfd.proto";
|
2020-07-24 20:24:57 +05:30
|
|
|
import "bpfmap-file.proto";
|
2017-06-30 13:57:39 +03:00
|
|
|
|
2012-07-19 10:18:37 +04:00
|
|
|
enum fd_types {
|
|
|
|
UND = 0;
|
|
|
|
REG = 1;
|
|
|
|
PIPE = 2;
|
|
|
|
FIFO = 3;
|
|
|
|
INETSK = 4;
|
|
|
|
UNIXSK = 5;
|
|
|
|
EVENTFD = 6;
|
|
|
|
EVENTPOLL = 7;
|
|
|
|
INOTIFY = 8;
|
2012-08-02 12:24:27 +04:00
|
|
|
SIGNALFD = 9;
|
2012-08-09 16:17:41 +04:00
|
|
|
PACKETSK = 10;
|
2012-09-12 20:00:54 +04:00
|
|
|
TTY = 11;
|
2013-01-14 20:47:56 +04:00
|
|
|
FANOTIFY = 12;
|
2013-03-25 19:28:47 +04:00
|
|
|
NETLINKSK = 13;
|
2013-05-20 13:30:21 +04:00
|
|
|
NS = 14;
|
2014-10-08 14:35:00 +04:00
|
|
|
TUNF = 15;
|
2013-12-20 16:05:17 +04:00
|
|
|
EXT = 16;
|
2014-06-30 21:58:04 +04:00
|
|
|
TIMERFD = 17;
|
2019-12-18 23:32:32 +00:00
|
|
|
MEMFD = 18;
|
2020-07-24 20:24:57 +05:30
|
|
|
BPFMAP = 19;
|
2024-06-13 20:00:09 +05:30
|
|
|
PIDFD = 20;
|
2017-06-01 14:34:42 +03:00
|
|
|
|
|
|
|
/* Any number above the real used. Not stored to image */
|
files: Move CTL_TTY_OFF fixup to generic file engine
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>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-12-28 16:09:13 +03:00
|
|
|
CTL_TTY = 65534;
|
2017-06-01 14:34:42 +03:00
|
|
|
AUTOFS_PIPE = 65535;
|
2012-07-19 10:18:37 +04:00
|
|
|
}
|
|
|
|
|
2012-07-12 13:06:00 +04:00
|
|
|
message fdinfo_entry {
|
2014-02-01 12:27:00 +04:00
|
|
|
required uint32 id = 1;
|
|
|
|
required uint32 flags = 2;
|
|
|
|
required fd_types type = 3;
|
|
|
|
required uint32 fd = 4;
|
2019-04-29 15:21:59 +02:00
|
|
|
optional string xattr_security_selinux = 5;
|
2012-07-12 13:06:00 +04:00
|
|
|
}
|
2017-06-30 13:57:22 +03:00
|
|
|
|
|
|
|
message file_entry {
|
|
|
|
required fd_types type = 1;
|
|
|
|
required uint32 id = 2;
|
2017-06-30 13:57:39 +03:00
|
|
|
optional reg_file_entry reg = 3;
|
2017-06-30 13:57:56 +03:00
|
|
|
optional inet_sk_entry isk = 4;
|
2017-06-30 13:58:13 +03:00
|
|
|
optional ns_file_entry nsf = 5;
|
2017-06-30 13:59:37 +03:00
|
|
|
optional packet_sock_entry psk = 6;
|
2017-06-30 13:59:53 +03:00
|
|
|
optional netlink_sk_entry nlsk = 7;
|
2017-06-30 14:00:09 +03:00
|
|
|
optional eventfd_file_entry efd = 8;
|
2017-06-30 14:00:26 +03:00
|
|
|
optional eventpoll_file_entry epfd = 9;
|
2017-06-30 14:00:42 +03:00
|
|
|
optional signalfd_entry sgfd = 10;
|
2017-06-30 14:00:58 +03:00
|
|
|
optional tunfile_entry tunf = 11;
|
2017-06-30 14:01:14 +03:00
|
|
|
optional timerfd_entry tfd = 12;
|
2017-06-30 14:01:30 +03:00
|
|
|
optional inotify_file_entry ify = 13;
|
2017-06-30 14:01:47 +03:00
|
|
|
optional fanotify_file_entry ffy = 14;
|
2017-06-30 14:02:03 +03:00
|
|
|
optional ext_file_entry ext = 15;
|
2017-06-30 14:02:20 +03:00
|
|
|
optional unix_sk_entry usk = 16;
|
2017-06-30 14:02:38 +03:00
|
|
|
optional fifo_entry fifo = 17;
|
2017-06-30 14:02:54 +03:00
|
|
|
optional pipe_entry pipe = 18;
|
2017-07-19 14:20:48 +03:00
|
|
|
optional tty_file_entry tty = 19;
|
2019-12-18 23:32:32 +00:00
|
|
|
optional memfd_file_entry memfd = 20;
|
2020-07-24 20:24:57 +05:30
|
|
|
optional bpfmap_file_entry bpf = 21;
|
2024-06-13 20:00:09 +05:30
|
|
|
optional pidfd_entry pidfd = 22;
|
2017-06-30 13:57:22 +03:00
|
|
|
}
|