summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAtin Mukherjee <amukherj@redhat.com>2017-09-15 19:01:53 +0530
committerAtin Mukherjee <amukherj@redhat.com>2017-09-18 11:44:57 +0000
commitf6775423d7fbe71fe35e6154388e77aae2e264ad (patch)
tree727923d2007f3906d890e88e0a702c9528e57076
parent00a4dc058a0573d18e9c1bd3692fecee151a9285 (diff)
events : Add brick list in EVENT_VOLUME_CREATE
Change-Id: Ibf87ae5ca57f9d27c036f329a30c8f81b51c52bf BUG: 1492109 Signed-off-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-on: https://review.gluster.org/18306 Reviewed-by: Prashanth Pai <ppai@redhat.com> Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Aravinda VK <avishwan@redhat.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.org>
-rw-r--r--cli/src/cli-cmd-parser.c4
-rw-r--r--cli/src/cli-cmd-volume.c7
-rw-r--r--cli/src/cli.h2
3 files changed, 8 insertions, 5 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index 4914425698f..fef2c74f971 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -431,7 +431,7 @@ out:
int32_t
cli_cmd_volume_create_parse (struct cli_state *state, const char **words,
- int wordcount, dict_t **options)
+ int wordcount, dict_t **options, char **brick_list)
{
dict_t *dict = NULL;
char *volname = NULL;
@@ -749,7 +749,7 @@ cli_cmd_volume_create_parse (struct cli_state *state, const char **words,
goto out;
*options = dict;
-
+ *brick_list = bricks;
out:
if (ret) {
gf_log ("cli", GF_LOG_ERROR, "Unable to parse create volume CLI");
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
index c22573e6408..a7e0fc7ed03 100644
--- a/cli/src/cli-cmd-volume.c
+++ b/cli/src/cli-cmd-volume.c
@@ -196,6 +196,7 @@ cli_cmd_volume_create_cbk (struct cli_state *state, struct cli_cmd_word *word,
int parse_error = 0;
cli_local_t *local = NULL;
char *trans_type = NULL;
+ char *bricks = NULL;
proc = &cli_rpc_prog->proctable[GLUSTER_CLI_CREATE_VOLUME];
@@ -203,7 +204,8 @@ cli_cmd_volume_create_cbk (struct cli_state *state, struct cli_cmd_word *word,
if (!frame)
goto out;
- ret = cli_cmd_volume_create_parse (state, words, wordcount, &options);
+ ret = cli_cmd_volume_create_parse (state, words, wordcount, &options,
+ &bricks);
if (ret) {
cli_usage_out (word->pattern);
@@ -241,7 +243,8 @@ out:
CLI_STACK_DESTROY (frame);
if (ret == 0) {
- gf_event (EVENT_VOLUME_CREATE, "name=%s", (char *)words[2]);
+ gf_event (EVENT_VOLUME_CREATE, "name=%s;bricks=%s",
+ (char *)words[2], bricks);
}
return ret;
}
diff --git a/cli/src/cli.h b/cli/src/cli.h
index a1be2b62d06..68dcb8c531f 100644
--- a/cli/src/cli.h
+++ b/cli/src/cli.h
@@ -235,7 +235,7 @@ cli_submit_request (struct rpc_clnt *rpc, void *req, call_frame_t *frame,
int32_t
cli_cmd_volume_create_parse (struct cli_state *state, const char **words,
- int wordcount, dict_t **options);
+ int wordcount, dict_t **options, char **bricks);
int32_t
cli_cmd_volume_reset_parse (const char **words, int wordcount, dict_t **opt);