Blob Blame History Raw
From bb2084b4f610f56e6b45699ff34fea57f5dad50c Mon Sep 17 00:00:00 2001
From: Atin Mukherjee <amukherj@redhat.com>
Date: Fri, 15 Sep 2017 19:01:53 +0530
Subject: [PATCH 618/620] events : Add brick list in EVENT_VOLUME_CREATE

>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>

Change-Id: Ibf87ae5ca57f9d27c036f329a30c8f81b51c52bf
BUG: 1492077
Signed-off-by: Atin Mukherjee <amukherj@redhat.com>
Reviewed-on: https://code.engineering.redhat.com/gerrit/118559
---
 cli/src/cli-cmd-parser.c | 4 ++--
 cli/src/cli-cmd-volume.c | 7 +++++--
 cli/src/cli.h            | 2 +-
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index 71af744..12717cd 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;
@@ -736,7 +736,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 fac678a..3ec39fd 100644
--- a/cli/src/cli-cmd-volume.c
+++ b/cli/src/cli-cmd-volume.c
@@ -200,6 +200,7 @@ cli_cmd_volume_create_cbk (struct cli_state *state, struct cli_cmd_word *word,
         int32_t                 type = GF_CLUSTER_TYPE_NONE;
         cli_local_t             *local = NULL;
         char                    *trans_type = NULL;
+        char                    *bricks = NULL;
 
         proc = &cli_rpc_prog->proctable[GLUSTER_CLI_CREATE_VOLUME];
 
@@ -207,7 +208,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);
@@ -245,7 +247,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 d271a8d..fa3cf88 100644
--- a/cli/src/cli.h
+++ b/cli/src/cli.h
@@ -237,7 +237,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);
-- 
1.8.3.1