Commit 033d9e20 authored by Pavel Emelyanov's avatar Pavel Emelyanov

files: Move fanotify 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 fdf4b22a
...@@ -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,
&fanotify_cinfo,
&fanotify_mark_cinfo,
&ext_file_cinfo, &ext_file_cinfo,
&file_locks_cinfo, &file_locks_cinfo,
&pipe_data_cinfo, &pipe_data_cinfo,
...@@ -279,6 +277,8 @@ static struct collect_image_info *cinfos_files[] = { ...@@ -279,6 +277,8 @@ static struct collect_image_info *cinfos_files[] = {
&timerfd_cinfo, &timerfd_cinfo,
&inotify_cinfo, &inotify_cinfo,
&inotify_mark_cinfo, &inotify_mark_cinfo,
&fanotify_cinfo,
&fanotify_mark_cinfo,
}; };
/* These images are requered to restore namespaces */ /* These images are requered to restore namespaces */
......
...@@ -1719,6 +1719,9 @@ static int collect_one_file(void *o, ProtobufCMessage *base, struct cr_img *i) ...@@ -1719,6 +1719,9 @@ static int collect_one_file(void *o, ProtobufCMessage *base, struct cr_img *i)
case FD_TYPES__INOTIFY: case FD_TYPES__INOTIFY:
ret = collect_one_file_entry(fe, fe->ify->id, &fe->ify->base, &inotify_cinfo); ret = collect_one_file_entry(fe, fe->ify->id, &fe->ify->base, &inotify_cinfo);
break; break;
case FD_TYPES__FANOTIFY:
ret = collect_one_file_entry(fe, fe->ffy->id, &fe->ffy->base, &fanotify_cinfo);
break;
} }
return ret; return ret;
......
...@@ -422,6 +422,7 @@ static int check_one_mark(FanotifyMarkEntry *fme) ...@@ -422,6 +422,7 @@ static int check_one_mark(FanotifyMarkEntry *fme)
static int dump_one_fanotify(int lfd, u32 id, const struct fd_parms *p) static int dump_one_fanotify(int lfd, u32 id, const struct fd_parms *p)
{ {
FileEntry fle = FILE_ENTRY__INIT;
FanotifyFileEntry fe = FANOTIFY_FILE_ENTRY__INIT; FanotifyFileEntry fe = FANOTIFY_FILE_ENTRY__INIT;
int ret = -1, i; int ret = -1, i;
...@@ -445,7 +446,11 @@ static int dump_one_fanotify(int lfd, u32 id, const struct fd_parms *p) ...@@ -445,7 +446,11 @@ static int dump_one_fanotify(int lfd, u32 id, const struct fd_parms *p)
pr_info("id %#08x flags %#08x\n", fe.id, fe.flags); pr_info("id %#08x flags %#08x\n", fe.id, fe.flags);
ret = pb_write_one(img_from_set(glob_imgset, CR_FD_FANOTIFY_FILE), &fe, PB_FANOTIFY_FILE); fle.type = FD_TYPES__FANOTIFY;
fle.id = fe.id;
fle.ffy = &fe;
ret = pb_write_one(img_from_set(glob_imgset, CR_FD_FILES), &fle, PB_FILE);
free: free:
for (i = 0; i < fe.n_mark; i++) for (i = 0; i < fe.n_mark; i++)
xfree(fe.mark[i]); xfree(fe.mark[i]);
......
...@@ -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_FANOTIFY_FILE,
CR_FD_CGROUP, CR_FD_CGROUP,
CR_FD_FILE_LOCKS, CR_FD_FILE_LOCKS,
CR_FD_SECCOMP, CR_FD_SECCOMP,
...@@ -106,6 +105,7 @@ enum { ...@@ -106,6 +105,7 @@ enum {
CR_FD_TUNFILE, CR_FD_TUNFILE,
CR_FD_TIMERFD, CR_FD_TIMERFD,
CR_FD_INOTIFY_FILE, CR_FD_INOTIFY_FILE,
CR_FD_FANOTIFY_FILE,
CR_FD_AUTOFS, CR_FD_AUTOFS,
......
...@@ -54,4 +54,5 @@ message file_entry { ...@@ -54,4 +54,5 @@ message file_entry {
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; optional inotify_file_entry ify = 13;
optional fanotify_file_entry ffy = 14;
} }
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