Commit 1b614436 authored by Pavel Emelyanov's avatar Pavel Emelyanov

files: Move signalfd 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 fe0b08ef
...@@ -258,7 +258,6 @@ static struct collect_image_info *cinfos[] = { ...@@ -258,7 +258,6 @@ static struct collect_image_info *cinfos[] = {
&pipe_cinfo, &pipe_cinfo,
&fifo_cinfo, &fifo_cinfo,
&unix_sk_cinfo, &unix_sk_cinfo,
&signalfd_cinfo,
&inotify_cinfo, &inotify_cinfo,
&inotify_mark_cinfo, &inotify_mark_cinfo,
&fanotify_cinfo, &fanotify_cinfo,
...@@ -279,6 +278,7 @@ static struct collect_image_info *cinfos_files[] = { ...@@ -279,6 +278,7 @@ static struct collect_image_info *cinfos_files[] = {
&eventfd_cinfo, &eventfd_cinfo,
&epoll_cinfo, &epoll_cinfo,
&epoll_tfd_cinfo, &epoll_tfd_cinfo,
&signalfd_cinfo,
}; };
/* These images are requered to restore namespaces */ /* These images are requered to restore namespaces */
......
...@@ -1707,6 +1707,9 @@ static int collect_one_file(void *o, ProtobufCMessage *base, struct cr_img *i) ...@@ -1707,6 +1707,9 @@ static int collect_one_file(void *o, ProtobufCMessage *base, struct cr_img *i)
case FD_TYPES__EVENTPOLL: case FD_TYPES__EVENTPOLL:
ret = collect_one_file_entry(fe, fe->epfd->id, &fe->epfd->base, &epoll_cinfo); ret = collect_one_file_entry(fe, fe->epfd->id, &fe->epfd->base, &epoll_cinfo);
break; break;
case FD_TYPES__SIGNALFD:
ret = collect_one_file_entry(fe, fe->sgfd->id, &fe->sgfd->base, &signalfd_cinfo);
break;
} }
return ret; return ret;
......
...@@ -66,7 +66,6 @@ enum { ...@@ -66,7 +66,6 @@ enum {
CR_FD_TTY_INFO, CR_FD_TTY_INFO,
CR_FD_TTY_DATA, CR_FD_TTY_DATA,
CR_FD_REMAP_FPATH, CR_FD_REMAP_FPATH,
CR_FD_SIGNALFD,
CR_FD_INOTIFY_FILE, CR_FD_INOTIFY_FILE,
CR_FD_FANOTIFY_FILE, CR_FD_FANOTIFY_FILE,
CR_FD_TUNFILE, CR_FD_TUNFILE,
...@@ -106,6 +105,7 @@ enum { ...@@ -106,6 +105,7 @@ enum {
CR_FD_NETLINK_SK, CR_FD_NETLINK_SK,
CR_FD_EVENTFD_FILE, CR_FD_EVENTFD_FILE,
CR_FD_EVENTPOLL_FILE, CR_FD_EVENTPOLL_FILE,
CR_FD_SIGNALFD,
CR_FD_AUTOFS, CR_FD_AUTOFS,
......
...@@ -27,6 +27,7 @@ int is_signalfd_link(char *link) ...@@ -27,6 +27,7 @@ int is_signalfd_link(char *link)
static int dump_one_signalfd(int lfd, u32 id, const struct fd_parms *p) static int dump_one_signalfd(int lfd, u32 id, const struct fd_parms *p)
{ {
SignalfdEntry sfd = SIGNALFD_ENTRY__INIT; SignalfdEntry sfd = SIGNALFD_ENTRY__INIT;
FileEntry fe = FILE_ENTRY__INIT;
if (parse_fdinfo(lfd, FD_TYPES__SIGNALFD, &sfd)) if (parse_fdinfo(lfd, FD_TYPES__SIGNALFD, &sfd))
return -1; return -1;
...@@ -35,8 +36,11 @@ static int dump_one_signalfd(int lfd, u32 id, const struct fd_parms *p) ...@@ -35,8 +36,11 @@ static int dump_one_signalfd(int lfd, u32 id, const struct fd_parms *p)
sfd.flags = p->flags; sfd.flags = p->flags;
sfd.fown = (FownEntry *)&p->fown; sfd.fown = (FownEntry *)&p->fown;
return pb_write_one(img_from_set(glob_imgset, CR_FD_SIGNALFD), fe.type = FD_TYPES__SIGNALFD;
&sfd, PB_SIGNALFD); fe.id = sfd.id;
fe.sgfd = &sfd;
return pb_write_one(img_from_set(glob_imgset, CR_FD_FILES), &fe, PB_FILE);
} }
const struct fdtype_ops signalfd_dump_ops = { const struct fdtype_ops signalfd_dump_ops = {
......
...@@ -7,6 +7,7 @@ import "packet-sock.proto"; ...@@ -7,6 +7,7 @@ import "packet-sock.proto";
import "sk-netlink.proto"; import "sk-netlink.proto";
import "eventfd.proto"; import "eventfd.proto";
import "eventpoll.proto"; import "eventpoll.proto";
import "signalfd.proto";
enum fd_types { enum fd_types {
UND = 0; UND = 0;
...@@ -46,4 +47,5 @@ message file_entry { ...@@ -46,4 +47,5 @@ message file_entry {
optional netlink_sk_entry nlsk = 7; optional netlink_sk_entry nlsk = 7;
optional eventfd_file_entry efd = 8; optional eventfd_file_entry efd = 8;
optional eventpoll_file_entry epfd = 9; optional eventpoll_file_entry epfd = 9;
optional signalfd_entry sgfd = 10;
} }
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