mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-01-23 10:16:41 +00:00
files: Move unix sk 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
257e2e6023
commit
fd39196d98
5 changed files with 19 additions and 4 deletions
|
|
@ -257,7 +257,6 @@ static int crtools_prepare_shared(void)
|
|||
static struct collect_image_info *cinfos[] = {
|
||||
&pipe_cinfo,
|
||||
&fifo_cinfo,
|
||||
&unix_sk_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,
|
||||
&nsfile_cinfo,
|
||||
&packet_sk_cinfo,
|
||||
&netlink_sk_cinfo,
|
||||
|
|
|
|||
|
|
@ -1725,6 +1725,9 @@ static int collect_one_file(void *o, ProtobufCMessage *base, struct cr_img *i)
|
|||
case FD_TYPES__EXT:
|
||||
ret = collect_one_file_entry(fe, fe->ext->id, &fe->ext->base, &ext_file_cinfo);
|
||||
break;
|
||||
case FD_TYPES__UNIXSK:
|
||||
ret = collect_one_file_entry(fe, fe->usk->id, &fe->usk->base, &unix_sk_cinfo);
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
|
|
|
|||
|
|
@ -56,7 +56,6 @@ enum {
|
|||
_CR_FD_GLOB_FROM,
|
||||
CR_FD_FILES,
|
||||
CR_FD_SK_QUEUES,
|
||||
CR_FD_UNIXSK,
|
||||
CR_FD_PIPES,
|
||||
CR_FD_PIPES_DATA,
|
||||
CR_FD_FIFO,
|
||||
|
|
@ -106,6 +105,7 @@ enum {
|
|||
CR_FD_INOTIFY_FILE,
|
||||
CR_FD_FANOTIFY_FILE,
|
||||
CR_FD_EXT_FILES,
|
||||
CR_FD_UNIXSK,
|
||||
|
||||
CR_FD_AUTOFS,
|
||||
|
||||
|
|
|
|||
|
|
@ -175,8 +175,13 @@ static bool unix_sk_exception_lookup_id(unsigned int ino)
|
|||
static int write_unix_entry(struct unix_sk_desc *sk)
|
||||
{
|
||||
int ret;
|
||||
FileEntry fe = FILE_ENTRY__INIT;
|
||||
|
||||
ret = pb_write_one(img_from_set(glob_imgset, CR_FD_UNIXSK), sk->ue, PB_UNIX_SK);
|
||||
fe.type = FD_TYPES__UNIXSK;
|
||||
fe.id = sk->ue->id;
|
||||
fe.usk = sk->ue;
|
||||
|
||||
ret = pb_write_one(img_from_set(glob_imgset, CR_FD_FILES), &fe, PB_FILE);
|
||||
|
||||
show_one_unix_img("Dumped", sk->ue);
|
||||
|
||||
|
|
@ -739,6 +744,7 @@ int fix_external_unix_sockets(void)
|
|||
pr_debug("Dumping external sockets\n");
|
||||
|
||||
list_for_each_entry(sk, &unix_sockets, list) {
|
||||
FileEntry fe = FILE_ENTRY__INIT;
|
||||
UnixSkEntry e = UNIX_SK_ENTRY__INIT;
|
||||
FownEntry fown = FOWN_ENTRY__INIT;
|
||||
SkOptsEntry skopts = SK_OPTS_ENTRY__INIT;
|
||||
|
|
@ -760,7 +766,11 @@ int fix_external_unix_sockets(void)
|
|||
e.fown = &fown;
|
||||
e.opts = &skopts;
|
||||
|
||||
if (pb_write_one(img_from_set(glob_imgset, CR_FD_UNIXSK), &e, PB_UNIX_SK))
|
||||
fe.type = FD_TYPES__UNIXSK;
|
||||
fe.id = e.id;
|
||||
fe.usk = &e;
|
||||
|
||||
if (pb_write_one(img_from_set(glob_imgset, CR_FD_FILES), &fe, PB_FILE))
|
||||
goto err;
|
||||
|
||||
show_one_unix_img("Dumped extern", &e);
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ import "tun.proto";
|
|||
import "timerfd.proto";
|
||||
import "fsnotify.proto";
|
||||
import "ext-file.proto";
|
||||
import "sk-unix.proto";
|
||||
|
||||
enum fd_types {
|
||||
UND = 0;
|
||||
|
|
@ -57,4 +58,5 @@ message file_entry {
|
|||
optional inotify_file_entry ify = 13;
|
||||
optional fanotify_file_entry ffy = 14;
|
||||
optional ext_file_entry ext = 15;
|
||||
optional unix_sk_entry usk = 16;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue