criu/test/zdtm/lib
Ahmed Elaidy a13ce915c2 zdtm: use private bind-mount as GCOV external mount target
With GCOV=1, zdtm.py passes the CRIU workspace parent as an
external bind-mount into the test namespace (ZDTM_CRIU).  On
restore in the uns flavor CRIU calls open_tree(OPEN_TREE_CLONE)
on that path.  Because the workspace is a parent of the user
namespace mount tree, its mounts are MNT_LOCKED, and open_tree
returns EINVAL.

Fix by creating a private bind-mount of the workspace parent at
'../criu.tree' before each test run, then using that path as the
source of the bind-mount inside the ZDTM namespace (ns.c).  On
restore, point the external mapping at 'criu.tree' instead of
the raw workspace path.

Because criu.tree is MS_PRIVATE and is created before any CRIU
run, cgroupfs submounts that CRIU later creates inside the
workspace (cg_yard via mkdtemp) do not propagate into it.
open_tree(OPEN_TREE_CLONE, criu.tree) therefore sees no locked
submounts and succeeds.

This replaces the earlier --work-dir workaround, which was
correct in principle but broke the RPC test path where
criu_rpc.__set_opts has no handler for --work-dir.

Fixes: #2911
Signed-off-by: Ahmed Elaidy <elaidya225@gmail.com>
2026-03-11 15:10:23 -07:00
..
arch zdtm: add riscv64 support 2025-03-21 12:40:31 -07:00
bpfmap_zdtm.c Run 'make indent' on all C files 2021-09-03 10:31:00 -07:00
bpfmap_zdtm.h Run 'make indent' on header files 2021-09-03 10:31:00 -07:00
cpuid.h Run 'make indent' on header files 2021-09-03 10:31:00 -07:00
datagen.c Run 'make indent' on all C files 2021-09-03 10:31:00 -07:00
file.c zdtm: Add write_value/read_value helpers into zdtm library 2023-04-15 21:17:21 -07:00
fs.c limit the field width of 'scanf' 2025-11-14 18:26:27 +00:00
fs.h Run 'make indent' on header files 2021-09-03 10:31:00 -07:00
groups.c Run 'make indent' on all C files 2021-09-03 10:31:00 -07:00
groups.desc zdtm.py: The groups_test class for running groups 2015-12-08 14:54:52 +03:00
list.h zdtm/lib: copy list.h 2023-04-15 21:17:21 -07:00
lock.c Run 'make indent' on all C files 2021-09-03 10:31:00 -07:00
lock.h zdtm/lib: add missing signal.h header 2023-10-22 13:29:25 -07:00
Makefile Makefile: introduce ARCHCFLAGS for arch specific cflags 2023-11-27 16:47:16 -08:00
mem.c zdtm: Add MAP_HUGETLB memory mapping test 2022-04-28 17:53:52 -07:00
mountinfo.c zdtm: add mountinfo topology compare to test lib 2023-04-15 21:17:21 -07:00
mountinfo.h zdtm: add MNTNS_ZDTM macro to fix initialization 2023-04-15 21:17:21 -07:00
msg.c timer: fix printf specifiers for __suseconds64_t 2024-09-11 16:02:11 -07:00
ns.c zdtm: use private bind-mount as GCOV external mount target 2026-03-11 15:10:23 -07:00
ns.h zdtm/lib: add pre-dump-notify test flag 2018-07-09 18:26:50 +03:00
parseargs.c Run 'make indent' on all C files 2021-09-03 10:31:00 -07:00
parseargs.sh zdtm: Zero Downtime Migration Test Suite 2011-12-02 17:49:08 +04:00
stop_and_chk.sh zdtm: Zero Downtime Migration Test Suite 2011-12-02 17:49:08 +04:00
streamutil.c zdtm: lib: add {read,write}_data helpers 2017-12-12 09:12:44 +03:00
sysctl.c zdtm/netns_sub_sysctl: add ipv4/ping_group_range sysctl check 2025-03-21 12:40:31 -07:00
sysctl.h zdtm/netns_sub_sysctl: add ipv4/ping_group_range sysctl check 2025-03-21 12:40:31 -07:00
tcp.c Run 'make indent' on all C files 2021-09-03 10:31:00 -07:00
test.c zdtm: add riscv64 support 2025-03-21 12:40:31 -07:00
unix.c zdtm/lib: fix cwd path freeing 2023-04-15 21:17:21 -07:00
xmalloc.h zdtm/lib: copy xmalloc.h 2023-04-15 21:17:21 -07:00
zdtmtst.h zdtm/lib: copy list.h 2023-04-15 21:17:21 -07:00