From 87d0d61e4101bc372d7d4e456e291eabfc6defd0 Mon Sep 17 00:00:00 2001 From: Pavel Emelyanov Date: Wed, 27 Mar 2013 20:17:59 +0400 Subject: [PATCH] lock: Show long option in log message about using one Signed-off-by: Pavel Emelyanov --- cr-dump.c | 2 +- crtools.c | 5 +++-- include/file-lock.h | 2 ++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cr-dump.c b/cr-dump.c index d309e8e0b..80893310a 100644 --- a/cr-dump.c +++ b/cr-dump.c @@ -1087,7 +1087,7 @@ static int collect_file_locks(const struct cr_options *opts) */ if (!list_empty(&file_lock_list)) { pr_err("Some file locks are hold by dumping tasks!" - "You can try -l to dump them.\n"); + "You can try --" OPT_FILE_LOCKS " to dump them.\n"); return -1; } diff --git a/crtools.c b/crtools.c index f39e61674..5364be9c9 100644 --- a/crtools.c +++ b/crtools.c @@ -28,6 +28,7 @@ #include "version.h" #include "page-xfer.h" #include "tty.h" +#include "file-lock.h" struct cr_options opts; @@ -107,7 +108,7 @@ int main(int argc, char *argv[]) { "action-script", required_argument, 0, 49}, { LREMAP_PARAM, no_argument, 0, 41}, { OPT_SHELL_JOB, no_argument, 0, 'j'}, - { "file-locks", no_argument, 0, 'l'}, + { OPT_FILE_LOCKS, no_argument, 0, 'l'}, { "page-server", no_argument, 0, 50}, { "address", required_argument, 0, 51}, { "port", required_argument, 0, 52}, @@ -363,7 +364,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|--%s allow to dump and restore shell jobs\n", OPT_SHELL_JOB); - pr_msg(" -l|--file-locks handle file locks, for safety, only used for container\n"); + pr_msg(" -l|--%s handle file locks, for safety, only used for container\n", OPT_FILE_LOCKS); pr_msg("\n* Logging:\n"); pr_msg(" -o|--log-file [NAME] log file name (relative path is relative to --images-dir)\n"); diff --git a/include/file-lock.h b/include/file-lock.h index 7ee3dfae3..084cc2c6e 100644 --- a/include/file-lock.h +++ b/include/file-lock.h @@ -53,4 +53,6 @@ extern int dump_task_file_locks(struct parasite_ctl *ctl, extern int prepare_file_locks(int pid); +#define OPT_FILE_LOCKS "file-locks" + #endif /* __FILE_LOCK_H__ */