From 8c89a5ffc9d1a9aa6a52a915cdd988c40aececb7 Mon Sep 17 00:00:00 2001 From: Avra Sengupta Date: Wed, 9 Oct 2013 22:13:34 +0530 Subject: glusterd/locks: Adding multiple volume locks supports Also linking snap create command to mgmt_v3 Change-Id: If2ed29be072e10d0b0bd271d53e48eeaa6501ed7 Signed-off-by: Avra Sengupta --- cli/src/cli-cmd-parser.c | 30 ++++++++++-------------------- 1 file changed, 10 insertions(+), 20 deletions(-) (limited to 'cli/src') diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c index 3d8ec5d8f..87d29972b 100644 --- a/cli/src/cli-cmd-parser.c +++ b/cli/src/cli-cmd-parser.c @@ -2899,29 +2899,19 @@ cli_snap_create_parse (dict_t *dict, const char **words, int wordcount, goto out; } - /* Only one volume is present. volname - * should be set and not volname%d. */ - if (volcount == 1) { - ret = dict_set_str (dict, "volname", (char *)words[2]); + /* Saving the volume names */ + for (i = 2; i < volcount + 2; i++) { + ret = snprintf (volname_buf, sizeof(volname_buf) - 1, + "volname%d", i - 1); + volname_buf[ret] = '\0'; + + ret = dict_set_str (dict, volname_buf, + (char *)words[i]); if (ret) { - gf_log ("", GF_LOG_ERROR, "Unable to save volname"); + gf_log ("", GF_LOG_ERROR, "Unable to save %s", + volname_buf); goto out; } - } else { - /* Saving the volume names */ - for (i = 2; i < volcount + 2; i++) { - ret = snprintf (volname_buf, sizeof(volname_buf) - 1, - "volname%d", i - 1); - volname_buf[ret] = '\0'; - - ret = dict_set_str (dict, volname_buf, - (char *)words[i]); - if (ret) { - gf_log ("", GF_LOG_ERROR, "Unable to save %s", - volname_buf); - goto out; - } - } } /* Saving the volcount */ -- cgit