summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-snapshot.c
diff options
context:
space:
mode:
authorAvra Sengupta <asengupt@redhat.com>2014-01-02 06:52:08 +0000
committerAvra Sengupta <asengupt@redhat.com>2014-01-09 01:00:31 +0000
commit847e14ccbaddd5d1f06f9200cba063ee007199ad (patch)
tree36670d1337f2c0412fe6685335fb7a057f955837 /xlators/mgmt/glusterd/src/glusterd-snapshot.c
parentade2e39f33c833dcf9811f46fca4c6f443b0f09b (diff)
glusterd: Pass generated snap-name/cg-name to cli.
Also block operation on response aggregation errors. Change-Id: I641ddc98d986fd44627d790ab84488a6b849f807 BUG: 1043792 Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-snapshot.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-snapshot.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
index 1f6930718..8386b44c5 100644
--- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c
+++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
@@ -3999,13 +3999,40 @@ glusterd_snapshot_create_commit (dict_t *dict, char **op_errstr,
gf_log (this->name, GF_LOG_ERROR, "Unable to fetch snap-name");
goto out;
}
+ tmp = gf_strdup (name);
+ if (!tmp) {
+ gf_log (this->name, GF_LOG_ERROR, "Out of memory");
+ goto out;
+ }
+
+ ret = dict_set_dynstr (rsp_dict, "snap-name", tmp);
+ if (ret) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "Unable to set snap-name in rsp_dict");
+ GF_FREE (tmp);
+ goto out;
+ }
} else {
ret = dict_get_str (dict, "cg-name", &name);
if (ret) {
gf_log (this->name, GF_LOG_ERROR, "Unable to fetch cg-name");
goto out;
}
+ tmp = gf_strdup (name);
+ if (!tmp) {
+ gf_log (this->name, GF_LOG_ERROR, "Out of memory");
+ goto out;
+ }
+
+ ret = dict_set_str (rsp_dict, "cg-name", tmp);
+ if (ret) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "Unable to set cg-name in rsp_dict");
+ GF_FREE (tmp);
+ goto out;
+ }
}
+ tmp = NULL;
ret = dict_get_bin (dict, "cg-id", (void **)&cg_id);
if (ret)