[CRIU] [PATCH 01/22] image: Fix "collect happenned" flag
Pavel Emelyanov
xemul at virtuozzo.com
Fri Jun 30 13:55:47 MSK 2017
This flag now means "image was opened", while the "empty image"
concept makes this always true. Since there's one user of this
flag, which is obviously incorrect, remove the latter and fix
the former to mean "at least one object was read".
Signed-off-by: Pavel Emelyanov <xemul at virtuozzo.com>
---
criu/file-lock.c | 5 -----
criu/protobuf.c | 2 +-
2 files changed, 1 insertion(+), 6 deletions(-)
diff --git a/criu/file-lock.c b/criu/file-lock.c
index 2d4036c..821821f 100644
--- a/criu/file-lock.c
+++ b/criu/file-lock.c
@@ -426,11 +426,6 @@ int prepare_file_locks(int pid)
if (!opts.handle_file_locks)
return 0;
- if (!(file_locks_cinfo.flags & COLLECT_HAPPENED)) {
- pr_warn("Per-pid file locks are deprecated\n");
- return -1;
- }
-
return restore_file_locks(pid);
}
diff --git a/criu/protobuf.c b/criu/protobuf.c
index 5c770b8..219c7c0 100644
--- a/criu/protobuf.c
+++ b/criu/protobuf.c
@@ -186,7 +186,6 @@ int collect_image(struct collect_image_info *cinfo)
if (!img)
return -1;
- cinfo->flags |= COLLECT_HAPPENED;
if (cinfo->flags & COLLECT_SHARED) {
o_alloc = shmalloc;
o_free = shfree_last;
@@ -210,6 +209,7 @@ int collect_image(struct collect_image_info *cinfo)
break;
}
+ cinfo->flags |= COLLECT_HAPPENED;
ret = cinfo->collect(obj, msg, img);
if (ret < 0) {
o_free(obj);
--
2.1.4
More information about the CRIU
mailing list