[crac] RFR: Support passing extra options in CREngine

Anton Kozlov akozlov at openjdk.org
Thu Jun 8 18:47:13 UTC 2023

On Wed, 10 May 2023 08:58:54 GMT, Radim Vansa <duke at openjdk.org> wrote:

> In addition to `-XX:CREngine=program` this adds support to `-XX:CREngine=program,key=value,anotherkey` that translates into invoking `program --key value --anotherkey`.
> This generic parameters support is utilized in `criuengine` that accepts `--verbosity` and `--log-file` options and relays them to `criu`.

src/hotspot/share/runtime/globals.hpp line 2100:

> 2098:       "as a comma-separated list of key[=value] pairs; "                    \
> 2099:       "-XX:CREngine=program,key=value,anotherkey results in calling "       \
> 2100:       "'program --key value --anotherkey'")                                 \

There is CRAC_CRIU_OPTS that is used to pass additional options to CRIU. I see that remains in place, and this turns out to be alternative?

Not every CREngine may want to follow this convention of argument passing. Usually, `program,--key,value,--anotherkey` is specified to call `program --key value --anotherkey`.

This probably needs to be RESTORE_SETTABLE.

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

> 103:             "-D", imagedir,
> 104:             "--shell-job",
> 105:             "-v4", "-o", "dump4.log", // -D without -W makes criu cd to image dir for logs

The dump4.log is a great debugging aid for checkpoint and restore failures, please keep it.

I think a part of the reason for this change is to provide some logging to the console. I think the reporting should be implemented separately https://github.com/openjdk/crac/pull/64#discussion_r1221827050


PR Review Comment: https://git.openjdk.org/crac/pull/63#discussion_r1223418528
PR Review Comment: https://git.openjdk.org/crac/pull/63#discussion_r1223421815

More information about the crac-dev mailing list