Commit 49d8cd09 authored by Pavel Emelyanov's avatar Pavel Emelyanov

tty: Move tty into files image

This completes merging files images into one.
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent a35d3785
......@@ -283,7 +283,6 @@ static struct collect_image_info *cinfos_files[] = {
/* These images are requered to restore namespaces */
static struct collect_image_info *before_ns_cinfos[] = {
&tty_cinfo,
&tty_info_cinfo, /* Restore devpts content */
&tty_cdata,
};
......@@ -1513,6 +1512,8 @@ static int restore_task_with_children(void *_arg)
if (mount_proc())
goto err;
if (!files_collected() && collect_image(&tty_cinfo))
goto err;
if (collect_images(before_ns_cinfos, ARRAY_SIZE(before_ns_cinfos)))
goto err;
......
......@@ -1734,6 +1734,9 @@ static int collect_one_file(void *o, ProtobufCMessage *base, struct cr_img *i)
case FD_TYPES__PIPE:
ret = collect_one_file_entry(fe, fe->pipe->id, &fe->pipe->base, &pipe_cinfo);
break;
case FD_TYPES__TTY:
ret = collect_one_file_entry(fe, fe->tty->id, &fe->tty->base, &tty_cinfo);
break;
}
return ret;
......
......@@ -58,7 +58,6 @@ enum {
CR_FD_SK_QUEUES,
CR_FD_PIPES_DATA,
CR_FD_FIFO_DATA,
CR_FD_TTY_FILES,
CR_FD_TTY_INFO,
CR_FD_TTY_DATA,
CR_FD_REMAP_FPATH,
......@@ -106,6 +105,7 @@ enum {
CR_FD_UNIXSK,
CR_FD_FIFO,
CR_FD_PIPES,
CR_FD_TTY_FILES,
CR_FD_AUTOFS,
......
......@@ -1919,8 +1919,15 @@ static int dump_one_tty(int lfd, u32 id, const struct fd_parms *p)
if (!tty_test_and_set(e.tty_info_id, tty_bitmap))
ret = dump_tty_info(lfd, e.tty_info_id, p, driver, index);
if (!ret)
ret = pb_write_one(img_from_set(glob_imgset, CR_FD_TTY_FILES), &e, PB_TTY_FILE);
if (!ret) {
FileEntry fe = FILE_ENTRY__INIT;
fe.type = FD_TYPES__TTY;
fe.id = e.id;
fe.tty = &e;
ret = pb_write_one(img_from_set(glob_imgset, CR_FD_FILES), &fe, PB_FILE);
}
return ret;
}
......
......@@ -15,6 +15,7 @@ import "ext-file.proto";
import "sk-unix.proto";
import "fifo.proto";
import "pipe.proto";
import "tty.proto";
enum fd_types {
UND = 0;
......@@ -63,4 +64,5 @@ message file_entry {
optional unix_sk_entry usk = 16;
optional fifo_entry fifo = 17;
optional pipe_entry pipe = 18;
optional tty_file_entry tty = 19;
}
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