Commit 8f96ff85 authored by Qiang Huang's avatar Qiang Huang Committed by Pavel Emelyanov

crtools: Add --file-locks option

Add --file-locks/-l option to support handling file locks, for safety,
only used for container.
Originally-signed-off-by: 's avatarZheng Gu <cengku.gu@huawei.com>
Signed-off-by: 's avatarQiang Huang <h.huangqiang@huawei.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 5c011782
......@@ -60,7 +60,7 @@ int main(int argc, char *argv[])
int log_inited = 0;
int log_level = 0;
static const char short_opts[] = "dsf:t:hcD:o:n:vxVr:j";
static const char short_opts[] = "dsf:t:hcD:o:n:vxVr:jl";
BUILD_BUG_ON(PAGE_SIZE != PAGE_IMAGE_SIZE);
......@@ -100,6 +100,7 @@ int main(int argc, char *argv[])
{ "action-script", required_argument, 0, 49},
{ LREMAP_PARAM, no_argument, 0, 41},
{ "shell-job", no_argument, 0, 'j'},
{ "file-locks", no_argument, 0, 'l'},
{ },
};
......@@ -221,6 +222,9 @@ int main(int argc, char *argv[])
case 'j':
opts.shell_job = true;
break;
case 'l':
opts.handle_file_locks = true;
break;
case 'V':
pr_msg("Version: %d.%d\n", CRIU_VERSION_MAJOR, CRIU_VERSION_MINOR);
return 0;
......@@ -330,6 +334,7 @@ usage:
pr_msg(" * network-lock - lock network in a target network namespace\n");
pr_msg(" * network-unlock - unlock network in a target network namespace\n");
pr_msg(" -j|--shell-job allow to dump and restore shell jobs\n");
pr_msg(" -l|--file_locks handle file locks, for safety, only used for container\n");
pr_msg("\n* Logging:\n");
pr_msg(" -o|--log-file [NAME] log file name (relative path is relative to --images-dir)\n");
......
......@@ -98,6 +98,7 @@ struct cr_options {
bool restore_detach;
bool ext_unix_sk;
bool shell_job;
bool handle_file_locks;
bool tcp_established_ok;
bool evasive_devices;
bool link_remap_ok;
......
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