criu icon indicating copy to clipboard operation
criu copied to clipboard

link-remap: Add --keep-link-remaps option

Open ajwock opened this issue 2 years ago • 6 comments

When specified, this option disables the automatic deletion of link-remaps on restore. This allows checkpoints dumped with --link-remap to be restored multiple times (provided that other conditions for reuse are met).

Signed-off-by: Drew Wock [email protected]

ajwock avatar Dec 15 '22 20:12 ajwock

A friendly reminder that this PR had no activity for 30 days.

github-actions[bot] avatar Jan 15 '23 00:01 github-actions[bot]

@ajwock What is the use case for this option? Would you be able to add a test?

rst0git avatar Jan 20 '23 13:01 rst0git

In my use case, we have a process which needs to use --link-remap in order to be C/Red. This checkpoint image also may need to be restored from multiple times, but because by default a restore with --link-remap deletes the hardlink, it is not possible to do this with vanilla criu.

I can work on adding a test.

ajwock avatar Jan 23 '23 16:01 ajwock

One possible downside of --keep-link-remaps is that if you leave "remap/path/file.cr_link" on the filesystem you would likely fail dumping the same process again as link creation would fail with EEXIST. (probably after first dump you will have only "remap/path/file" leftover on the filesystem and after second you would get "remap/path/file.cr_link" and third dump would fail, but anyway, see code in open_path around rfi_remap)

Snorch avatar Jan 23 '23 21:01 Snorch

One possible downside of --keep-link-remaps is that if you leave "remap/path/file.cr_link" on the filesystem you would likely fail dumping the same process again as link creation would fail with EEXIST. (probably after first dump you will have only "remap/path/file" leftover on the filesystem and after second you would get "remap/path/file.cr_link" and third dump would fail, but anyway, see code in open_path around rfi_remap)

It's interesting you mention this: I have another patch I was planning on submitting after this one that finds a unique name for the remap in the case of EEXIST. Perhaps I should include that as part of this patch?

ajwock avatar Jan 23 '23 21:01 ajwock

A friendly reminder that this PR had no activity for 30 days.

github-actions[bot] avatar Feb 23 '23 00:02 github-actions[bot]