Commit 24771da9 authored by Pavel Emelyanov's avatar Pavel Emelyanov

files: Move timerfd into files image

Reviewed-by: 's avatarKirill Tkhai <ktkhai@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 5579d74c
...@@ -263,7 +263,6 @@ static struct collect_image_info *cinfos[] = { ...@@ -263,7 +263,6 @@ static struct collect_image_info *cinfos[] = {
&fanotify_cinfo, &fanotify_cinfo,
&fanotify_mark_cinfo, &fanotify_mark_cinfo,
&ext_file_cinfo, &ext_file_cinfo,
&timerfd_cinfo,
&file_locks_cinfo, &file_locks_cinfo,
&pipe_data_cinfo, &pipe_data_cinfo,
&fifo_data_cinfo, &fifo_data_cinfo,
...@@ -279,6 +278,7 @@ static struct collect_image_info *cinfos_files[] = { ...@@ -279,6 +278,7 @@ static struct collect_image_info *cinfos_files[] = {
&epoll_tfd_cinfo, &epoll_tfd_cinfo,
&signalfd_cinfo, &signalfd_cinfo,
&tunfile_cinfo, &tunfile_cinfo,
&timerfd_cinfo,
}; };
/* These images are requered to restore namespaces */ /* These images are requered to restore namespaces */
......
...@@ -1713,6 +1713,9 @@ static int collect_one_file(void *o, ProtobufCMessage *base, struct cr_img *i) ...@@ -1713,6 +1713,9 @@ static int collect_one_file(void *o, ProtobufCMessage *base, struct cr_img *i)
case FD_TYPES__TUNF: case FD_TYPES__TUNF:
ret = collect_one_file_entry(fe, fe->tunf->id, &fe->tunf->base, &tunfile_cinfo); ret = collect_one_file_entry(fe, fe->tunf->id, &fe->tunf->base, &tunfile_cinfo);
break; break;
case FD_TYPES__TIMERFD:
ret = collect_one_file_entry(fe, fe->tfd->id, &fe->tfd->base, &timerfd_cinfo);
break;
} }
return ret; return ret;
......
...@@ -69,7 +69,6 @@ enum { ...@@ -69,7 +69,6 @@ enum {
CR_FD_INOTIFY_FILE, CR_FD_INOTIFY_FILE,
CR_FD_FANOTIFY_FILE, CR_FD_FANOTIFY_FILE,
CR_FD_CGROUP, CR_FD_CGROUP,
CR_FD_TIMERFD,
CR_FD_FILE_LOCKS, CR_FD_FILE_LOCKS,
CR_FD_SECCOMP, CR_FD_SECCOMP,
_CR_FD_GLOB_TO, _CR_FD_GLOB_TO,
...@@ -106,6 +105,7 @@ enum { ...@@ -106,6 +105,7 @@ enum {
CR_FD_EVENTPOLL_FILE, CR_FD_EVENTPOLL_FILE,
CR_FD_SIGNALFD, CR_FD_SIGNALFD,
CR_FD_TUNFILE, CR_FD_TUNFILE,
CR_FD_TIMERFD,
CR_FD_AUTOFS, CR_FD_AUTOFS,
......
...@@ -67,6 +67,7 @@ int is_timerfd_link(char *link) ...@@ -67,6 +67,7 @@ int is_timerfd_link(char *link)
static int dump_one_timerfd(int lfd, u32 id, const struct fd_parms *p) static int dump_one_timerfd(int lfd, u32 id, const struct fd_parms *p)
{ {
TimerfdEntry tfe = TIMERFD_ENTRY__INIT; TimerfdEntry tfe = TIMERFD_ENTRY__INIT;
FileEntry fe = FILE_ENTRY__INIT;
if (parse_fdinfo(lfd, FD_TYPES__TIMERFD, &tfe)) if (parse_fdinfo(lfd, FD_TYPES__TIMERFD, &tfe))
return -1; return -1;
...@@ -78,7 +79,11 @@ static int dump_one_timerfd(int lfd, u32 id, const struct fd_parms *p) ...@@ -78,7 +79,11 @@ static int dump_one_timerfd(int lfd, u32 id, const struct fd_parms *p)
tfe.id, tfe.clockid, (unsigned long long)tfe.vsec, (unsigned long long)tfe.vnsec, tfe.id, tfe.clockid, (unsigned long long)tfe.vsec, (unsigned long long)tfe.vnsec,
(unsigned long long)tfe.isec, (unsigned long long)tfe.insec); (unsigned long long)tfe.isec, (unsigned long long)tfe.insec);
return pb_write_one(img_from_set(glob_imgset, CR_FD_TIMERFD), &tfe, PB_TIMERFD); fe.type = FD_TYPES__TIMERFD;
fe.id = tfe.id;
fe.tfd = &tfe;
return pb_write_one(img_from_set(glob_imgset, CR_FD_FILES), &fe, PB_FILE);
} }
const struct fdtype_ops timerfd_dump_ops = { const struct fdtype_ops timerfd_dump_ops = {
......
...@@ -9,6 +9,7 @@ import "eventfd.proto"; ...@@ -9,6 +9,7 @@ import "eventfd.proto";
import "eventpoll.proto"; import "eventpoll.proto";
import "signalfd.proto"; import "signalfd.proto";
import "tun.proto"; import "tun.proto";
import "timerfd.proto";
enum fd_types { enum fd_types {
UND = 0; UND = 0;
...@@ -50,4 +51,5 @@ message file_entry { ...@@ -50,4 +51,5 @@ message file_entry {
optional eventpoll_file_entry epfd = 9; optional eventpoll_file_entry epfd = 9;
optional signalfd_entry sgfd = 10; optional signalfd_entry sgfd = 10;
optional tunfile_entry tunf = 11; optional tunfile_entry tunf = 11;
optional timerfd_entry tfd = 12;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment