From: Michel Normand Date: Thu, 25 Jun 2009 09:10:39 +0000 (+0200) Subject: update the help of lxc-checkpoint and lxc-restart X-Git-Tag: lxc_0_6_3~39 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47ad75f88da3a68347a709f5474289311d6c0ff9;p=thirdparty%2Flxc.git update the help of lxc-checkpoint and lxc-restart Update the checkpoint and restart regarding the statefile parameter. Signed-off-by: Michel Normand Signed-off-by: Daniel Lezcano --- diff --git a/src/lxc/lxc_checkpoint.c b/src/lxc/lxc_checkpoint.c index 0ca35fb93..2fe9f51da 100644 --- a/src/lxc/lxc_checkpoint.c +++ b/src/lxc/lxc_checkpoint.c @@ -62,15 +62,15 @@ static const struct option my_longopts[] = { static struct lxc_arguments my_args = { .progname = "lxc-checkpoint", .help = "\ ---name=NAME STATEFILE\n\ +--name=NAME --directory STATEFILE\n\ \n\ -lxc-checkpoint checkpoints in STATEFILE file the NAME container\n\ +lxc-checkpoint checkpoints in STATEFILE the NAME container\n\ \n\ Options :\n\ -n, --name=NAME NAME for name of the container\n\ -k, --kill stop the container after 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, .parser = my_parser, diff --git a/src/lxc/lxc_restart.c b/src/lxc/lxc_restart.c index f8b4ce63c..9f4bb1dbc 100644 --- a/src/lxc/lxc_restart.c +++ b/src/lxc/lxc_restart.c @@ -30,29 +30,42 @@ static int my_checker(const struct lxc_arguments* args) { - if (!args->argc) { - lxc_error(args, "missing STATEFILE filename !"); + if (!args->statefile) { + lxc_error(args, "no statefile specified"); return -1; } 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[] = { + {"directory", required_argument, 0, 'd'}, LXC_COMMON_OPTIONS }; static struct lxc_arguments my_args = { .progname = "lxc-restart", .help = "\ ---name=NAME STATEFILE\n\ +--name=NAME --directory STATEFILE\n\ \n\ -lxc-restart restarts from STATEFILE file the NAME container\n\ +lxc-restart restarts from STATEFILE the NAME container\n\ \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, - .parser = NULL, + .parser = my_parser, .checker = my_checker, };