Commit fdf4b22a authored by Pavel Emelyanov's avatar Pavel Emelyanov

files: Move inotify 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 24771da9
...@@ -258,8 +258,6 @@ static struct collect_image_info *cinfos[] = { ...@@ -258,8 +258,6 @@ static struct collect_image_info *cinfos[] = {
&pipe_cinfo, &pipe_cinfo,
&fifo_cinfo, &fifo_cinfo,
&unix_sk_cinfo, &unix_sk_cinfo,
&inotify_cinfo,
&inotify_mark_cinfo,
&fanotify_cinfo, &fanotify_cinfo,
&fanotify_mark_cinfo, &fanotify_mark_cinfo,
&ext_file_cinfo, &ext_file_cinfo,
...@@ -279,6 +277,8 @@ static struct collect_image_info *cinfos_files[] = { ...@@ -279,6 +277,8 @@ static struct collect_image_info *cinfos_files[] = {
&signalfd_cinfo, &signalfd_cinfo,
&tunfile_cinfo, &tunfile_cinfo,
&timerfd_cinfo, &timerfd_cinfo,
&inotify_cinfo,
&inotify_mark_cinfo,
}; };
/* These images are requered to restore namespaces */ /* These images are requered to restore namespaces */
......
...@@ -1716,6 +1716,9 @@ static int collect_one_file(void *o, ProtobufCMessage *base, struct cr_img *i) ...@@ -1716,6 +1716,9 @@ static int collect_one_file(void *o, ProtobufCMessage *base, struct cr_img *i)
case FD_TYPES__TIMERFD: case FD_TYPES__TIMERFD:
ret = collect_one_file_entry(fe, fe->tfd->id, &fe->tfd->base, &timerfd_cinfo); ret = collect_one_file_entry(fe, fe->tfd->id, &fe->tfd->base, &timerfd_cinfo);
break; break;
case FD_TYPES__INOTIFY:
ret = collect_one_file_entry(fe, fe->ify->id, &fe->ify->base, &inotify_cinfo);
break;
} }
return ret; return ret;
......
...@@ -317,6 +317,7 @@ static int check_one_wd(InotifyWdEntry *we) ...@@ -317,6 +317,7 @@ static int check_one_wd(InotifyWdEntry *we)
static int dump_one_inotify(int lfd, u32 id, const struct fd_parms *p) static int dump_one_inotify(int lfd, u32 id, const struct fd_parms *p)
{ {
FileEntry fe = FILE_ENTRY__INIT;
InotifyFileEntry ie = INOTIFY_FILE_ENTRY__INIT; InotifyFileEntry ie = INOTIFY_FILE_ENTRY__INIT;
int exit_code = -1, i, ret; int exit_code = -1, i, ret;
...@@ -337,8 +338,12 @@ static int dump_one_inotify(int lfd, u32 id, const struct fd_parms *p) ...@@ -337,8 +338,12 @@ static int dump_one_inotify(int lfd, u32 id, const struct fd_parms *p)
if (check_one_wd(ie.wd[i])) if (check_one_wd(ie.wd[i]))
goto free; goto free;
fe.type = FD_TYPES__INOTIFY;
fe.id = ie.id;
fe.ify = &ie;
pr_info("id %#08x flags %#08x\n", ie.id, ie.flags); pr_info("id %#08x flags %#08x\n", ie.id, ie.flags);
if (pb_write_one(img_from_set(glob_imgset, CR_FD_INOTIFY_FILE), &ie, PB_INOTIFY_FILE)) if (pb_write_one(img_from_set(glob_imgset, CR_FD_FILES), &fe, PB_FILE))
goto free; goto free;
exit_code = 0; exit_code = 0;
......
...@@ -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_INOTIFY_FILE,
CR_FD_FANOTIFY_FILE, CR_FD_FANOTIFY_FILE,
CR_FD_CGROUP, CR_FD_CGROUP,
CR_FD_FILE_LOCKS, CR_FD_FILE_LOCKS,
...@@ -106,6 +105,7 @@ enum { ...@@ -106,6 +105,7 @@ enum {
CR_FD_SIGNALFD, CR_FD_SIGNALFD,
CR_FD_TUNFILE, CR_FD_TUNFILE,
CR_FD_TIMERFD, CR_FD_TIMERFD,
CR_FD_INOTIFY_FILE,
CR_FD_AUTOFS, CR_FD_AUTOFS,
......
...@@ -10,6 +10,7 @@ import "eventpoll.proto"; ...@@ -10,6 +10,7 @@ import "eventpoll.proto";
import "signalfd.proto"; import "signalfd.proto";
import "tun.proto"; import "tun.proto";
import "timerfd.proto"; import "timerfd.proto";
import "fsnotify.proto";
enum fd_types { enum fd_types {
UND = 0; UND = 0;
...@@ -52,4 +53,5 @@ message file_entry { ...@@ -52,4 +53,5 @@ message file_entry {
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; optional timerfd_entry tfd = 12;
optional inotify_file_entry ify = 13;
} }
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