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

zdtm: verify that criu repo file system allows resolving device files #2444

Conversation

Snorch
Copy link
Member

@Snorch Snorch commented Jul 15, 2024

We put several device files into zdtm container through its root file system which is the same file system criu git resides in.

We do it like this to overcome inability to create character and block device files in user namespaces. So even if we put those device files into zdtm container in any other way, in 'uns' flavor CRIU would not be able to restore those device files.

Other option can be - creating auxiliary tmpfs mount and add it into zdtm container as external mount, but that looks like an overkill for this problem. Let's print a clear error so that user can either mount current file system without 'nodev" or put criu somewhere else.

Fixes: #2441

We put several device files into zdtm container through its root
file system which is the same file system criu git resides in.

We do it like this to overcome inability to create character and block
device files in user namespaces. So even if we put those device files
into zdtm container in any other way, in 'uns' flavor CRIU would not be
able to restore those device files.

Other option can be - creating auxiliary tmpfs mount and add it into
zdtm container as external mount, but that looks like an overkill for
this problem. Let's print a clear error so that user can either mount
current file system without 'nodev" or put criu somewhere else.

Fixes: checkpoint-restore#2441

Signed-off-by: Pavel Tikhomirov <[email protected]>
@Snorch Snorch force-pushed the zdtm-verify-device-file-resolving branch from acf8286 to bbaaaa7 Compare July 15, 2024 09:03
except IOError as e:
if e.errno != errno.EACCES:
raise e
raise test_fail_exc("The filesystem of CRIU repo should not have 'nodev' flag. Consider putting CRIU on appropriate file system to run ZDTM.")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be good to add \n:

Suggested change
raise test_fail_exc("The filesystem of CRIU repo should not have 'nodev' flag. Consider putting CRIU on appropriate file system to run ZDTM.")
raise test_fail_exc("\nThe filesystem of CRIU repo should not have 'nodev' flag. Consider putting CRIU on appropriate file system to run ZDTM.")
[root@thinkpad:/tmp/criu/test] <base> 1 # python3 ./zdtm.py run -t zdtm/static/busyloop00 -f ns
userns is supported
=== Run 1/1 ================ zdtm/static/busyloop00
======================= Run zdtm/static/busyloop00 in ns =======================
 Test zdtm/static/busyloop00 FAIL at 
The filesystem of CRIU repo should not have 'nodev' flag. Consider putting CRIU on appropriate file system to run ZDTM. 
##################################### FAIL #####################################

@Snorch
Copy link
Member Author

Snorch commented Jul 16, 2024

"External mount" approach is more robust, so closing it.

@Snorch Snorch closed this Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants