Commit 6f82f87a authored by Adrian Reber's avatar Adrian Reber Committed by Andrei Vagin

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: 's avatarAdrian Reber <areber@redhat.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent 39f1388b
...@@ -371,16 +371,23 @@ static int setup_opts_from_req(int sk, CriuOpts *req) ...@@ -371,16 +371,23 @@ static int setup_opts_from_req(int sk, CriuOpts *req)
opts.exec_cmd[req->n_exec_cmd] = NULL; opts.exec_cmd[req->n_exec_cmd] = NULL;
} }
if (req->has_lazy_pages) {
opts.lazy_pages = req->lazy_pages;
}
if (req->ps) { if (req->ps) {
opts.use_page_server = true;
opts.addr = req->ps->address;
opts.port = htons((short)req->ps->port); opts.port = htons((short)req->ps->port);
if (req->ps->has_fd) { if (!opts.lazy_pages) {
if (!opts.swrk_restore) opts.use_page_server = true;
goto err; opts.addr = req->ps->address;
if (req->ps->has_fd) {
if (!opts.swrk_restore)
goto err;
opts.ps_socket = req->ps->fd; opts.ps_socket = req->ps->fd;
}
} }
} }
......
...@@ -108,6 +108,7 @@ message criu_opts { ...@@ -108,6 +108,7 @@ message criu_opts {
optional uint32 timeout = 45; optional uint32 timeout = 45;
optional bool tcp_skip_in_flight = 46; optional bool tcp_skip_in_flight = 46;
optional bool weak_sysctls = 47; optional bool weak_sysctls = 47;
optional bool lazy_pages = 48;
optional int32 status_fd = 49; optional int32 status_fd = 49;
optional bool orphan_pts_master = 50; optional bool orphan_pts_master = 50;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment