Commit 47ad75f8 by Michel Normand Committed by Daniel Lezcano

update the help of lxc-checkpoint and lxc-restart

Update the checkpoint and restart regarding the statefile parameter. Signed-off-by: 's avatarMichel Normand <normand@fr.ibm.com> Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent 4f3f0d4b
...@@ -62,15 +62,15 @@ static const struct option my_longopts[] = { ...@@ -62,15 +62,15 @@ static const struct option my_longopts[] = {
static struct lxc_arguments my_args = { static struct lxc_arguments my_args = {
.progname = "lxc-checkpoint", .progname = "lxc-checkpoint",
.help = "\ .help = "\
--name=NAME STATEFILE\n\ --name=NAME --directory STATEFILE\n\
\n\ \n\
lxc-checkpoint checkpoints in STATEFILE file the NAME container\n\ lxc-checkpoint checkpoints in STATEFILE the NAME container\n\
\n\ \n\
Options :\n\ Options :\n\
-n, --name=NAME NAME for name of the container\n\ -n, --name=NAME NAME for name of the container\n\
-k, --kill stop the container after checkpoint\n\ -k, --kill stop the container after checkpoint\n\
-p, --pause don't unfreeze the container after the checkpoint\n\ -p, --pause don't unfreeze the container after the checkpoint\n\
-d, --directory directory to store the statefile\n", -d, --directory=STATEFILE where to store the statefile\n",
.options = my_longopts, .options = my_longopts,
.parser = my_parser, .parser = my_parser,
......
...@@ -30,29 +30,42 @@ ...@@ -30,29 +30,42 @@
static int my_checker(const struct lxc_arguments* args) static int my_checker(const struct lxc_arguments* args)
{ {
if (!args->argc) { if (!args->statefile) {
lxc_error(args, "missing STATEFILE filename !"); lxc_error(args, "no statefile specified");
return -1; return -1;
} }
return 0; return 0;
} }
static int my_parser(struct lxc_arguments* args, int c, char* arg)
{
switch (c) {
case 'd':
args->statefile = arg;
break;
}
return 0;
}
static const struct option my_longopts[] = { static const struct option my_longopts[] = {
{"directory", required_argument, 0, 'd'},
LXC_COMMON_OPTIONS LXC_COMMON_OPTIONS
}; };
static struct lxc_arguments my_args = { static struct lxc_arguments my_args = {
.progname = "lxc-restart", .progname = "lxc-restart",
.help = "\ .help = "\
--name=NAME STATEFILE\n\ --name=NAME --directory STATEFILE\n\
\n\ \n\
lxc-restart restarts from STATEFILE file the NAME container\n\ lxc-restart restarts from STATEFILE the NAME container\n\
\n\ \n\
Options :\n\ Options :\n\
-n, --name=NAME NAME for name of the container\n", -n, --name=NAME NAME for name of the container\n\
-d, --directory=STATEFILE for name of statefile\n",
.options = my_longopts, .options = my_longopts,
.parser = NULL, .parser = my_parser,
.checker = my_checker, .checker = my_checker,
}; };
......
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