Commit 8813bb24 by Christian Brauner Committed by GitHub

Merge pull request #1274 from tych0/check-state-before-checkpoint

c/r: check state before doing a checkpoint/restore
parents 293eeeac 7ad13c91
......@@ -3994,12 +3994,24 @@ static int do_lxcapi_migrate(struct lxc_container *c, unsigned int cmd,
switch (cmd) {
case MIGRATE_PRE_DUMP:
if (!do_lxcapi_is_running(c)) {
ERROR("container is not running");
return false;
}
ret = !__criu_pre_dump(c, valid_opts);
break;
case MIGRATE_DUMP:
if (!do_lxcapi_is_running(c)) {
ERROR("container is not running");
return false;
}
ret = !__criu_dump(c, valid_opts);
break;
case MIGRATE_RESTORE:
if (do_lxcapi_is_running(c)) {
ERROR("container is already running");
return false;
}
ret = !__criu_restore(c, valid_opts);
break;
default:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment