summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVijay Bellur <vijay@gluster.com>2010-09-08 13:37:52 +0000
committerVijay Bellur <vijay@dev.gluster.com>2010-09-08 12:20:52 -0700
commit9b226cc588eafd4932f2ade1c4e9280f4eca39bf (patch)
tree3da6149b6a66dd495f46baa28b21f83936ac3409
parentdcb434eb13996bb15ab1088fb445315faa3f8ead (diff)
mgmt/glusterd: Send volume-id during volume exchangev3.1.0qa19
Signed-off-by: Vijay Bellur <vijay@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 1480 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1480
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index cfa4a7dc4d7..d078b00c98e 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -1096,6 +1096,8 @@ glusterd_add_volume_to_dict (glusterd_volinfo_t *volinfo,
char key[512] = {0,};
glusterd_brickinfo_t *brickinfo = NULL;
int32_t i = 1;
+ char uuid_str[50] = {0,};
+ char *volume_id_str = NULL;
GF_ASSERT (dict);
GF_ASSERT (volinfo);
@@ -1141,6 +1143,17 @@ glusterd_add_volume_to_dict (glusterd_volinfo_t *volinfo,
if (ret)
goto out;
+ uuid_unparse (volinfo->volume_id, uuid_str);
+ volume_id_str = gf_strdup (uuid_str);
+ if (!volume_id_str)
+ goto out;
+
+ memset (&key, 0, sizeof (key));
+ snprintf (key, 256, "volume%d.volume_id", count);
+ ret = dict_set_dynstr (dict, key, volume_id_str);
+ if (ret)
+ goto out;
+
list_for_each_entry (brickinfo, &volinfo->bricks, brick_list) {
memset (&key, 0, sizeof (key));
snprintf (key, sizeof (key), "volume%d.brick%d.hostname",
@@ -1289,6 +1302,7 @@ glusterd_import_friend_volume (dict_t *vols, int count)
glusterd_brickinfo_t *tmp = NULL;
int new_volinfo = 0;
int i = 1;
+ char *volume_id_str = NULL;
GF_ASSERT (vols);
@@ -1346,6 +1360,13 @@ glusterd_import_friend_volume (dict_t *vols, int count)
if (ret)
goto out;
+ memset (&key, 0, sizeof (key));
+ snprintf (key, sizeof (key), "volume%d.volume_id", count);
+ ret = dict_get_str (vols, key, &volume_id_str);
+ if (ret)
+ goto out;
+ uuid_parse (volume_id_str, volinfo->volume_id);
+
list_for_each_entry_safe (brickinfo, tmp, &volinfo->bricks,
brick_list) {
ret = glusterd_brickinfo_delete (brickinfo);