/build-aux/

ll cases as published by the Free Software Foundation. */ #include #include #include #include #include #ifndef _CONFIG_H #define _CONFIG_H #include "config.h" #endif #include "cli.h" #include "cli-cmd.h" #include "cli-mem-types.h" extern rpc_clnt_prog_t *cli_rpc_prog; int cli_cmd_snapshot_help_cbk (struct cli_state *state, struct cli_cmd_word *in_word, const char **words, int wordcount); int cli_cmd_snapshot_cbk (struct cli_state *state, struct cli_cmd_word *word, const char **words, int wordcount) { int ret = 0; int parse_err = 0; dict_t *options = NULL; rpc_clnt_procedure_t *proc = NULL; call_frame_t *frame = NULL; cli_local_t *local = NULL; proc = &cli_rpc_prog->proctable [GLUSTER_CLI_SNAP]; if (proc == NULL) { ret = -1; goto out; } frame = create_frame (THIS, THIS->ctx->pool); if (frame == NULL) { ret = -1; goto out; } /* Parses the command entered by the user */ ret = cli_cmd_snapshot_parse (words, wordcount, &options, state); if (ret) { if (ret < 0) { cli_usage_out (word->pattern); parse_err = 1; } else { /* User might have cancelled the snapshot operation */ ret = 0; } goto out; } CLI_LOCAL_INIT (local, words, frame, options); if (proc->fn) ret = proc->fn (frame, THIS, options); out: if (ret && parse_err == 0) cli_out ("Snapshot command failed"); CLI_STACK_DESTROY (frame); return ret; } struct cli_cmd snapshot_cmds[] = { { "snapshot help", cli_cmd_snapshot_help_cbk, "display help for snapshot commands" }, { "snapshot create [no-timestamp] " "[description ] [force]", cli_cmd_snapshot_cbk, "Snapshot Create." }, { "snapshot clone ", cli_cmd_snapshot_cbk, "Snapshot Clone." }, { "snapshot restore ", cli_cmd_snapshot_cbk, "Snapshot Restore." }, { "snapshot status [(snapname | volume )]", cli_cmd_snapshot_cbk, "Snapshot Status." }, { "snapshot info [(snapname | volume )]", cli_cmd_snapshot_cbk, "Snapshot Info." }, { "snapshot list [volname]", cli_cmd_snapshot_cbk, "Snapshot List." }, {"snapshot config [volname] ([snap-max-hard-limit ] " "[snap-max-soft-limit ]) " "| ([auto-delete ])" "| ([activate-on-create ])", cli_cmd_snapshot_cbk, "Snapshot Config." }, {"snapshot delete (all | snapname | volume )", cli_cmd_snapshot_cbk, "Snapshot Delete." }, {"snapsh