Commit bb825d89 authored by Pavel Emelyanov's avatar Pavel Emelyanov

files: Move pipes 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 8c70b99d
...@@ -255,7 +255,6 @@ static int crtools_prepare_shared(void) ...@@ -255,7 +255,6 @@ static int crtools_prepare_shared(void)
*/ */
static struct collect_image_info *cinfos[] = { static struct collect_image_info *cinfos[] = {
&pipe_cinfo,
&file_locks_cinfo, &file_locks_cinfo,
&pipe_data_cinfo, &pipe_data_cinfo,
&fifo_data_cinfo, &fifo_data_cinfo,
...@@ -265,6 +264,7 @@ static struct collect_image_info *cinfos[] = { ...@@ -265,6 +264,7 @@ static struct collect_image_info *cinfos[] = {
static struct collect_image_info *cinfos_files[] = { static struct collect_image_info *cinfos_files[] = {
&unix_sk_cinfo, &unix_sk_cinfo,
&fifo_cinfo, &fifo_cinfo,
&pipe_cinfo,
&nsfile_cinfo, &nsfile_cinfo,
&packet_sk_cinfo, &packet_sk_cinfo,
&netlink_sk_cinfo, &netlink_sk_cinfo,
......
...@@ -1731,6 +1731,9 @@ static int collect_one_file(void *o, ProtobufCMessage *base, struct cr_img *i) ...@@ -1731,6 +1731,9 @@ static int collect_one_file(void *o, ProtobufCMessage *base, struct cr_img *i)
case FD_TYPES__FIFO: case FD_TYPES__FIFO:
ret = collect_one_file_entry(fe, fe->fifo->id, &fe->fifo->base, &fifo_cinfo); ret = collect_one_file_entry(fe, fe->fifo->id, &fe->fifo->base, &fifo_cinfo);
break; break;
case FD_TYPES__PIPE:
ret = collect_one_file_entry(fe, fe->pipe->id, &fe->pipe->base, &pipe_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_PIPES,
CR_FD_PIPES_DATA, CR_FD_PIPES_DATA,
CR_FD_FIFO_DATA, CR_FD_FIFO_DATA,
CR_FD_TTY_FILES, CR_FD_TTY_FILES,
...@@ -106,6 +105,7 @@ enum { ...@@ -106,6 +105,7 @@ enum {
CR_FD_EXT_FILES, CR_FD_EXT_FILES,
CR_FD_UNIXSK, CR_FD_UNIXSK,
CR_FD_FIFO, CR_FD_FIFO,
CR_FD_PIPES,
CR_FD_AUTOFS, CR_FD_AUTOFS,
......
...@@ -487,6 +487,7 @@ static struct pipe_data_dump pd_pipes = { .img_type = CR_FD_PIPES_DATA, }; ...@@ -487,6 +487,7 @@ static struct pipe_data_dump pd_pipes = { .img_type = CR_FD_PIPES_DATA, };
static int dump_one_pipe(int lfd, u32 id, const struct fd_parms *p) static int dump_one_pipe(int lfd, u32 id, const struct fd_parms *p)
{ {
FileEntry fe = FILE_ENTRY__INIT;
PipeEntry pe = PIPE_ENTRY__INIT; PipeEntry pe = PIPE_ENTRY__INIT;
pr_info("Dumping pipe %d with id %#x pipe_id %#x\n", pr_info("Dumping pipe %d with id %#x pipe_id %#x\n",
...@@ -502,7 +503,11 @@ static int dump_one_pipe(int lfd, u32 id, const struct fd_parms *p) ...@@ -502,7 +503,11 @@ static int dump_one_pipe(int lfd, u32 id, const struct fd_parms *p)
pe.flags = p->flags & ~O_DIRECT; pe.flags = p->flags & ~O_DIRECT;
pe.fown = (FownEntry *)&p->fown; pe.fown = (FownEntry *)&p->fown;
if (pb_write_one(img_from_set(glob_imgset, CR_FD_PIPES), &pe, PB_PIPE)) fe.type = FD_TYPES__PIPE;
fe.id = pe.id;
fe.pipe = &pe;
if (pb_write_one(img_from_set(glob_imgset, CR_FD_FILES), &fe, PB_FILE))
return -1; return -1;
return dump_one_pipe_data(&pd_pipes, lfd, p); return dump_one_pipe_data(&pd_pipes, lfd, p);
......
...@@ -14,6 +14,7 @@ import "fsnotify.proto"; ...@@ -14,6 +14,7 @@ import "fsnotify.proto";
import "ext-file.proto"; import "ext-file.proto";
import "sk-unix.proto"; import "sk-unix.proto";
import "fifo.proto"; import "fifo.proto";
import "pipe.proto";
enum fd_types { enum fd_types {
UND = 0; UND = 0;
...@@ -61,4 +62,5 @@ message file_entry { ...@@ -61,4 +62,5 @@ message file_entry {
optional ext_file_entry ext = 15; optional ext_file_entry ext = 15;
optional unix_sk_entry usk = 16; optional unix_sk_entry usk = 16;
optional fifo_entry fifo = 17; optional fifo_entry fifo = 17;
optional pipe_entry pipe = 18;
} }
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