diff options
author | Vijay Bellur <vijay@gluster.com> | 2010-09-04 12:49:16 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-09-05 06:27:24 -0700 |
commit | dba7332557fa0e8169c980b67a0f60a50f99bcf8 (patch) | |
tree | 2e222cc66430870d1237906c55590ca9f0f64351 /cli/src/cli-cmd-volume.c | |
parent | 461dc0ce08d1deb6a9314e118bb511894d5390c8 (diff) |
cli: Add support for GET volume
Signed-off-by: Vijay Bellur <vijay@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 971 (dynamic volume management)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=971
Diffstat (limited to 'cli/src/cli-cmd-volume.c')
-rw-r--r-- | cli/src/cli-cmd-volume.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c index 34651ae16..d28207689 100644 --- a/cli/src/cli-cmd-volume.c +++ b/cli/src/cli-cmd-volume.c @@ -85,6 +85,14 @@ cli_cmd_volume_info_cbk (struct cli_state *state, struct cli_cmd_word *word, !strcmp (words[2], "all"))) { ctx.flags = GF_CLI_GET_NEXT_VOLUME; proc = &cli_rpc_prog->proctable[GF1_CLI_GET_NEXT_VOLUME]; + } else if (wordcount == 3) { + ctx.flags = GF_CLI_GET_VOLUME; + ctx.volname = (char *)words[2]; + if (strlen (ctx.volname) > 1024) { + cli_out ("Invalid volume name"); + goto out; + } + proc = &cli_rpc_prog->proctable[GF1_CLI_GET_VOLUME]; } local = cli_local_get (); @@ -93,6 +101,8 @@ cli_cmd_volume_info_cbk (struct cli_state *state, struct cli_cmd_word *word, goto out; local->u.get_vol.flags = ctx.flags; + if (ctx.volname) + local->u.get_vol.volname = gf_strdup (ctx.volname); frame->local = local; |