2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 14:25:49 +00:00

kdat: Merge dump and restore kerndats

Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
Pavel Emelyanov
2017-05-04 16:32:17 +03:00
committed by Andrei Vagin
parent a840995689
commit e4d14b65d7
4 changed files with 2 additions and 35 deletions

View File

@@ -2167,7 +2167,7 @@ int cr_restore_tasks(void)
if (init_stats(RESTORE_STATS)) if (init_stats(RESTORE_STATS))
goto err; goto err;
if (kerndat_init_rst()) if (kerndat_init())
goto err; goto err;
timing_start(TIME_RESTORE); timing_start(TIME_RESTORE);

View File

@@ -11,7 +11,6 @@ struct stat;
*/ */
extern int kerndat_init(void); extern int kerndat_init(void);
extern int kerndat_init_rst(void);
extern int kerndat_get_dirty_track(void); extern int kerndat_get_dirty_track(void);
extern int kerndat_fdinfo_has_lock(void); extern int kerndat_fdinfo_has_lock(void);
extern int kerndat_loginuid(void); extern int kerndat_loginuid(void);

View File

@@ -589,40 +589,8 @@ int kerndat_init(void)
ret = kerndat_tcp_repair(); ret = kerndat_tcp_repair();
if (!ret) if (!ret)
ret = kerndat_compat_restore(); ret = kerndat_compat_restore();
kerndat_lsm();
kerndat_mmap_min_addr();
return ret;
}
int kerndat_init_rst(void)
{
int ret;
/*
* Read TCP sysctls before anything else,
* since the limits we're interested in are
* not available inside namespaces.
*/
ret = check_pagemap();
if (!ret)
ret = get_last_cap();
if (!ret) if (!ret)
ret = kerndat_has_memfd_create(); ret = kerndat_has_memfd_create();
if (!ret)
ret = get_task_size();
if (!ret)
ret = get_ipv6();
if (!ret)
ret = kerndat_loginuid();
if (!ret)
ret = kerndat_iptables_has_xtlocks();
if (!ret)
ret = kerndat_tcp_repair();
if (!ret)
ret = kerndat_compat_restore();
kerndat_lsm(); kerndat_lsm();
kerndat_mmap_min_addr(); kerndat_mmap_min_addr();

View File

@@ -111,7 +111,7 @@ void kerndat_lsm(void)
{ {
/* On restore, if someone passes --lsm-profile, we might end up doing /* On restore, if someone passes --lsm-profile, we might end up doing
* detection twice, once during flag parsing and once for * detection twice, once during flag parsing and once for
* kerndat_init_rst(). Let's detect when we've already done detection * kerndat_init(). Let's detect when we've already done detection
* and not do it again. * and not do it again.
*/ */
if (name) if (name)