• Adrian Reber's avatar
    cr-service: add support for configuration files in RPC mode · 99d52ec7
    Adrian Reber authored
    With this commit it is possible to specify a configuration file via
    RPC. In python this would look like this:
    
     req.opts.config_file = 'path/to/config_file'
    
    With this commit CRIU's configuration file handling works like this:
    
     * apply_config(global_conf)
     * apply_config(user_conf)
     * apply_config(environment variable)
     * apply_config(config file via CLI)
     * apply_rpc_options() or apply_cli_options()
     * apply_config(rpc_conf) (only for RPC)
    
    This is at least (probably) the third iteration of the RPC configuration
    file code and it still is complicated.
    
    Most CRIU options are correctly used by just writing the new values to
    the corresponding fields of the opts structure. For the RPC case there
    are, however, a few options (output, work_dir, imgs_dir) which need
    special handling.
    
    So the RPC configuration file is parsed twice. First time to get output,
    work_dir and imgs_dir. Once those are read and correctly used, the RPC
    code overwrites all options again by values set by the RPC interface. At
    the end the RPC configuration file is read a second time and finally
    overwrites the values set via RPC.
    Signed-off-by: 's avatarAdrian Reber <areber@redhat.com>
    Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
    99d52ec7
Name
Last commit
Last update
Documentation Loading commit data...
compel Loading commit data...
contrib Loading commit data...
coredump Loading commit data...
crit Loading commit data...
criu Loading commit data...
images Loading commit data...
include/common Loading commit data...
lib Loading commit data...
scripts Loading commit data...
soccr Loading commit data...
test Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
INSTALL.md Loading commit data...
Makefile Loading commit data...
Makefile.compel Loading commit data...
Makefile.config Loading commit data...
Makefile.install Loading commit data...
Makefile.versions Loading commit data...
README.md Loading commit data...