From 05ec9b1ab35876418221828da65a7d7b04b4b0fd Mon Sep 17 00:00:00 2001 From: Giuseppe Scrivano Date: Thu, 19 Dec 2024 14:08:59 +0100 Subject: [PATCH] criu: do not set network_lock if not specified commit c4f8c87a7a06fdc46e10fff129d89f8753d62380 introduced the issue. Closes: https://github.com/containers/crun/issues/1627 Signed-off-by: Giuseppe Scrivano --- src/libcrun/criu.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libcrun/criu.c b/src/libcrun/criu.c index 2e4e0d9da..a8776879e 100644 --- a/src/libcrun/criu.c +++ b/src/libcrun/criu.c @@ -647,7 +647,7 @@ libcrun_container_checkpoint_linux_criu (libcrun_container_status_t *status, lib libcriu_wrapper->criu_set_manage_cgroups_mode (cr_options->manage_cgroups_mode); libcriu_wrapper->criu_set_manage_cgroups (true); - if (libcriu_wrapper->criu_set_network_lock) + if (libcriu_wrapper->criu_set_network_lock && cr_options->network_lock_method > 0) libcriu_wrapper->criu_set_network_lock (cr_options->network_lock_method); ret = libcriu_wrapper->criu_dump (); @@ -984,7 +984,9 @@ libcrun_container_restore_linux_criu (libcrun_container_status_t *status, libcru libcriu_wrapper->criu_set_file_locks (cr_options->file_locks); libcriu_wrapper->criu_set_orphan_pts_master (true); libcriu_wrapper->criu_set_manage_cgroups (true); - libcriu_wrapper->criu_set_network_lock (cr_options->network_lock_method); + + if (libcriu_wrapper->criu_set_network_lock && cr_options->network_lock_method > 0) + libcriu_wrapper->criu_set_network_lock (cr_options->network_lock_method); libcriu_wrapper->criu_set_log_level (4); libcriu_wrapper->criu_set_log_file (CRIU_RESTORE_LOG_FILE);