Commit 7fe62208 authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

dump: Unlock network if -R option passed

It's been found that if -R (leave task running after checkpoint)
option passed we don't unlock network, nether we clean service
files (such as link remaps).

After a long discussion we choose the following path: if -R option
is passed, it means a user is quite confident in what he is doing
and consistency of the resources (file system) is achieved by
a user himself with help of post-dump script. Also a user knows
that the network will be unlocked and accept such case.

So here we check of -R being passed in command line and once
checkpoint complete we unlock the network.

Cleaning up of link remaps is addressed in another patch.
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 1a0ee90d
...@@ -1767,12 +1767,29 @@ err: ...@@ -1767,12 +1767,29 @@ err:
} }
/* /*
* If we've failed to do anything -- unlock all TCP sockets * Dump is complete at this stage. To choose what
* so that the connections can go on. But if we succeeded -- * to do next we need to consider the following
* don't, just close them silently. * scenarios
*
* - error happened during checkpoint: just clean up
* everything and continue execution of the dumpee;
*
* - dump successed but post-dump script returned
* some ret code: same as in previous scenario --
* just clean up everything and continue execution,
* we will return script ret code back to criu caller
* and it's up to a caller what to do with running instance
* of the dumpee -- either kill it, or continue running;
*
* - dump successed but -R option passed, pointing that
* we're asked to continue execution of the dumpee. It's
* assumed that a user will use post-dump script to keep
* consistency of the FS and other resources, we simply
* start rollback procedure and cleanup everyhting.
*/ */
if (ret || post_dump_ret) if (ret || post_dump_ret || opts.final_state == TASK_ALIVE) {
network_unlock(); network_unlock();
}
pstree_switch_state(root_item, pstree_switch_state(root_item,
(ret || post_dump_ret) ? (ret || post_dump_ret) ?
TASK_ALIVE : opts.final_state); TASK_ALIVE : opts.final_state);
......
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