mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-08-02 23:03:09 +00:00
files: Move pipes into files image
Reviewed-by: Kirill Tkhai <ktkhai@virtuozzo.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com> Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
parent
8c70b99dc6
commit
bb825d89c8
5 changed files with 13 additions and 3 deletions
|
|
@ -255,7 +255,6 @@ static int crtools_prepare_shared(void)
|
|||
*/
|
||||
|
||||
static struct collect_image_info *cinfos[] = {
|
||||
&pipe_cinfo,
|
||||
&file_locks_cinfo,
|
||||
&pipe_data_cinfo,
|
||||
&fifo_data_cinfo,
|
||||
|
|
@ -265,6 +264,7 @@ static struct collect_image_info *cinfos[] = {
|
|||
static struct collect_image_info *cinfos_files[] = {
|
||||
&unix_sk_cinfo,
|
||||
&fifo_cinfo,
|
||||
&pipe_cinfo,
|
||||
&nsfile_cinfo,
|
||||
&packet_sk_cinfo,
|
||||
&netlink_sk_cinfo,
|
||||
|
|
|
|||
|
|
@ -1731,6 +1731,9 @@ static int collect_one_file(void *o, ProtobufCMessage *base, struct cr_img *i)
|
|||
case FD_TYPES__FIFO:
|
||||
ret = collect_one_file_entry(fe, fe->fifo->id, &fe->fifo->base, &fifo_cinfo);
|
||||
break;
|
||||
case FD_TYPES__PIPE:
|
||||
ret = collect_one_file_entry(fe, fe->pipe->id, &fe->pipe->base, &pipe_cinfo);
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -56,7 +56,6 @@ enum {
|
|||
_CR_FD_GLOB_FROM,
|
||||
CR_FD_FILES,
|
||||
CR_FD_SK_QUEUES,
|
||||
CR_FD_PIPES,
|
||||
CR_FD_PIPES_DATA,
|
||||
CR_FD_FIFO_DATA,
|
||||
CR_FD_TTY_FILES,
|
||||
|
|
@ -106,6 +105,7 @@ enum {
|
|||
CR_FD_EXT_FILES,
|
||||
CR_FD_UNIXSK,
|
||||
CR_FD_FIFO,
|
||||
CR_FD_PIPES,
|
||||
|
||||
CR_FD_AUTOFS,
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
FileEntry fe = FILE_ENTRY__INIT;
|
||||
PipeEntry pe = PIPE_ENTRY__INIT;
|
||||
|
||||
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)
|
|||
pe.flags = p->flags & ~O_DIRECT;
|
||||
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 dump_one_pipe_data(&pd_pipes, lfd, p);
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import "fsnotify.proto";
|
|||
import "ext-file.proto";
|
||||
import "sk-unix.proto";
|
||||
import "fifo.proto";
|
||||
import "pipe.proto";
|
||||
|
||||
enum fd_types {
|
||||
UND = 0;
|
||||
|
|
@ -61,4 +62,5 @@ message file_entry {
|
|||
optional ext_file_entry ext = 15;
|
||||
optional unix_sk_entry usk = 16;
|
||||
optional fifo_entry fifo = 17;
|
||||
optional pipe_entry pipe = 18;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue