It's poissible to set new -XX:CRaCCheckpointTo= value after restore, but an attempt to checkpoint fails. Notice the target directory does not match the requested one.
$JAVA -XX:CRaCCheckpointTo=img1 -DpreLoop Test.java
init
start
stage 1: 1
stage 1: 2
stage 1: 3
Sep 06, 2024 12:33:10 PM jdk.internal.crac.LoggerContainer info
INFO: Starting checkpoint
beforeCheckpoint
Killed
$JAVA -XX:CRaCRestoreFrom=img1 -XX:CRaCCheckpointTo=asdf
afterRestore
stage 1: 4
stage 1: 5
stage 1: 6
stage 1: 7
Sep 06, 2024 12:33:17 PM jdk.internal.crac.LoggerContainer info
INFO: Starting checkpoint
beforeCheckpoint
Error (criu/image.c:577): Can't open dir ubuntu: No such file or directory
Error (criu/crtools.c:237): Couldn't open image dir ubuntu
...
stage 1: 8
stage 1: 9
stage 1: 10
$JAVA -XX:CRaCCheckpointTo=img1 -DpreLoop Test.java
init
start
stage 1: 1
stage 1: 2
stage 1: 3
Sep 06, 2024 12:33:10 PM jdk.internal.crac.LoggerContainer info
INFO: Starting checkpoint
beforeCheckpoint
Killed
$JAVA -XX:CRaCRestoreFrom=img1 -XX:CRaCCheckpointTo=asdf
afterRestore
stage 1: 4
stage 1: 5
stage 1: 6
stage 1: 7
Sep 06, 2024 12:33:17 PM jdk.internal.crac.LoggerContainer info
INFO: Starting checkpoint
beforeCheckpoint
Error (criu/image.c:577): Can't open dir ubuntu: No such file or directory
Error (criu/crtools.c:237): Couldn't open image dir ubuntu
...
stage 1: 8
stage 1: 9
stage 1: 10