mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-29 05:18:00 +00:00
page-xfer: make connect_to_page_server return socket fd
It will used by lazy-pages daemon to enable polling for reception of page data from remote dump travis-ci: success for uffd: A new set of improvements Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
parent
c907796dc6
commit
57d341f105
@ -1565,7 +1565,7 @@ int cr_pre_dump_tasks(pid_t pid)
|
||||
if (vdso_init())
|
||||
goto err;
|
||||
|
||||
if (connect_to_page_server())
|
||||
if (connect_to_page_server() < 0)
|
||||
goto err;
|
||||
|
||||
if (setup_alarm_handler())
|
||||
@ -1761,7 +1761,7 @@ int cr_dump_tasks(pid_t pid)
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (connect_to_page_server())
|
||||
if (connect_to_page_server() < 0)
|
||||
goto err;
|
||||
|
||||
if (setup_alarm_handler())
|
||||
|
@ -906,7 +906,7 @@ out:
|
||||
* on urgent data is the smartest mode ever.
|
||||
*/
|
||||
tcp_cork(page_server_sk, true);
|
||||
return 0;
|
||||
return page_server_sk;
|
||||
}
|
||||
|
||||
int disconnect_from_page_server(void)
|
||||
|
13
criu/uffd.c
13
criu/uffd.c
@ -847,6 +847,17 @@ close_uffd:
|
||||
return -1;
|
||||
}
|
||||
|
||||
static int prepare_page_server_socket(void)
|
||||
{
|
||||
int sk;
|
||||
|
||||
sk = connect_to_page_server();
|
||||
if (sk < 0)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int cr_lazy_pages(bool daemon)
|
||||
{
|
||||
struct epoll_event *events;
|
||||
@ -894,7 +905,7 @@ int cr_lazy_pages(bool daemon)
|
||||
if (prepare_uffds(lazy_sk, epollfd))
|
||||
return -1;
|
||||
|
||||
if (connect_to_page_server())
|
||||
if (prepare_page_server_socket())
|
||||
return -1;
|
||||
|
||||
ret = handle_requests(epollfd, events);
|
||||
|
Loading…
x
Reference in New Issue
Block a user