mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-08-01 22:33:30 +00:00
check/servise: use cached kdat values for features check
The kerndat_init() is now called before the jump to action handler. This allows us to directly use kdat without calling to the corresponding kerndat_*() methods. ✓ travis-ci: success for lazy-pages: update checks for availability of userfaultfd (rev3) Signed-off-by: Mike Rapoport <rppt@linux.vnet.ibm.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
parent
8d80012bf1
commit
6a17d8cf49
2 changed files with 4 additions and 37 deletions
|
|
@ -676,9 +676,6 @@ static int check_ptrace_dump_seccomp_filters(void)
|
|||
|
||||
static int check_mem_dirty_track(void)
|
||||
{
|
||||
if (kerndat_get_dirty_track() < 0)
|
||||
return -1;
|
||||
|
||||
if (!kdat.has_dirty_track) {
|
||||
pr_warn("Dirty tracking is OFF. Memory snapshot will not work.\n");
|
||||
return -1;
|
||||
|
|
@ -772,9 +769,6 @@ static int check_aio_remap(void)
|
|||
|
||||
static int check_fdinfo_lock(void)
|
||||
{
|
||||
if (kerndat_fdinfo_has_lock())
|
||||
return -1;
|
||||
|
||||
if (!kdat.has_fdinfo_lock) {
|
||||
pr_err("fdinfo doesn't contain the lock field\n");
|
||||
return -1;
|
||||
|
|
@ -931,12 +925,6 @@ out:
|
|||
|
||||
static int check_tcp_halt_closed(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = kerndat_tcp_repair();
|
||||
if (ret < 0)
|
||||
return -1;
|
||||
|
||||
if (!kdat.has_tcp_half_closed) {
|
||||
pr_err("TCP_REPAIR can't be enabled for half-closed sockets\n");
|
||||
return -1;
|
||||
|
|
@ -1023,9 +1011,6 @@ static int check_userns(void)
|
|||
|
||||
static int check_loginuid(void)
|
||||
{
|
||||
if (kerndat_loginuid() < 0)
|
||||
return -1;
|
||||
|
||||
if (kdat.luid != LUID_FULL) {
|
||||
pr_warn("Loginuid restore is OFF.\n");
|
||||
return -1;
|
||||
|
|
@ -1048,9 +1033,6 @@ static int check_compat_cr(void)
|
|||
|
||||
static int check_uffd(void)
|
||||
{
|
||||
if (kerndat_uffd())
|
||||
return -1;
|
||||
|
||||
if (!kdat.has_uffd) {
|
||||
pr_err("UFFD is not supported\n");
|
||||
return -1;
|
||||
|
|
|
|||
|
|
@ -886,22 +886,11 @@ static int handle_feature_check(int sk, CriuReq * msg)
|
|||
setproctitle("feature-check --rpc");
|
||||
|
||||
if ((msg->features->has_mem_track == 1) &&
|
||||
(msg->features->mem_track == true)) {
|
||||
|
||||
feat.mem_track = true;
|
||||
ret = kerndat_get_dirty_track();
|
||||
|
||||
if (ret)
|
||||
feat.mem_track = false;
|
||||
|
||||
if (!kdat.has_dirty_track)
|
||||
feat.mem_track = false;
|
||||
}
|
||||
(msg->features->mem_track == true))
|
||||
feat.mem_track = kdat.has_dirty_track;
|
||||
|
||||
if ((msg->features->has_lazy_pages == 1) &&
|
||||
(msg->features->lazy_pages == true)) {
|
||||
ret = kerndat_uffd();
|
||||
|
||||
(msg->features->lazy_pages == true))
|
||||
/*
|
||||
* Not checking for specific UFFD features yet.
|
||||
* If no error is returned it is probably
|
||||
|
|
@ -909,11 +898,7 @@ static int handle_feature_check(int sk, CriuReq * msg)
|
|||
* be extended in the future for a more detailed
|
||||
* UFFD feature check.
|
||||
*/
|
||||
if (ret || !kdat.has_uffd)
|
||||
feat.lazy_pages = false;
|
||||
else
|
||||
feat.lazy_pages = true;
|
||||
}
|
||||
feat.lazy_pages = kdat.has_uffd;
|
||||
|
||||
resp.features = &feat;
|
||||
resp.type = msg->type;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue