2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 06:15:24 +00:00

lazy-pages: enable lazy-pages via RPC

To use lazy-pages from runc '--lazy-pages' functionality needs to be
accessible via RPC. This enables lazy-pages via RPC.

The information on which port to listen is taken from the
criu_page_server_info protobuf structure. If the user has enabled
lazy-pages via RPC only criu_page_server_info.port is evaluated
to get the listen port.

With additional patches in runc is it possible to use lazy-restore
with 'runc checkpoint' and 'runc restore'.

travis-ci: success for lazy-pages: enable lazy-pages via RPC
Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
Adrian Reber
2017-01-13 13:41:00 +03:00
committed by Andrei Vagin
parent 39f1388b4f
commit 6f82f87a44
2 changed files with 14 additions and 6 deletions

View File

@@ -371,16 +371,23 @@ static int setup_opts_from_req(int sk, CriuOpts *req)
opts.exec_cmd[req->n_exec_cmd] = NULL;
}
if (req->has_lazy_pages) {
opts.lazy_pages = req->lazy_pages;
}
if (req->ps) {
opts.use_page_server = true;
opts.addr = req->ps->address;
opts.port = htons((short)req->ps->port);
if (req->ps->has_fd) {
if (!opts.swrk_restore)
goto err;
if (!opts.lazy_pages) {
opts.use_page_server = true;
opts.addr = req->ps->address;
opts.ps_socket = req->ps->fd;
if (req->ps->has_fd) {
if (!opts.swrk_restore)
goto err;
opts.ps_socket = req->ps->fd;
}
}
}

View File

@@ -108,6 +108,7 @@ message criu_opts {
optional uint32 timeout = 45;
optional bool tcp_skip_in_flight = 46;
optional bool weak_sysctls = 47;
optional bool lazy_pages = 48;
optional int32 status_fd = 49;
optional bool orphan_pts_master = 50;
}