[crac] RFR: Support extra criu flags from the environment

Anton Kozlov akozlov at openjdk.org
Thu Jun 30 06:48:01 UTC 2022

On Wed, 29 Jun 2022 13:00:59 GMT, Volker Simonis <simonis at openjdk.org> wrote:

> When testing with different `criu` versions or `criu` configurations it might be useful to be able to modify the default  `criu` command line parameters. This PR introduces the new environment variable `CRAC_CRIU_OPTS` which will be interpreted as a space separated list of `criu` flags to be appended to the hard-coded list of command line parameters. E.g.
> $ CRAC_CRIU_OPTS="-v4 -o resume.log -W /tmp/crac" java -XX:CRaCRestoreFrom=/tmp/crac
> This will set the logging level to 4 (thus overriding the hard-coded logging level of 1 for resuming), redirect the log to the file `resume.log` and change `criu`'s working directory (which will contain the log file) to `/tmp/crac`.

Changes requested by akozlov (Lead).

src/java.base/unix/native/criuengine/criuengine.c line 116:

> 114:         }
> 115:         *arg++ = NULL;
> 116:         assert(ARRAY_SIZE(args) >= (size_t)(arg - args));

I'm not sure if we are compiling with asserts. Could you turn this and another assert below into a runtime check and explicit failure if arguments do not fit?


PR: https://git.openjdk.org/crac/pull/26

More information about the crac-dev mailing list