summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-op-sm.c
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2010-09-06 11:45:31 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-09-06 11:13:41 -0700
commite3a44226b3ed746260c4f3cf30d2f9f930fb7349 (patch)
treef937a9667249bd25ea1c7215e8d79d85b4031fbc /xlators/mgmt/glusterd/src/glusterd-op-sm.c
parentd38b2217393c460937505f30bd61576e7957f877 (diff)
mgmt/glusterd: volume to have 'uuid'
Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1548 (nfs should be able to get different uuid for different subvolumes) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1548
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-op-sm.c47
1 files changed, 29 insertions, 18 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
index 9dbd90f7641..f77e5ab3ba5 100644
--- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c
+++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c
@@ -975,22 +975,23 @@ out:
static int
glusterd_op_create_volume (gd1_mgmt_stage_op_req *req)
{
- int ret = 0;
- dict_t *dict = NULL;
- char *volname = NULL;
- glusterd_conf_t *priv = NULL;
- glusterd_volinfo_t *volinfo = NULL;
- glusterd_brickinfo_t *brickinfo = NULL;
- xlator_t *this = NULL;
- char *brick = NULL;
- int32_t count = 0;
- int32_t i = 1;
- char *bricks = NULL;
- char *brick_list = NULL;
- char *free_ptr = NULL;
- char *saveptr = NULL;
- int32_t sub_count = 0;
- char *trans_type = NULL;
+ int ret = 0;
+ dict_t *dict = NULL;
+ char *volname = NULL;
+ glusterd_conf_t *priv = NULL;
+ glusterd_volinfo_t *volinfo = NULL;
+ glusterd_brickinfo_t *brickinfo = NULL;
+ xlator_t *this = NULL;
+ char *brick = NULL;
+ int32_t count = 0;
+ int32_t i = 1;
+ char *bricks = NULL;
+ char *brick_list = NULL;
+ char *free_ptr = NULL;
+ char *saveptr = NULL;
+ int32_t sub_count = 0;
+ char *trans_type = NULL;
+ char *str = NULL;
GF_ASSERT (req);
@@ -1072,14 +1073,24 @@ glusterd_op_create_volume (gd1_mgmt_stage_op_req *req)
goto out;
}
- if (strcasecmp (trans_type, "rdma") == 0) {
+ ret = dict_get_str (dict, "volume-id", &str);
+ if (ret) {
+ gf_log ("", GF_LOG_ERROR, "Unable to get volume-id");
+ goto out;
+ }
+ ret = uuid_parse (str, volinfo->volume_id);
+ if (ret) {
+ gf_log ("", GF_LOG_ERROR, "unable to parse uuid %s", str);
+ goto out;
+ }
+
+ if (strcasecmp (trans_type, "rdma") == 0) {
volinfo->transport_type = GF_TRANSPORT_RDMA;
} else {
volinfo->transport_type = GF_TRANSPORT_TCP;
}
volinfo->sub_count = sub_count;
-
if (bricks) {
brick_list = gf_strdup (bricks);
free_ptr = brick_list;