criu/images/inventory.proto
Adrian Reber 3257cd2911 Introducing the --check-only option
Talking about criu a common question is, if it is possible to know if a
checkpoint and restore will actually work. Running 'criu dump' with
--leave-running to see if the checkpointing will work and then running
'criu restore' is always an option. If one of those operations (either
'dump' or 'restore') will fail the chances are high that there are
problems with checkpointing or restoring. But a lot of memory might have
already been dumped to disk and transferred to the destination system
which is not necessary to test for a restore failure. If the restore,
however, works the problem exists that the source process has been told
to keep on running (--leave-running) which might be an undesired
situation to have the process now running on the source and destination
system. To avoid a situation like this and to give an easier option to
test if 'criu dump' and 'criu restore' will work, this patch introduces
the '--check-only' option:

 source system:
  # criu dump --check-only -D /tmp/cp -t <PID>
  Only checking if requested operation will succeed
  # rsync -a /tmp/cp dest-system:/tmp

 destination system:
  # criu restore -D /tmp/cp
  Checking mode enabled

criu will detect if a checkpoint is a 'check-only' checkpoint and the
restore will automatically run in '--check-only' mode.

It is also possible to use the '--check-only' switch on a full
checkpoint to see if the restore will succeed and making sure at the
same time that the process will not start running:

 destination system:
  # criu restore --check-only -D /tmp/cp
  Only checking if requested operation will succeed
  Checking mode enabled

Right now only the existing checks (e.g., check binary size) are run in
'check-only' mode but additional checks could be added like:

 * checksums of binaries
 * checksums of used libraries
 * available memory

v2:
 - changes based on Pavel's review

Signed-off-by: Adrian Reber <areber@redhat.com>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
2017-11-30 01:18:53 +03:00

19 lines
382 B
Protocol Buffer

syntax = "proto2";
import "core.proto";
enum lsmtype {
NO_LSM = 0;
SELINUX = 1;
APPARMOR = 2;
}
message inventory_entry {
required uint32 img_version = 1;
optional bool fdinfo_per_id = 2;
optional task_kobj_ids_entry root_ids = 3;
optional bool ns_per_id = 4;
optional uint32 root_cg_set = 5;
optional lsmtype lsmtype = 6;
optional bool check_only = 7;
}