Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ztdm: inhfd: handle child hanging #2251

Draft
wants to merge 192 commits into
base: criu-dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
192 commits
Select commit Hold shift + click to select a range
823db1b
Add flog to CRIU
prakritigoyal19 Jun 7, 2020
1444b72
flog: Missing varargs init or cleanup (VARARGS)
adrianreber Sep 28, 2020
cc193dc
Run 'make indent' on 'flog/'
adrianreber Aug 4, 2021
1fa21a0
flog: typo: mmaped -> mmapped
kolyshkin Apr 7, 2022
7eaf7a3
flog: fix some codespell warnings
kolyshkin Mar 31, 2022
aed3f34
limit the field width of 'scanf'
Daz-3ux Mar 15, 2023
d6860d0
sk-inet: Add IP TOS socket option
h0lyalg0rithm Apr 12, 2023
0dd4668
zdtm: Add tests for ip tos restore
h0lyalg0rithm Apr 13, 2023
13eb876
dump: increase fcntl call failure judgment
hdzhoujie Apr 18, 2023
970c4ab
compel: support XSAVE on newer Intel CPUs
adrianreber Apr 24, 2023
1d4c5ed
ci: fix new codespell errors
adrianreber Apr 24, 2023
d98c533
scripts: make newer versions of shellcheck happy
adrianreber Apr 24, 2023
8e0697d
criu-ns: make --pidfile option show pid in caller pidns
Snorch Apr 25, 2023
806ee35
docs: rename amdgpu_plugin.txt to criu-amdgpu-plugin.txt
rst0git May 17, 2023
f57bda4
lib/c: add empty_ns interfaces to libcriu
adrianreber May 11, 2023
f308272
criu-ns: Add --criu-binary argument to run_criu()
warusadura Apr 4, 2023
38db5e1
criu-ns: Add support for older Python version in CI
warusadura Apr 17, 2023
8094df8
criu-ns: Add tests for criu-ns script
warusadura Mar 8, 2023
f0e9358
criu-ns: Install Python pathlib module in CentOS 7
warusadura May 22, 2023
9130fef
criu-ns: Update shebang line to python
warusadura May 22, 2023
358f09c
timers: improve and fix posix timer id sequence checks
KAGA-KOKO May 11, 2023
104a828
action-scripts: Add pre-stream hook
rst0git Apr 2, 2023
4d137b8
cgroup/restore: split prepare_task_cgroup code into two separate func…
valeriyvdovin Feb 9, 2021
af0e413
Fix dumping hugetlb-based memfd on kernels < 4.16.
osctobe May 29, 2023
11288c9
Fix mount(cgroup2) for older kernels.
osctobe May 31, 2023
9e6454f
Restore THP_DISABLE prctl.
osctobe Jun 2, 2023
7ca6856
Log if prctl(SET_THP_DISABLE) doesn't work as expected.
osctobe Jun 2, 2023
d3a33ca
zdtm: thp_disable: Output a single failure message
osctobe May 17, 2023
6006cb6
zdtm: thp_disable: Verify prctl(THP_DISABLE) migration
osctobe Jun 2, 2023
c75c017
zdtm: thp_disable: Verify MADV_NOHUGEPAGE before migration
osctobe Jun 2, 2023
c6ee1ba
Fill FPU init state if it's not provided by kernel.
osctobe Oct 13, 2021
9e2e560
compel/test: Return 0 in case of error in fdspy
ancientmodern Jun 15, 2023
3d4d943
Allow passing --leave_stopped by RPC.
osctobe Sep 16, 2022
161a5ff
Allow passing --display_stats via RPC.
mclapinski Sep 16, 2022
7f7b553
Allow passing --log_to_stderr via RPC.
mclapinski Sep 16, 2022
e55e168
zdtm: Allow overriding /tmp.
osctobe Apr 21, 2023
0bd5abe
zdtm: Add timeouts for test commands.
osctobe Apr 25, 2023
05f2319
zdtm: Allow --keep-going for single test.
osctobe May 22, 2023
e595787
zdtm: Implement test sharding.
osctobe May 29, 2023
9301aba
zdtm: sock_opts00: Improve error messages.
osctobe May 18, 2023
a2c4dd2
Allow skipping iptables/nftables invocation.
osctobe Sep 12, 2022
f018893
test/thp_disable: fix lint
rst0git Jun 18, 2023
e6427c5
sockets: Increase the size of sockets hashmap to 16K.
osctobe Jun 21, 2023
12290f4
pipes: Plug pipe fd leak in "Unable to set a pipe size" error case.
osctobe Jun 21, 2023
f5cd44f
kerndat: Make socket feature probing work on IPv6-only host.
osctobe Jun 21, 2023
1e90fc8
restore: remove unused `secbits` field.
osctobe Jun 22, 2023
aa6b633
build: Remove HAS_MEMFD test
osctobe Jun 20, 2022
2d76e4b
build: Debug system feature tests.
osctobe Jun 20, 2022
722a90c
build: Fix LIBS vs LDFLAGS order.
osctobe Jun 20, 2022
85f53bd
build: Use make-provided AR for building libzdtmtst.
osctobe Apr 21, 2023
eece28d
build: Guard against libbsd's version of `__aligned`.
osctobe Jun 20, 2022
0588c3b
build: libnfnetlink: Remove nla_get_s32().
osctobe Jun 22, 2023
b02d53a
action-scripts: allow shell scripts in rpc mode
rst0git Jun 24, 2023
cde9bcf
docker/podman: test c/r with action-script
rst0git Jun 24, 2023
8ba6efb
rpc: Support gathering external file list after freezing process tree.
osctobe Mar 31, 2022
6cfe7aa
rpc: Support setting images_dir by path.
osctobe Jun 22, 2023
fb8ca64
util: Downgrade ignored errors to warnings.
osctobe Jun 22, 2023
f0d1b89
kerndat: unexport kerndat_nsid()
osctobe Jun 22, 2023
a5939b0
kerndat: Don't fail on NETLINK/nsid support missing.
osctobe Jun 22, 2023
ba11426
util: Make CRIU run_id machine-level unique.
osctobe Dec 9, 2022
4c2b71c
zdtm: Update netns purpose comment in zdtm_ct.
osctobe Jun 19, 2023
3a932e9
readme: refactor asciinema link for video playback
Guleri24 Jul 6, 2023
42a5b64
ci: disable CentOS 7 test in Cirrus CI
rst0git Jun 20, 2023
f8466ca
ci: clean up CentOS 7 related tweaks
rst0git Jun 20, 2023
e9901cd
coredump: drop python 2 support
rst0git Jun 20, 2023
91edb5f
crit: drop python 2 support
rst0git Jun 20, 2023
02bd1bc
crit: add requirements.txt for pip>=20.1
rst0git Jun 18, 2023
c794f39
remove python-future dependency
rst0git Jun 21, 2023
5f4d92f
make: remove checks for python 2 binary
rst0git Jun 21, 2023
cc5742d
test/criu-ns: drop python 2 compatibility
rst0git Jun 22, 2023
a8cfec9
test/others: drop setup_swrk() py2 compatibility
rst0git Jun 22, 2023
460c4d2
lib/py: drop python 2 compatibility
rst0git Jun 22, 2023
75d9d68
zdtm: drop python 2 compatibility
rst0git Jun 22, 2023
b759678
cgroup: Propagate error on cgroup mount failure.
osctobe May 31, 2023
ce33c49
files-reg: Debug "open file on overmounted mount" error.
osctobe Dec 9, 2022
b42e7af
compel: Log the status word with "Task is still running" errors.
osctobe Jun 22, 2023
cf01c32
sk-unix: Log both peer names when failing on an external stream unix …
osctobe Jun 22, 2023
13c08b8
soccr: Log offset when failed to restore socket's queued data.
osctobe May 17, 2023
dc3f4b5
soccr: Log name of socket queue that failed to restore.
osctobe May 17, 2023
4d67f67
log: Remove error logs for ignored or otherwise logged subprocess exits.
osctobe May 22, 2023
fb149f7
mount: Demote fsnotify logs for ignored failures.
osctobe May 22, 2023
cf4b225
irmap: Reduce error log severity to warning.
osctobe Jun 22, 2023
a4bb3f9
kerndat: bind ipv6-socket only if ipv6 is enabled
yevzman Jul 6, 2023
a96aa58
zdtm: replace NR_fstat with NR_statx
znley Jul 7, 2023
935e60d
kerndat: don't leak a socket file descriptor
avagin Jul 7, 2023
2d6f04c
ci: add workflow to ensure self-contained commits
snprajwal Jul 1, 2023
f684719
include: add common header files for loongarch64
znley Jun 12, 2023
52630db
compel: add loongarch64 support
znley Jun 12, 2023
521383d
images: add loongarch64 core image
znley Jun 12, 2023
95fbd7e
criu: add loongarch64 support to parasite and restorer
znley Jun 12, 2023
c941282
zdtm: add loongarch64 support
znley Jun 12, 2023
f70c782
ci: add workflow for loongarch64
znley Jul 11, 2023
9f69484
util: Implement fchown() and fchmod() wrappers.
osctobe Jun 21, 2023
923e66b
sk-unix: Avoid restore_file_perms() EPERM error for no-op changes.
osctobe Jun 21, 2023
5f214bc
files-reg: Avoid EPERM in ghost_apply_metadata() for no-op changes.
osctobe Jun 21, 2023
6e23125
cgroup: Replace restore_perms() with cr_fchperm().
osctobe Jun 21, 2023
00d061b
memfd: Avoid EPERM for no-op chown().
osctobe Jun 21, 2023
e90fbd7
tty: Avoid EPERM for no-op chown().
osctobe Jun 21, 2023
b9f360b
restore: Avoid need for CAP_SETPCAP if not changing uids.
osctobe Jun 21, 2023
53dd6ba
restore: Skip setgroups() when already correct.
osctobe Jun 21, 2023
ff67ad8
restore: Fix capability migration requirements between different kern…
osctobe Jun 21, 2023
6bad5d2
prctl: Migrate prctl(NO_NEW_PRIVS) setting.
osctobe Jun 22, 2023
d490218
prctl: test prctl(NO_NEW_PRIVS) setting
osctobe Jul 19, 2023
988a5f4
restore: Skip dropping BSET capability if irrelevant.
osctobe Jul 25, 2023
cc500d9
sk-inet: Extend 'TCP repair off' failure log.
osctobe May 22, 2023
f2d9672
memfd: dump and restore permissions.
osctobe Jul 27, 2023
88249fe
zdtm/memfd00: test memfd file mode
osctobe Jul 27, 2023
9118601
apparmor: fix incorrect usage of sizeof on char ptr
ancientmodern Aug 2, 2023
1db922f
page-xfer: Pull tcp_cork,nodelay().
osctobe Jul 31, 2023
72494ed
irmap: scan user-provided paths in order
osctobe Aug 1, 2023
242de4e
amdgpu_plugin: remove duplicated log prefix
rst0git Aug 7, 2023
6fc5bc6
scripts/apt: don't hide apt output
avagin Aug 7, 2023
2199220
ci/docker: install all required packages
avagin Aug 7, 2023
e1cda9f
lib/py: add VMA_AREA_MEMFD constant
rst0git Aug 13, 2023
288d6a6
loongarch64: reformat syscall_64.tbl for 8-wide tabs
avagin Aug 21, 2023
2f50da4
dump+restore: Implement membarrier() registration c/r.
osctobe Oct 6, 2022
b5c3ccc
zdtm: membarrier: test migration of membarrier() registration
osctobe Jun 19, 2023
5fedcaa
Put a cap on the size of single preadv in restore operation.
osctobe Aug 9, 2023
649292c
github: auto-remove `changes requested` and `awaiting reply` labels
avagin Aug 20, 2023
942b5fd
loongarch64: fix syscall_64.tbl
avagin Aug 24, 2023
359b257
memfd: don't set fd attributes not needed for vma mapping
osctobe Aug 24, 2023
675c5e4
ci/loongarch64: compile tests before running zdtm.py
avagin Aug 24, 2023
af31e8e
kerndat: Make pagemap check more robust against swapped out pages.
osctobe Aug 24, 2023
38baf73
compel/infect: include the relevant pid in "no-breakpoints restore" d…
osctobe Aug 22, 2023
ba27d27
proc_parse: remove trivial goto from vma_get_mapfile_user()
osctobe Aug 25, 2023
2df6ec5
test/other: add test for action-script
rst0git Mar 23, 2023
92b96a5
proc_parse: Log smaps entry while dumping VMA.
osctobe Aug 24, 2023
a04fac5
kerndat: Make errors from clone3() check more precise.
osctobe Aug 24, 2023
d0f88ff
kerndat: check_pagemap: close(fd) on error path
osctobe Aug 28, 2023
6d0e785
kerndat: check_pagemap: reword retried case explanation
osctobe Aug 28, 2023
e0d13ef
memfd: return original memfd fd for execveat()
osctobe Jul 27, 2023
a652c68
zdtm: test execveat(memfd)
osctobe Jul 27, 2023
959a32d
CONTRIBUTING.md: don't mention ctags
Snorch Aug 29, 2023
75146b0
CONTRIBUTING.md: improve coding-style related sections
Snorch Aug 29, 2023
03541c0
lint: don't fail workflow on indent fail
Snorch Aug 24, 2023
1df618a
vagrant: update to version 2.3.7
rst0git May 20, 2023
82bfb67
vagrant: run tests with fedora 38
rst0git May 20, 2023
4b7287b
dump: use MEMBARRIER_CMD_GET_REGISTRATIONS when available
mclapinski Sep 8, 2023
d752479
zdtm: test MEMBARRIER_CMD_GLOBAL_EXPEDITED migration
mclapinski Sep 13, 2023
f043f53
criu/plugin: Add environment variable to cap size of buffers.
fdavid-amd Apr 25, 2023
4766ffa
compel: Add support for ppc64le scv syscalls
ymanton Aug 31, 2023
4ae1518
lib/pycriu: generate version.py
rst0git Apr 25, 2023
b8b2fe6
crit/setup.py: use __version__ from pycriu
rst0git Apr 25, 2023
150eecc
py/cli: add --version option
rst0git Apr 25, 2023
5e37ccf
ci: stop testing ubuntu overlayfs
avagin Sep 23, 2023
1a6c015
zdtm: If ignoring kernel taint, also ignore taint changes.
osctobe May 29, 2023
f74140c
zdtm: cgroup04: Improve error messages.
osctobe May 30, 2023
66369f9
zdtm: cgroup04: Improve skip check's robustness.
osctobe May 31, 2023
87c42d5
zdtm: Treat ESRCH from kill() as success.
osctobe Apr 21, 2023
a056519
zdtm: socket_udp_shutdown: Make the test fail instead of timing out.
osctobe May 31, 2023
8b5f3af
zdtm: check userns once
avagin Sep 27, 2023
1e4f5fb
Return page size as unsigned long
yota9 Jun 20, 2023
4f0c07f
vma: Add !VVAR condition to vma_entry_can_be_lazy
yota9 Jun 20, 2023
5de9040
criu: change the comment about magic numbers
mclapinski Sep 29, 2023
f832d87
plugins: the UPDATE_VMA_MAP callback returns fd with the full control
avagin Sep 29, 2023
25f685e
amdgpu: don't leak fd on an error path in open_img_file
avagin Sep 29, 2023
01d559d
amdgpu: print an error if the dup syscall fails
avagin Sep 29, 2023
f593257
ci: enable build with amdgpu plugin
rst0git Sep 30, 2023
2ff90f0
amdgpu: fix clang warnings
rst0git Oct 1, 2023
f54cf19
memfd: don't reopen file descriptors for memory mappings
avagin Sep 22, 2023
c20fb83
zdtm/memfd04: check execveat on memfd that has memory mappings
avagin Sep 28, 2023
5bf7652
clang-format: disable column limit constraint
Snorch Aug 30, 2023
e3391ed
pie: Mark __export_*() functions as externally_visible
0x7f454c46 Feb 14, 2022
24e2492
util: allow to run criu under strace
avagin Sep 28, 2023
4e5247a
tun: don't parse buffers that have not been filled with data
avagin Oct 5, 2023
3015aad
apparmor: remove the redundant check
Mar 28, 2023
9e05b65
arch/x86: remove the redundant check
Mar 28, 2023
06a3f13
zdtm/cow00: fix typo
Mar 28, 2023
c03c737
zdtm/thread_different_uid_gid: remove the redundant check
Mar 28, 2023
ab73a84
criu/proc_parse: refactor the eventpoll parser
Mar 28, 2023
811a380
files-reg: don't change the file pos in get_build_id
mclapinski Oct 11, 2023
d9ca0c7
zdtm/lib: add missing signal.h header
mclapinski Oct 11, 2023
42c1c84
zdtm/static: test the offset migration of ELF files
mclapinski Oct 11, 2023
711775f
zdtm: cgroup_ifpriomap: Improve skip check's robustness.
osctobe May 31, 2023
df24fe8
lib: use separate packages for pycriu and crit
rst0git Oct 9, 2023
c474816
Makefile: introduce ARCHCFLAGS for arch specific cflags
marcusfolkesson Oct 20, 2023
d88dcef
comple: correct the syscall number of bind on ARM64
SallyKAN Nov 27, 2023
5e56756
ci: fix rawhide netlink error
adrianreber Nov 29, 2023
4213f16
test: check for btrfs in the current directory
adrianreber Nov 29, 2023
9d3e71a
ci: switch to permissive selinux mode during test
adrianreber Nov 29, 2023
b17a73b
ci: fix codespell errors
avagin Nov 21, 2023
95975e0
docker-test: fix condition for max tries
rst0git Nov 28, 2023
0da1ab2
docker-test: downgrade docker to v24.0.7
rst0git Nov 29, 2023
378da3b
Makefile: Use common warnings settings for loongarch64
iv-m Dec 6, 2023
dc49eb4
tty: skip ioctl(TIOCSLCKTRMIOS) if possible
mihalicyn Dec 8, 2023
1573064
ci: do not use 'tail' for skip-file-rwx-check test
adrianreber Nov 30, 2023
561f845
ci: fix centos-stream 9 ci errors
adrianreber Nov 30, 2023
e7aca13
ci: disable non-root in user namespace test in container
adrianreber Nov 30, 2023
61224f2
gitignore: remove historical left-over files
rst0git Oct 20, 2023
50aa6da
make: fix compilation on alpine
avagin Dec 28, 2023
cda1c5c
irmap: hardcode some more interesting paths
rayrapetyan Jan 7, 2024
974f9cc
ztdm: inhfd: handle child hanging
osctobe Aug 24, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 5 additions & 34 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ task:
ln -sf /usr/include/google/protobuf/descriptor.proto images/google/protobuf/descriptor.proto
dnf config-manager --set-enabled crb # Same as CentOS 8 powertools
dnf -y install epel-release epel-next-release
dnf -y install --allowerasing asciidoc gcc git gnutls-devel libaio-devel libasan libcap-devel libnet-devel libnl3-devel libbsd-devel libselinux-devel make protobuf-c-devel protobuf-devel python-devel python-PyYAML python-future python-protobuf python-junit_xml python3-importlib-metadata python-flake8 xmlto
dnf -y install --allowerasing asciidoc gcc git gnutls-devel libaio-devel libasan libcap-devel libnet-devel libnl3-devel libbsd-devel libselinux-devel make protobuf-c-devel protobuf-devel python-devel python-PyYAML python-protobuf python-junit_xml python3-importlib-metadata python-flake8 xmlto libdrm-devel
# The image has a too old version of nettle which does not work with gnutls.
# Just upgrade to the latest to make the error go away.
dnf -y upgrade nettle nettle-devel
systemctl stop sssd
# Even with selinux in permissive mode the selinux tests will be executed.
# The Cirrus CI user runs as a service from selinux point of view and is
Expand Down Expand Up @@ -108,7 +111,7 @@ task:
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm || :
yum install -y dnf-plugins-core
yum config-manager --set-enabled powertools
yum install -y --allowerasing asciidoc gcc git gnutls-devel libaio-devel libasan libcap-devel libnet-devel libnl3-devel libbsd-devel libselinux-devel make protobuf-c-devel protobuf-devel python3-devel python3-flake8 python3-PyYAML python3-future python3-protobuf python3-importlib-metadata python3-junit_xml xmlto
yum install -y --allowerasing asciidoc gcc git gnutls-devel libaio-devel libasan libcap-devel libnet-devel libnl3-devel libbsd-devel libselinux-devel make protobuf-c-devel protobuf-devel python3-devel python3-flake8 python3-PyYAML python3-protobuf python3-importlib-metadata python3-junit_xml xmlto libdrm-devel
alternatives --set python /usr/bin/python3
systemctl stop sssd
# Even with selinux in permissive mode the selinux tests will be executed
Expand All @@ -120,38 +123,6 @@ task:
build_script: |
make -C scripts/ci local SKIP_CI_PREP=1 CC=gcc CD_TO_TOP=1 ZDTM_OPTS="-x zdtm/static/socket-raw"

task:
name: CentOS 7 based test
environment:
HOME: "/root"
CIRRUS_WORKING_DIR: "/tmp/criu"

compute_engine_instance:
image_project: centos-cloud
image: family/centos-7
platform: linux
cpu: 4
memory: 8G

setup_script: |
# EPEL is needed for python2-future, python2-junit_xml, python-flake8 and libbsd-devel.
# Do not fail if latest epel repository definition is already installed
yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm || :
ln -sf /usr/include/google/protobuf/descriptor.proto images/google/protobuf/descriptor.proto
yum install -y findutils gcc git gnutls-devel iproute iptables libaio-devel libasan libcap-devel libnet-devel libnl3-devel libbsd-devel make procps-ng protobuf-c-devel protobuf-devel protobuf-python python python-flake8 python-ipaddress python2-future python2-junit_xml python-yaml python-six sudo tar which e2fsprogs python2-pip rubygem-asciidoctor libselinux-devel
# Even with selinux in permissive mode the selinux tests will be executed
# The Cirrus CI user runs as a service from selinux point of view and is
# much more restricted than a normal shell (system_u:system_r:unconfined_service_t:s0)
# The test case above (vagrant-fedora-no-vdso) should run selinux tests in enforcing mode
setenforce 0
# Enable user namespaces on CentOS 7
echo 10000 > /proc/sys/user/max_user_namespaces
# Adapt sudoers to our needs
echo 'root ALL=(ALL:ALL) ALL' | EDITOR='tee -a' visudo

build_script: |
make -C scripts/ci local SKIP_CI_PREP=1 CC=gcc CD_TO_TOP=1 ZDTM_IGNORE_TAINT=1 ZDTM_OPTS="-x zdtm/static/socket-raw -x zdtm/static/child_subreaper_existing_child -x zdtm/static/fifo_upon_unix_socket01 -x zdtm/static/overmount_sock -x zdtm/static/tempfs_overmounted"

task:
name: aarch64 build GCC (native)
arm_container:
Expand Down
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: BeforeComma # Unknown to clang-format-4.0
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: false
ColumnLimit: 120
ColumnLimit: 0
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false # Unknown to clang-format-4.0
ConstructorInitializerAllOnOneLineOrOnePerLine: false
Expand Down
2 changes: 1 addition & 1 deletion .codespellrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[codespell]
skip = ./.git,./test/pki
ignore-words-list = creat,fpr,fle,ue,bord,parms,nd,te,testng
ignore-words-list = creat,fpr,fle,ue,bord,parms,nd,te,testng,inh,wronly,renderd,bui,clen
30 changes: 30 additions & 0 deletions .github/workflows/check-commits.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Verify self-contained commits

on: pull_request

# Cancel any preceding run on the pull request
concurrency:
group: commit-test-${{ github.event.pull_request.number }}

jobs:
build:
runs-on: ubuntu-latest
# Check if pull request does not have label "not-selfcontained-ok"
if: "!contains(github.event.pull_request.labels.*.name, 'not-selfcontained-ok')"
steps:
- uses: actions/checkout@v3
with:
# Needed to rebase against the base branch
fetch-depth: 0
# Checkout pull request HEAD commit instead of merge commit
ref: ${{ github.event.pull_request.head.sha }}
- name: Install dependencies
run: sudo apt-get install -y libprotobuf-dev libprotobuf-c-dev protobuf-c-compiler protobuf-compiler python3-protobuf libnl-3-dev libnet-dev libcap-dev
- name: Configure git user details
run: |
git config --global user.email "[email protected]"
git config --global user.name "checkpoint-restore"
- name: Configure base branch without switching current branch
run: git fetch origin ${{ github.base_ref }}:${{ github.base_ref }}
- name: Build each commit
run: git rebase ${{ github.base_ref }} -x "make -C scripts/ci check-commit"
18 changes: 9 additions & 9 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ jobs:
run: make lint

- name: Run make indent
run: >
continue-on-error: true
run: |
if [ -z "${{github.base_ref}}" ]; then
git fetch --deepen=1 &&
if ! make indent OPTS=--diff; then
exit 1
fi
git fetch --deepen=1
make indent
else
git fetch origin ${{github.base_ref}} &&
if ! make indent OPTS=--diff BASE=origin/${{github.base_ref}}; then
exit 1
fi
git fetch origin ${{github.base_ref}}
make indent BASE=origin/${{github.base_ref}}
fi
- name: Raise in-line make indent warnings
run: |
git diff | ./scripts/github-indent-warnings.py
15 changes: 15 additions & 0 deletions .github/workflows/loongarch64-qemu-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: LoongArch64 Qemu Test

on: [push, pull_request]

# Cancel any preceding run on the pull request.
concurrency:
group: loongarch64-qemu-test-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/criu-dev' }}

jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
- run: sudo make -C scripts/ci loongarch64-qemu-test
14 changes: 14 additions & 0 deletions .github/workflows/manage-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Remove labels
on: [issue_comment, pull_request_review_comment]
jobs:
remove-labels-on-comments:
name: Remove labels on comments
if: github.event_name == 'issue_comment'
runs-on: ubuntu-latest
steps:
- uses: mondeja/remove-labels-gh-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
labels: |
changes requested
awaiting reply
7 changes: 0 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ images/google/protobuf/*.h
.gitid
criu/criu
criu/unittest/unittest
crit/crit
criu/arch/*/sys-exec-tbl*.c
# x86 syscalls-table is not generated
!criu/arch/x86/sys-exec-tbl.c
criu/arch/*/syscalls*.S
criu/include/syscall-codes*.h
criu/include/syscall*.h
criu/include/version.h
criu/pie/restorer-blob.h
criu/pie/parasite-blob.h
Expand Down
1 change: 0 additions & 1 deletion .lgtm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ extraction:
- "libbsd-dev"
- "python3-yaml"
- "libnl-route-3-dev"
- "python-future"
- "gnutls-dev"
configure:
command:
Expand Down
52 changes: 43 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,18 @@ This should create the `./criu/criu` executable.

## Edit the source code

If you use ctags, you can generate the ctags file by running

```
make tags
```

When you change the source code, please keep in mind the following code conventions:

* code is written to be read, so the code readability is the most important thing you need to have in mind when preparing patches
* we prefer tabs and indentations to be 8 characters width
* CRIU mostly follows [Linux kernel coding style](https://www.kernel.org/doc/Documentation/process/coding-style.rst), but we are less strict than the kernel community.
* we prefer line length of 80 characters or less, more is allowed if it helps with code readability
* CRIU mostly follows [Linux kernel coding style](https://www.kernel.org/doc/Documentation/process/coding-style.rst), but we are less strict than the kernel community

Other conventions can be learned from the source code itself. In short, make sure your new code
looks similar to what is already there.
Other conventions can be learned from the source code itself. In short, make sure your new code looks similar to what is already there.

## Automatic tools to fix coding-style

Important: These tools are there to advise you, but should not be considered as a "source of truth", as tools also make nasty mistakes from time to time which can completely break code readability.

The following command can be used to automatically run a code linter for Python files (flake8), Shell scripts (shellcheck),
text spelling (codespell), and a number of CRIU-specific checks (usage of print macros and EOL whitespace for C files).
Expand Down Expand Up @@ -90,6 +89,41 @@ to check the last *N* commits for formatting errors, without applying the change
Note that for pull requests, the "Run code linter" workflow runs these checks for all commits. If a clang-format error is detected
we need to review the suggested changes and decide if they should be fixed before merging.

Here are some bad examples of clang-format-ing:

* if clang-format tries to force 120 characters and breaks readability - it is wrong:

```
@@ -58,8 +59,7 @@ static int register_membarriers(void)
}

if (!all_ok) {
- fail("can't register membarrier()s - tried %#x, kernel %#x",
- barriers_registered, barriers_supported);
+ fail("can't register membarrier()s - tried %#x, kernel %#x", barriers_registered, barriers_supported);
return -1;
}
```

* if clang-format breaks your beautiful readability friendly alignment in structures, comments or defines - it is wrong:

```
--- a/test/zdtm/static/membarrier.c
+++ b/test/zdtm/static/membarrier.c
@@ -27,9 +27,10 @@ static const struct {
int register_cmd;
int execute_cmd;
} membarrier_cmds[] = {
- { "", MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED, MEMBARRIER_CMD_PRIVATE_EXPEDITED },
- { "_SYNC_CORE", MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE, MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE },
- { "_RSEQ", MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ, MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ },
+ { "", MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED, MEMBARRIER_CMD_PRIVATE_EXPEDITED },
+ { "_SYNC_CORE", MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE,
+ MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE },
+ { "_RSEQ", MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ, MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ },
};
```

## Test your changes

CRIU comes with an extensive test suite. To check whether your changes introduce any regressions, run
Expand Down
4 changes: 1 addition & 3 deletions Documentation/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ endif

FOOTER := footer.txt
SRC1 += crit.txt
ifeq ($(PYTHON),python3)
SRC1 += criu-ns.txt
endif
SRC1 += compel.txt
SRC1 += amdgpu_plugin.txt
SRC1 += criu-amdgpu-plugin.txt
SRC8 += criu.txt
SRC := $(SRC1) $(SRC8)
XMLS := $(patsubst %.txt,%.xml,$(SRC))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ROCM Support(1)

NAME
----
amdgpu_plugin - A plugin extension to CRIU to support checkpoint/restore in
criu-amdgpu-plugin - A plugin extension to CRIU to support checkpoint/restore in
userspace for AMD GPUs.


Expand All @@ -22,7 +22,7 @@ Though *criu* is a great tool for checkpointing and restoring running
applications, it has certain limitations such as it cannot handle
applications that have device files open. In order to support *ROCm* based
workloads with *criu* we need to augment criu's core functionality with a
plugin based extension mechanism. *amdgpu_plugin* provides the necessary support
plugin based extension mechanism. *criu-amdgpu-plugin* provides the necessary support
to criu to allow Checkpoint / Restore with ROCm.


Expand Down Expand Up @@ -97,6 +97,15 @@ executing criu command.
E.g:
KFD_CAPABILITY_CHECK=1

*KFD_MAX_BUFFER_SIZE*::
On some systems, VRAM sizes may exceed RAM sizes, and so buffers for dumping
and restoring VRAM may be unable to fit. Set to a nonzero value (in bytes)
to set a limit on the plugin's memory usage.
Default:0 (Disabled)

E.g:
KFD_MAX_BUFFER_SIZE="2G"


AUTHOR
------
Expand Down
8 changes: 8 additions & 0 deletions Documentation/criu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ not compatible with *--external* *dev*.
notification message contains a file descriptor for
the master pty

*query-ext-files*:::
called after the process tree is stopped and network is locked.
This hook is used only in the RPC mode. The notification reply
contains file ids to be added to external file list (may be empty).

*--unprivileged*::
This option tells *criu* to accept the limitations when running
as non-root. Running as non-root requires *criu* at least to have
Expand Down Expand Up @@ -457,6 +462,9 @@ The 'mode' may be one of the following:

*nftables*::: Use nftables rules to drop the packets.

*skip*::: Don't lock the network. If *--tcp-close* is not used, the network
must be locked externally to allow CRIU to dump TCP connections.

*restore*
~~~~~~~~~
Restores previously checkpointed processes.
Expand Down
Loading
Loading