Skip to content

Commit 9d48af5

Browse files
authored
Merge pull request #1743 from kolyshkin/1741-followup
Followups to #1741
2 parents db82220 + c1e72c1 commit 9d48af5

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/libcrun/criu.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ libcrun_container_checkpoint_linux_criu (libcrun_container_status_t *status, lib
480480
{
481481
ret = mkdir (cr_options->work_path, 0700);
482482
if (UNLIKELY ((ret == -1) && (errno != EEXIST)))
483-
return crun_make_error (err, errno, "error creating CRIU work directory `%s`", cr_options->image_path);
483+
return crun_make_error (err, errno, "error creating CRIU work directory `%s`", cr_options->work_path);
484484

485485
work_fd = open (cr_options->work_path, O_DIRECTORY | O_CLOEXEC);
486486
if (UNLIKELY (work_fd == -1))
@@ -861,6 +861,10 @@ libcrun_container_restore_linux_criu (libcrun_container_status_t *status, libcru
861861
* crun to set it if the user has not selected a specific directory. */
862862
if (cr_options->work_path != NULL)
863863
{
864+
ret = mkdir (cr_options->work_path, 0700);
865+
if (UNLIKELY ((ret == -1) && (errno != EEXIST)))
866+
return crun_make_error (err, errno, "error creating CRIU work directory `%s`", cr_options->work_path);
867+
864868
work_fd = open (cr_options->work_path, O_DIRECTORY | O_CLOEXEC);
865869
if (UNLIKELY (work_fd == -1))
866870
return crun_make_error (err, errno, "error opening CRIU work directory `%s`", cr_options->work_path);

tests/test_checkpoint_restore.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ def _get_pre_dump_size(cr_dir):
161161

162162
cid = None
163163
cr_dir = os.path.join(get_tests_root(), 'pre-dump')
164+
work_dir = 'work-dir'
164165
try:
165166
_, cid = run_and_get_output(
166167
conf,
@@ -187,7 +188,6 @@ def _get_pre_dump_size(cr_dir):
187188

188189
# Do the final dump. This dump should be much smaller.
189190
cr_dir = os.path.join(get_tests_root(), 'checkpoint')
190-
work_dir = 'work-dir'
191191
run_crun_command([
192192
"checkpoint",
193193
"--parent-path=../pre-dump",

0 commit comments

Comments
 (0)