update version to 3.19

Signed-off-by: snoweay <snoweay@163.com>
(cherry picked from commit 9040c722c2132f766383a9dddf630a86b5735d48)
This commit is contained in:
snoweay 2024-04-25 17:49:45 +08:00 committed by openeuler-sync-bot
parent ffde4428e9
commit c819e3f82b
9 changed files with 66 additions and 294 deletions

View File

@ -1,7 +1,7 @@
From 4a49af49be378835b65016d5465eae44107a52e1 Mon Sep 17 00:00:00 2001
From: "fu.lin" <fulin10@huawei.com>
Date: Tue, 13 Apr 2021 10:39:45 +0800
Subject: [PATCH 4/6] criu: dump and restore cpu affinity of each thread
From f700bf90e9339d41132a62c24dde9b1c0fa8a9ee Mon Sep 17 00:00:00 2001
From: snoweay <snoweay@163.com>
Date: Thu, 25 Apr 2024 17:36:32 +0800
Subject: [PATCH] criu: dump and restore cpu affinity of each thread
Criu should dump and restore threads' or processes'
cpu affinity.
@ -38,40 +38,43 @@ Signed-off-by: Sang Yan <sangyan@huawei.com>
create mode 100644 test/zdtm/static/cpu-affinity0.desc
diff --git a/compel/arch/arm/plugins/std/syscalls/syscall.def b/compel/arch/arm/plugins/std/syscalls/syscall.def
index e6508ed..1b877d1 100644
index 7489ee0..9403fc2 100644
--- a/compel/arch/arm/plugins/std/syscalls/syscall.def
+++ b/compel/arch/arm/plugins/std/syscalls/syscall.def
@@ -116,5 +116,6 @@ fsopen 430 430 (char *fsname, unsigned int flags)
@@ -118,6 +118,7 @@ fsopen 430 430 (char *fsname, unsigned int flags)
fsconfig 431 431 (int fd, unsigned int cmd, const char *key, const char *value, int aux)
fsmount 432 432 (int fd, unsigned int flags, unsigned int attr_flags)
clone3 435 435 (struct clone_args *uargs, size_t size)
+sched_setaffinity 122 241 (int fd, size_t cpusetsize, const cpu_set_t *mask)
pidfd_open 434 434 (pid_t pid, unsigned int flags)
openat2 437 437 (int dirfd, char *pathname, struct open_how *how, size_t size)
pidfd_getfd 438 438 (int pidfd, int targetfd, unsigned int flags)
diff --git a/compel/arch/ppc64/plugins/std/syscalls/syscall-ppc64.tbl b/compel/arch/ppc64/plugins/std/syscalls/syscall-ppc64.tbl
index 1bb626b..dd79187 100644
index 4c9b75c..43ecc40 100644
--- a/compel/arch/ppc64/plugins/std/syscalls/syscall-ppc64.tbl
+++ b/compel/arch/ppc64/plugins/std/syscalls/syscall-ppc64.tbl
@@ -112,5 +112,6 @@ __NR_fsopen 430 sys_fsopen (char *fsname, unsigned int flags)
@@ -114,6 +114,7 @@ __NR_fsopen 430 sys_fsopen (char *fsname, unsigned int flags)
__NR_fsconfig 431 sys_fsconfig (int fd, unsigned int cmd, const char *key, const char *value, int aux)
__NR_fsmount 432 sys_fsmount (int fd, unsigned int flags, unsigned int attr_flags)
__NR_clone3 435 sys_clone3 (struct clone_args *uargs, size_t size)
+__NR_sched_setaffinity 222 sys_sched_setaffinity (int fd, size_t cpusetsize, const cpu_set_t *mask)
__NR_pidfd_open 434 sys_pidfd_open (pid_t pid, unsigned int flags)
__NR_openat2 437 sys_openat2 (int dirfd, char *pathname, struct open_how *how, size_t size)
__NR_pidfd_getfd 438 sys_pidfd_getfd (int pidfd, int targetfd, unsigned int flags)
diff --git a/compel/arch/s390/plugins/std/syscalls/syscall-s390.tbl b/compel/arch/s390/plugins/std/syscalls/syscall-s390.tbl
index 7178bf4..282adaf 100644
index af7d550..ef72a2f 100644
--- a/compel/arch/s390/plugins/std/syscalls/syscall-s390.tbl
+++ b/compel/arch/s390/plugins/std/syscalls/syscall-s390.tbl
@@ -112,5 +112,6 @@ __NR_fsopen 430 sys_fsopen (char *fsname, unsigned int flags)
@@ -114,6 +114,7 @@ __NR_fsopen 430 sys_fsopen (char *fsname, unsigned int flags)
__NR_fsconfig 431 sys_fsconfig (int fd, unsigned int cmd, const char *key, const char *value, int aux)
__NR_fsmount 432 sys_fsmount (int fd, unsigned int flags, unsigned int attr_flags)
__NR_clone3 435 sys_clone3 (struct clone_args *uargs, size_t size)
+__NR_sched_setaffinity 239 sys_sched_setaffinity (int fd, size_t cpusetsize, const cpu_set_t *mask)
__NR_pidfd_open 434 sys_pidfd_open (pid_t pid, unsigned int flags)
__NR_openat2 437 sys_openat2 (int dirfd, char *pathname, struct open_how *how, size_t size)
__NR_pidfd_getfd 438 sys_pidfd_getfd (int pidfd, int targetfd, unsigned int flags)
diff --git a/compel/arch/x86/plugins/std/syscalls/syscall_32.tbl b/compel/arch/x86/plugins/std/syscalls/syscall_32.tbl
index 7e456cd..3fe3194 100644
index ab36a5c..6c6522a 100644
--- a/compel/arch/x86/plugins/std/syscalls/syscall_32.tbl
+++ b/compel/arch/x86/plugins/std/syscalls/syscall_32.tbl
@@ -63,6 +63,7 @@ __NR_mincore 218 sys_mincore (void *addr, unsigned long size, unsigned char *
@ -83,7 +86,7 @@ index 7e456cd..3fe3194 100644
__NR_get_thread_area 244 sys_get_thread_area (user_desc_t *info)
__NR_io_setup 245 sys_io_setup (unsigned nr_reqs, aio_context_t *ctx32p)
diff --git a/compel/arch/x86/plugins/std/syscalls/syscall_64.tbl b/compel/arch/x86/plugins/std/syscalls/syscall_64.tbl
index 2dfcc6e..c1d119d 100644
index 57681b7..4746bd2 100644
--- a/compel/arch/x86/plugins/std/syscalls/syscall_64.tbl
+++ b/compel/arch/x86/plugins/std/syscalls/syscall_64.tbl
@@ -73,6 +73,7 @@ __NR_mount 165 sys_mount (char *dev_nmae, char *dir_name, char *type, unsign
@ -95,22 +98,22 @@ index 2dfcc6e..c1d119d 100644
__NR_io_setup 206 sys_io_setup (unsigned nr_events, aio_context_t *ctx)
__NR_io_getevents 208 sys_io_getevents (aio_context_t ctx, long min_nr, long nr, struct io_event *evs, struct timespec *tmo)
diff --git a/criu/config.c b/criu/config.c
index 91fb0b6..71f99c9 100644
index 1322a49..f3f4666 100644
--- a/criu/config.c
+++ b/criu/config.c
@@ -695,6 +695,7 @@ int parse_options(int argc, char **argv, bool *usage_error, bool *has_exec_cmd,
{ "cgroup-yard", required_argument, 0, 1096 },
@@ -698,6 +698,7 @@ int parse_options(int argc, char **argv, bool *usage_error, bool *has_exec_cmd,
{ "pre-dump-mode", required_argument, 0, 1097 },
{ "file-validation", required_argument, 0, 1098 },
BOOL_OPT("skip-file-rwx-check", &opts.skip_file_rwx_check),
+ BOOL_OPT("with-cpu-affinity", &opts.with_cpu_affinity),
{ "lsm-mount-context", required_argument, 0, 1099 },
{ "network-lock", required_argument, 0, 1100 },
{},
BOOL_OPT("mntns-compat-mode", &opts.mntns_compat_mode),
diff --git a/criu/cr-dump.c b/criu/cr-dump.c
index 940f622..f07fe6e 100644
index ee5974a..eb540b0 100644
--- a/criu/cr-dump.c
+++ b/criu/cr-dump.c
@@ -139,6 +139,7 @@ static int dump_sched_info(int pid, ThreadCoreEntry *tc)
@@ -140,6 +140,7 @@ static int dump_sched_info(int pid, ThreadCoreEntry *tc)
{
int ret;
struct sched_param sp;
@ -118,7 +121,7 @@ index 940f622..f07fe6e 100644
BUILD_BUG_ON(SCHED_OTHER != 0); /* default in proto message */
@@ -183,6 +184,18 @@ static int dump_sched_info(int pid, ThreadCoreEntry *tc)
@@ -184,6 +185,18 @@ static int dump_sched_info(int pid, ThreadCoreEntry *tc)
pr_info("\tdumping %d nice for %d\n", ret, pid);
tc->has_sched_nice = true;
tc->sched_nice = ret;
@ -138,10 +141,10 @@ index 940f622..f07fe6e 100644
return 0;
}
diff --git a/criu/cr-restore.c b/criu/cr-restore.c
index 9d2d957..5b645c1 100644
index 2700497..9855a3d 100644
--- a/criu/cr-restore.c
+++ b/criu/cr-restore.c
@@ -118,6 +118,7 @@ static int prepare_restorer_blob(void);
@@ -120,6 +120,7 @@ static int prepare_restorer_blob(void);
static int prepare_rlimits(int pid, struct task_restore_args *, CoreEntry *core);
static int prepare_posix_timers(int pid, struct task_restore_args *ta, CoreEntry *core);
static int prepare_signals(int pid, struct task_restore_args *, CoreEntry *core);
@ -149,7 +152,7 @@ index 9d2d957..5b645c1 100644
/*
* Architectures can overwrite this function to restore registers that are not
@@ -899,6 +900,9 @@ static int restore_one_alive_task(int pid, CoreEntry *core)
@@ -921,6 +922,9 @@ static int restore_one_alive_task(int pid, CoreEntry *core)
if (prepare_signals(pid, ta, core))
return -1;
@ -159,7 +162,7 @@ index 9d2d957..5b645c1 100644
if (prepare_posix_timers(pid, ta, core))
return -1;
@@ -3153,6 +3157,24 @@ out:
@@ -3298,6 +3302,24 @@ out:
return ret;
}
@ -184,7 +187,7 @@ index 9d2d957..5b645c1 100644
extern void __gcov_flush(void) __attribute__((weak));
void __gcov_flush(void)
{
@@ -3603,6 +3625,7 @@ static int sigreturn_restore(pid_t pid, struct task_restore_args *task_args, uns
@@ -3762,6 +3784,7 @@ static int sigreturn_restore(pid_t pid, struct task_restore_args *task_args, uns
RST_MEM_FIXUP_PPTR(task_args->timerfd);
RST_MEM_FIXUP_PPTR(task_args->posix_timers);
RST_MEM_FIXUP_PPTR(task_args->siginfo);
@ -193,33 +196,33 @@ index 9d2d957..5b645c1 100644
RST_MEM_FIXUP_PPTR(task_args->helpers);
RST_MEM_FIXUP_PPTR(task_args->zombies);
diff --git a/criu/crtools.c b/criu/crtools.c
index 6a75cd1..b5a36b9 100644
index 94657f4..a8df89d 100644
--- a/criu/crtools.c
+++ b/criu/crtools.c
@@ -445,6 +445,8 @@ usage:
@@ -509,6 +509,8 @@ usage:
" --file-validation METHOD\n"
" pass the validation method to be used; argument\n"
" can be 'filesize' or 'buildid' (default).\n"
+ " --with-cpu-affinity Allow to restore cpu affinity. Only for hosts with\n"
+ " same cpu quantity.\n"
"\n"
"Check options:\n"
" Without options, \"criu check\" checks availability of absolutely required\n"
" --skip-file-rwx-check\n"
" Skip checking file permissions\n"
" (r/w/x for u/g/o) on restore.\n"
diff --git a/criu/include/cr_options.h b/criu/include/cr_options.h
index a34f8db..3b50e59 100644
index 60cf943..db7484a 100644
--- a/criu/include/cr_options.h
+++ b/criu/include/cr_options.h
@@ -188,6 +188,8 @@ struct cr_options {
@@ -212,6 +212,8 @@ struct cr_options {
/* This stores which method to use for file validation. */
int file_validation_method;
+ /* restore cpu affinity */
+ int with_cpu_affinity;
};
extern struct cr_options opts;
/* Shows the mode criu is running at the moment: dump/pre-dump/restore/... */
enum criu_mode mode;
diff --git a/criu/include/restorer.h b/criu/include/restorer.h
index 934d60c..c2ef8f0 100644
index f398d8d..668aa65 100644
--- a/criu/include/restorer.h
+++ b/criu/include/restorer.h
@@ -1,6 +1,7 @@
@ -230,7 +233,7 @@ index 934d60c..c2ef8f0 100644
#include <signal.h>
#include <limits.h>
#include <sys/resource.h>
@@ -162,6 +163,8 @@ struct task_restore_args {
@@ -170,6 +171,8 @@ struct task_restore_args {
siginfo_t *siginfo;
unsigned int siginfo_n;
@ -240,10 +243,10 @@ index 934d60c..c2ef8f0 100644
unsigned int tcp_socks_n;
diff --git a/criu/pie/restorer.c b/criu/pie/restorer.c
index 4304691..fbc89fe 100644
index 0297165..d8e7d41 100644
--- a/criu/pie/restorer.c
+++ b/criu/pie/restorer.c
@@ -425,6 +425,40 @@ static int restore_signals(siginfo_t *ptr, int nr, bool group)
@@ -477,6 +477,40 @@ static int restore_signals(siginfo_t *ptr, int nr, bool group)
return 0;
}
@ -281,10 +284,10 @@ index 4304691..fbc89fe 100644
+ return 0;
+}
+
static int restore_seccomp_filter(pid_t tid, struct thread_restore_args *args)
static int restore_rseq(struct rst_rseq_param *rseq)
{
unsigned int flags = args->seccomp_force_tsync ? SECCOMP_FILTER_FLAG_TSYNC : 0;
@@ -1856,6 +1890,10 @@ long __export_restore_task(struct task_restore_args *args)
int ret;
@@ -2139,6 +2173,10 @@ __visible long __export_restore_task(struct task_restore_args *args)
if (ret)
goto core_restore_end;
@ -296,7 +299,7 @@ index 4304691..fbc89fe 100644
rst_tcp_socks_all(args);
diff --git a/criu/pstree.c b/criu/pstree.c
index d5080e5..778c884 100644
index 8c44e71..efc52c0 100644
--- a/criu/pstree.c
+++ b/criu/pstree.c
@@ -58,11 +58,13 @@ CoreEntry *core_entry_alloc(int th, int tsk)
@ -326,10 +329,10 @@ index d5080e5..778c884 100644
xfree(core);
core = NULL;
diff --git a/images/core.proto b/images/core.proto
index b713119..39e7f32 100644
index 5b07b5c..e4ca389 100644
--- a/images/core.proto
+++ b/images/core.proto
@@ -83,6 +83,10 @@ message thread_sas_entry {
@@ -90,6 +90,10 @@ message thread_sas_entry {
required uint32 ss_flags = 3;
}
@ -340,19 +343,19 @@ index b713119..39e7f32 100644
message thread_core_entry {
required uint64 futex_rla = 1;
required uint32 futex_rla_len = 2;
@@ -101,6 +105,7 @@ message thread_core_entry {
optional string comm = 13;
@@ -110,6 +114,7 @@ message thread_core_entry {
optional uint64 blk_sigset_extended = 14;
+ required thread_allowedcpus_entry allowed_cpus = 15;
optional rseq_entry rseq_entry = 15;
optional uint32 cg_set = 16;
+ required thread_allowedcpus_entry allowed_cpus = 17;
}
message task_rlimits_entry {
diff --git a/test/zdtm/static/Makefile b/test/zdtm/static/Makefile
index c9e6589..70123cf 100644
index 07d3bc6..c25a46f 100644
--- a/test/zdtm/static/Makefile
+++ b/test/zdtm/static/Makefile
@@ -246,6 +246,7 @@ TST_NOFILE := \
@@ -266,6 +266,7 @@ TST_NOFILE := \
timens_nested \
timens_for_kids \
zombie_leader \
@ -416,5 +419,5 @@ index 0000000..0d0b8ae
@@ -0,0 +1 @@
+{'dopts': '', 'ropts': '--with-cpu-affinity', 'flags': 'reqrst '}
--
2.27.0
2.33.0

View File

@ -1,36 +0,0 @@
From 51533d98ac389711a704266a1a5d7afc9b267f2d Mon Sep 17 00:00:00 2001
From: Andrei Vagin <avagin@gmail.com>
Date: Wed, 27 Apr 2022 06:51:47 +0300
Subject: [PATCH] page-pipe: fix limiting a pipe size
But actually, 5a92f100b88e probably has to be reverted as a whole.
PIPE_MAX_SIZE is the hard limit to avoid PAGE_ALLOC_COSTLY_ORDER
allocations in the kernel. But F_SETPIPE_SZ rounds up a requested pipe
size to a power-of-2 pages. It means that when we request PIPE_MAX_SIZE
that isn't a power-of-2 number, we actually request a pipe size greater
than PIPE_MAX_SIZE.
Fixes: 5a92f100b88e ("page-pipe: Resize up to PIPE_MAX_SIZE")
Signed-off-by: Andrei Vagin <avagin@gmail.com>
Signed-off-by: He Wenliang <hewenliang4@huawei.com>
---
criu/page-pipe.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/criu/page-pipe.c b/criu/page-pipe.c
index 5a7e50bc1..54dc3ccc4 100644
--- a/criu/page-pipe.c
+++ b/criu/page-pipe.c
@@ -56,7 +56,7 @@ static inline int ppb_resize_pipe(struct page_pipe_buf *ppb)
if (new_size > PIPE_MAX_SIZE) {
if (ppb->pipe_size < PIPE_MAX_SIZE)
- ppb->pipe_size = PIPE_MAX_SIZE;
+ new_size = PIPE_MAX_SIZE;
else
return 1;
}
--
2.33.0

View File

@ -1,35 +0,0 @@
From 485a83c110bef1b2700acec0bd63bad4518aa62f Mon Sep 17 00:00:00 2001
From: "fu.lin" <fulin10@huawei.com>
Date: Fri, 17 Sep 2021 17:16:48 +0800
Subject: [PATCH] tty: fix the null pointer of get_tty_driver
v2: split error checking from index variable initialization
v3: use PRIx64 for printing dev_t
Signed-off-by: fu.lin <fulin10@huawei.com>
Signed-off-by: Pavel Tikhomirov <ptikhomirov@virtuozzo.com>
Signed-off-by: He Wenliang <hewenliang4@huawei.com>
---
criu/tty.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/criu/tty.c b/criu/tty.c
index 1598ad956..1462193c5 100644
--- a/criu/tty.c
+++ b/criu/tty.c
@@ -1977,6 +1977,12 @@ static int dump_one_tty(int lfd, u32 id, const struct fd_parms *p)
pr_info("Dumping tty %d with id %#x\n", lfd, id);
driver = get_tty_driver(p->stat.st_rdev, p->stat.st_dev);
+ if (driver == NULL) {
+ pr_err("Unable to find a tty driver (rdev %#" PRIx64 " dev %#" PRIx64 ")\n", p->stat.st_rdev,
+ p->stat.st_dev);
+ return -1;
+ }
+
if (driver->fd_get_index)
index = driver->fd_get_index(lfd, p);
else
--
2.33.0

View File

@ -1,42 +0,0 @@
From 74d1233b596c52ae8dc5da4730e6e3e48152023e Mon Sep 17 00:00:00 2001
From: Rajneesh Bhardwaj <rajneesh.bhardwaj@amd.com>
Date: Tue, 27 Apr 2021 19:08:57 -0400
Subject: [PATCH] criu/files: Don't cache fd ids for device files
Restore operation fails when we perform CR operation of multiple
independent proceses that have device files because criu caches
the ids for the device files with same mnt_ids, inode pair. This
change ensures that even in case of a cached id found for a device, a
unique subid is generated and returned which is used for dumping.
Suggested-by: Andrei Vagin <avagin@gmail.com>
Signed-off-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@amd.com>
Signed-off-by: He Wenliang <hewenliang4@huawei.com>
---
criu/file-ids.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/criu/file-ids.c b/criu/file-ids.c
index 1b9d68888..772bd92cf 100644
--- a/criu/file-ids.c
+++ b/criu/file-ids.c
@@ -77,8 +77,14 @@ int fd_id_generate_special(struct fd_parms *p, u32 *id)
fi = fd_id_cache_lookup(p);
if (fi) {
- *id = fi->id;
- return 0;
+ if (p->stat.st_mode & (S_IFCHR | S_IFBLK)) {
+ /* Don't cache the id for mapped devices */
+ *id = fd_tree.subid++;
+ return 1;
+ } else {
+ *id = fi->id;
+ return 0;
+ }
}
}
--
2.33.0

View File

@ -1,28 +0,0 @@
From efeedf3912df4a9a13d5ac719700ca06a9dad327 Mon Sep 17 00:00:00 2001
From: Andrei Vagin <avagin@gmail.com>
Date: Wed, 27 Apr 2022 07:02:58 +0300
Subject: [PATCH] pre-dump: call vmsplice with SPLICE_F_GIFT
In this case, vmplice attaches pages without coping them.
Signed-off-by: Andrei Vagin <avagin@gmail.com>
---
criu/page-xfer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/criu/page-xfer.c b/criu/page-xfer.c
index 3d29fbf78..2a9f6e2cc 100644
--- a/criu/page-xfer.c
+++ b/criu/page-xfer.c
@@ -822,7 +822,7 @@ int page_xfer_predump_pages(int pid, struct page_xfer *xfer, struct page_pipe *p
bufvec.iov_base = userbuf;
bufvec.iov_len = bytes_read;
- ret = vmsplice(ppb->p[1], &bufvec, 1, SPLICE_F_NONBLOCK);
+ ret = vmsplice(ppb->p[1], &bufvec, 1, SPLICE_F_NONBLOCK | SPLICE_F_GIFT);
if (ret == -1 || ret != bytes_read) {
pr_err("vmsplice: Failed to splice user buffer to pipe %ld\n", ret);
--
2.33.0

Binary file not shown.

BIN
criu-3.19.tar.gz Normal file

Binary file not shown.

View File

@ -1,29 +1,23 @@
Name: criu
Version: 3.16.1
Release: 9
Version: 3.19
Release: 1
Provides: crtools = %{version}-%{release}
Obsoletes: crtools <= 1.0-2
Summary: A tool of Checkpoint/Restore in User-space
License: GPL-2.0-or-later or LGPL-2.1-only
URL: http://criu.org/
Source0: http://github.com/checkpoint-restore/criu/archive/v%{version}/%{name}-%{version}.tar.gz
BuildRequires: systemd libnet-devel asciidoc xmlto perl-interpreter libselinux-devel gcc
BuildRequires: systemd libnet-devel asciidoc xmlto perl-interpreter libselinux-devel gcc make
BuildRequires: protobuf-devel protobuf-c-devel python3-devel libnl3-devel libcap-devel
BuildRequires: python3-pip python3-setuptools python3-wheel python3-protobuf
Recommends: tar
ExclusiveArch: x86_64 %{arm} ppc64le aarch64 s390x
Requires: %{name} = %{version}-%{release}
Provides: %{name}-libs = %{version}-%{release}
Obsoletes: %{name}-libs < %{version}-%{release}
Patch1: 0001-criu-dump-and-restore-cpu-affinity-of-each-thread.patch
Patch2: 0002-mm-add-pin-memory-method-for-criu.patch
Patch3: revert-fix-BUG-at-criu-pstree.c-452.patch
Patch1: 0001-criu-dump-and-restore-cpu-affinity-of-each-thread.patch
Patch1000: 1000-backport-page-pipe-fix-limiting-a-pipe-size.patch
Patch1001: 1001-backport-tty-fix-the-null-pointer-of-get_tty_driver.patch
Patch1002: 1002-backport-criu-files-Don-t-cache-fd-ids-for-device-files.patch
Patch1003: 1003-backport-pre-dump-call-vmsplice-with-SPLICE_F_GIFT.patch
%description
Checkpoint/Restore in Userspace(CRIU),is a software tool for the linux operating system.
Using this tool,it is possible to freeze a running application (or part of it) and
@ -72,6 +66,7 @@ CFLAGS+=`echo %{optflags}` make V=1 WERROR=0 PREFIX=%{_prefix} RUNDIR=/run/criu
%install
make install-criu DESTDIR=%{buildroot} PREFIX=%{_prefix} LIBDIR=%{_libdir}
make install-crit DESTDIR=%{buildroot} PREFIX=%{_prefix} LIBDIR=%{_libdir}
make install-lib DESTDIR=%{buildroot} PREFIX=%{_prefix} LIBDIR=%{_libdir} PYTHON=python3
make install-man DESTDIR=%{buildroot} PREFIX=%{_prefix} LIBDIR=%{_libdir}
@ -91,10 +86,12 @@ chmod 0755 %{buildroot}/run/%{name}/
%exclude %{_libdir}/libcriu.a
%files -n python3-criu
%{python3_sitelib}/{pycriu/*,*egg-info}
%{python3_sitelib}/{pycriu*/*,*egg-info}
%files -n crit
%{_bindir}/crit
%{python3_sitelib}/crit-%{version}.dist-info/
%{python3_sitelib}/crit
%files -n criu-ns
%{_sbindir}/criu-ns
@ -102,9 +99,12 @@ chmod 0755 %{buildroot}/run/%{name}/
%files help
%doc README.md COPYING
%doc %{_mandir}/man8/criu.8*
%doc %{_mandir}/man1/{compel.1*,crit.1*,criu-ns.1*}
%doc %{_mandir}/man1/{compel.1*,crit.1*,criu-ns.1*,criu-amdgpu-plugin.1*}
%changelog
* Thu Apr 25 2024 snoweay <snoweay@163.com> - 3.19-1
- update to version 3.19 from criu.org
* Mon Jun 19 2023 hewenliang <314264452@qq.com> - 3.16.1-9
- revert: fix BUG at criu/pstree.c:452

View File

@ -1,90 +0,0 @@
Subject: [PATCH 1/1] revert: fix BUG at criu/pstree.c:452
Not all the process which is dumped by criu is session leader, the
enhancing verification is annoying, because it causes many problems in
some testcases. Therefore, revert this bugfix.
If the bugfix is resumed, using `setsid` to start process is necessary,
and using `stdbuf -oL` to redirect standard output at the same time.
This bug detail sees #1332.
Revert "pstree: don't change sid/gid-s if current sid/gid is the same"
This reverts commit 90e03b1a1142ca40fb78de9eb04944ab51d06eeb.
Revert "pstree: check for pid collision before switching to new sid/gid"
This reverts commit 7e6a1a7011b404fbf0108b062bda118e9a696b60.
---
criu/pstree.c | 37 ++++++++++---------------------------
1 file changed, 10 insertions(+), 27 deletions(-)
diff --git a/criu/pstree.c b/criu/pstree.c
index d5080e515..bf09c761c 100644
--- a/criu/pstree.c
+++ b/criu/pstree.c
@@ -340,7 +340,6 @@ static int prepare_pstree_for_shell_job(pid_t pid)
pid_t current_gid = getpgid(pid);
struct pstree_item *pi;
- struct pid *tmp;
pid_t old_sid;
pid_t old_gid;
@@ -348,7 +347,6 @@ static int prepare_pstree_for_shell_job(pid_t pid)
if (!opts.shell_job)
return 0;
- /* root_item is a session leader */
if (root_item->sid == vpid(root_item))
return 0;
@@ -370,37 +368,22 @@ static int prepare_pstree_for_shell_job(pid_t pid)
*/
old_sid = root_item->sid;
- if (old_sid != current_sid) {
- pr_info("Migrating process tree (SID %d->%d)\n", old_sid, current_sid);
- tmp = pstree_pid_by_virt(current_sid);
- if (tmp) {
- pr_err("Current sid %d intersects with pid (%d) in images\n", current_sid, tmp->state);
- return -1;
- }
+ pr_info("Migrating process tree (SID %d->%d)\n",
+ old_sid, current_sid);
- for_each_pstree_item(pi) {
- if (pi->sid == old_sid)
- pi->sid = current_sid;
- }
-
- if (lookup_create_item(current_sid) == NULL)
- return -1;
+ for_each_pstree_item(pi) {
+ if (pi->sid == old_sid)
+ pi->sid = current_sid;
}
- /* root_item is a group leader */
- if (root_item->pgid == vpid(root_item))
- return 0;
-
old_gid = root_item->pgid;
- if (old_gid != current_gid) {
- pr_info("Migrating process tree (GID %d->%d)\n", old_gid, current_gid);
-
- tmp = pstree_pid_by_virt(current_gid);
- if (tmp) {
- pr_err("Current gid %d intersects with pid (%d) in images\n", current_gid, tmp->state);
+ if (old_gid != vpid(root_item)) {
+ if (lookup_create_item(current_sid) == NULL)
return -1;
- }
+
+ pr_info("Migrating process tree (GID %d->%d)\n",
+ old_gid, current_gid);
for_each_pstree_item(pi) {
if (pi->pgid == old_gid)
--
2.35.1