Commit 5579d74c authored by Pavel Emelyanov's avatar Pavel Emelyanov

files: Move tunfile 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 1b614436
......@@ -262,7 +262,6 @@ static struct collect_image_info *cinfos[] = {
&inotify_mark_cinfo,
&fanotify_cinfo,
&fanotify_mark_cinfo,
&tunfile_cinfo,
&ext_file_cinfo,
&timerfd_cinfo,
&file_locks_cinfo,
......@@ -279,6 +278,7 @@ static struct collect_image_info *cinfos_files[] = {
&epoll_cinfo,
&epoll_tfd_cinfo,
&signalfd_cinfo,
&tunfile_cinfo,
};
/* These images are requered to restore namespaces */
......
......@@ -1710,6 +1710,9 @@ static int collect_one_file(void *o, ProtobufCMessage *base, struct cr_img *i)
case FD_TYPES__SIGNALFD:
ret = collect_one_file_entry(fe, fe->sgfd->id, &fe->sgfd->base, &signalfd_cinfo);
break;
case FD_TYPES__TUNF:
ret = collect_one_file_entry(fe, fe->tunf->id, &fe->tunf->base, &tunfile_cinfo);
break;
}
return ret;
......
......@@ -68,7 +68,6 @@ enum {
CR_FD_REMAP_FPATH,
CR_FD_INOTIFY_FILE,
CR_FD_FANOTIFY_FILE,
CR_FD_TUNFILE,
CR_FD_CGROUP,
CR_FD_TIMERFD,
CR_FD_FILE_LOCKS,
......@@ -106,6 +105,7 @@ enum {
CR_FD_EVENTFD_FILE,
CR_FD_EVENTPOLL_FILE,
CR_FD_SIGNALFD,
CR_FD_TUNFILE,
CR_FD_AUTOFS,
......
......@@ -268,6 +268,7 @@ static int dump_tunfile(int lfd, u32 id, const struct fd_parms *p)
{
int ret;
struct cr_img *img;
FileEntry fe = FILE_ENTRY__INIT;
TunfileEntry tfe = TUNFILE_ENTRY__INIT;
struct ifreq ifr;
......@@ -306,8 +307,12 @@ static int dump_tunfile(int lfd, u32 id, const struct fd_parms *p)
return -1;
}
img = img_from_set(glob_imgset, CR_FD_TUNFILE);
return pb_write_one(img, &tfe, PB_TUNFILE);
fe.type = FD_TYPES__TUNF;
fe.id = tfe.id;
fe.tunf = &tfe;
img = img_from_set(glob_imgset, CR_FD_FILES);
return pb_write_one(img, &fe, PB_FILE);
}
const struct fdtype_ops tunfile_dump_ops = {
......
......@@ -8,6 +8,7 @@ import "sk-netlink.proto";
import "eventfd.proto";
import "eventpoll.proto";
import "signalfd.proto";
import "tun.proto";
enum fd_types {
UND = 0;
......@@ -48,4 +49,5 @@ message file_entry {
optional eventfd_file_entry efd = 8;
optional eventpoll_file_entry epfd = 9;
optional signalfd_entry sgfd = 10;
optional tunfile_entry tunf = 11;
}
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