[CRIU] [PATCH v3 2/3] Do not error out in RPC mode with wrong config file entries

Radostin Stoyanov rstoyanov1 at gmail.com
Wed Dec 12 11:40:25 MSK 2018


On 12/12/2018 07:44, Adrian Reber wrote:
> From: Adrian Reber <areber at redhat.com>
>
> Relates: https://github.com/checkpoint-restore/criu/issues/578
>
> If the config parser finds a unknown option in the configuration file,
> the wrong option is printed out and CRIU exits.
>
> In RPC mode this is not the best thing to do, as CRIU might not be able
> to print the message to the user.
>
> This changes CRIU's behaviour in RPC mode to write a wrong configuration
> option to the log file. In CLI mode nothing changes:
>
> $ echo test >> /etc/criu/default.conf
> $ criu check
> criu: unrecognized option '--test'
> $ runc checkpoint <container>
> $ grep Unknown dump.log
> Warn  (criu/config.c:812): Unknown option encountered: --test
> $ echo test-runc >> /etc/criu/runc.conf
> $ runc restore -d <container>
> $ grep Unknown restore.log
> Warn  (criu/config.c:812): Unknown option encountered: --test
> Warn  (criu/config.c:812): Unknown option encountered: --test-runc
>
> This way unknown configuration file entries do not break RPC mode, but
> they are reported.
>
> Reported-by: Radostin Stoyanov <rstoyanov1 at gmail.com>
> Signed-off-by: Adrian Reber <areber at redhat.com>
> ---
>  criu/config.c | 38 ++++++++++++++++++++++++++++++++++++++
>  1 file changed, 38 insertions(+)
>
Acked-by: Radostin Stoyanov <rstoyanov1 at gmail.com>


More information about the CRIU mailing list