Commit 257e2e60 authored by Pavel Emelyanov's avatar Pavel Emelyanov

files: Move ext files 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 033d9e20
...@@ -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,
&ext_file_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[] = {
&inotify_mark_cinfo, &inotify_mark_cinfo,
&fanotify_cinfo, &fanotify_cinfo,
&fanotify_mark_cinfo, &fanotify_mark_cinfo,
&ext_file_cinfo,
}; };
/* These images are requered to restore namespaces */ /* These images are requered to restore namespaces */
......
...@@ -13,7 +13,7 @@ static int dump_one_ext_file(int lfd, u32 id, const struct fd_parms *p) ...@@ -13,7 +13,7 @@ static int dump_one_ext_file(int lfd, u32 id, const struct fd_parms *p)
{ {
int ret; int ret;
struct cr_img *rimg; struct cr_img *rimg;
FileEntry fe = FILE_ENTRY__INIT;
ExtFileEntry xfe = EXT_FILE_ENTRY__INIT; ExtFileEntry xfe = EXT_FILE_ENTRY__INIT;
ret = run_plugins(DUMP_EXT_FILE, lfd, id); ret = run_plugins(DUMP_EXT_FILE, lfd, id);
...@@ -23,8 +23,12 @@ static int dump_one_ext_file(int lfd, u32 id, const struct fd_parms *p) ...@@ -23,8 +23,12 @@ static int dump_one_ext_file(int lfd, u32 id, const struct fd_parms *p)
xfe.id = id; xfe.id = id;
xfe.fown = (FownEntry *)&p->fown; xfe.fown = (FownEntry *)&p->fown;
rimg = img_from_set(glob_imgset, CR_FD_EXT_FILES); fe.type = FD_TYPES__EXT;
return pb_write_one(rimg, &xfe, PB_EXT_FILE); fe.id = xfe.id;
fe.ext = &xfe;
rimg = img_from_set(glob_imgset, CR_FD_FILES);
return pb_write_one(rimg, &fe, PB_FILE);
} }
const struct fdtype_ops ext_dump_ops = { const struct fdtype_ops ext_dump_ops = {
......
...@@ -1722,6 +1722,9 @@ static int collect_one_file(void *o, ProtobufCMessage *base, struct cr_img *i) ...@@ -1722,6 +1722,9 @@ static int collect_one_file(void *o, ProtobufCMessage *base, struct cr_img *i)
case FD_TYPES__FANOTIFY: case FD_TYPES__FANOTIFY:
ret = collect_one_file_entry(fe, fe->ffy->id, &fe->ffy->base, &fanotify_cinfo); ret = collect_one_file_entry(fe, fe->ffy->id, &fe->ffy->base, &fanotify_cinfo);
break; break;
case FD_TYPES__EXT:
ret = collect_one_file_entry(fe, fe->ext->id, &fe->ext->base, &ext_file_cinfo);
break;
} }
return ret; return ret;
......
...@@ -56,7 +56,6 @@ enum { ...@@ -56,7 +56,6 @@ enum {
_CR_FD_GLOB_FROM, _CR_FD_GLOB_FROM,
CR_FD_FILES, CR_FD_FILES,
CR_FD_SK_QUEUES, CR_FD_SK_QUEUES,
CR_FD_EXT_FILES,
CR_FD_UNIXSK, CR_FD_UNIXSK,
CR_FD_PIPES, CR_FD_PIPES,
CR_FD_PIPES_DATA, CR_FD_PIPES_DATA,
...@@ -106,6 +105,7 @@ enum { ...@@ -106,6 +105,7 @@ enum {
CR_FD_TIMERFD, CR_FD_TIMERFD,
CR_FD_INOTIFY_FILE, CR_FD_INOTIFY_FILE,
CR_FD_FANOTIFY_FILE, CR_FD_FANOTIFY_FILE,
CR_FD_EXT_FILES,
CR_FD_AUTOFS, CR_FD_AUTOFS,
......
...@@ -11,6 +11,7 @@ import "signalfd.proto"; ...@@ -11,6 +11,7 @@ import "signalfd.proto";
import "tun.proto"; import "tun.proto";
import "timerfd.proto"; import "timerfd.proto";
import "fsnotify.proto"; import "fsnotify.proto";
import "ext-file.proto";
enum fd_types { enum fd_types {
UND = 0; UND = 0;
...@@ -55,4 +56,5 @@ message file_entry { ...@@ -55,4 +56,5 @@ message file_entry {
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; optional fanotify_file_entry ffy = 14;
optional ext_file_entry ext = 15;
} }
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