diff options
author | shishir gowda <shishirng@gluster.com> | 2010-09-04 01:12:58 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-09-06 02:21:44 -0700 |
commit | 386ea89d93497f805c77773515a735a11ef67f29 (patch) | |
tree | f9b23489dbebf33754645e27dbf5f94745aaf15a /xlators/mgmt/glusterd/src/glusterd-store.c | |
parent | 4309c9b0d658185b1b7f07a98240b85870d35204 (diff) |
Create volume adding transport type option rdma
Adding transport type option to cli volume create command.
This is optional, and defaults to TCP. The other transport
supported is rdma
Signed-off-by: shishir gowda <shishirng@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 1507 (need to add 'transport <type>' options to create brick)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1507
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-store.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-store.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-store.c b/xlators/mgmt/glusterd/src/glusterd-store.c index 3072fc92110..6e7fbd3b2c0 100644 --- a/xlators/mgmt/glusterd/src/glusterd-store.c +++ b/xlators/mgmt/glusterd/src/glusterd-store.c @@ -313,6 +313,12 @@ glusterd_store_create_volume (glusterd_volinfo_t *volinfo) if (ret) goto out; + snprintf (buf, sizeof (buf), "%d", volinfo->transport_type); + ret = glusterd_store_save_value (volinfo->shandle, + GLUSTERD_STORE_KEY_VOL_TRANSPORT, buf); + if (ret) + goto out; + list_for_each_entry (brickinfo, &volinfo->bricks, brick_list) { ret = glusterd_store_create_brick (volinfo, brickinfo); if (ret) @@ -946,6 +952,9 @@ glusterd_store_retrieve_volume (char *volname) } else if (!strncmp (key, GLUSTERD_STORE_KEY_VOL_PORT, strlen (GLUSTERD_STORE_KEY_VOL_PORT))) { volinfo->port = atoi (value); + } else if (!strncmp (key, GLUSTERD_STORE_KEY_VOL_TRANSPORT, + strlen (GLUSTERD_STORE_KEY_VOL_TRANSPORT))) { + volinfo->transport_type = atoi (value); } else { gf_log ("", GF_LOG_ERROR, "Unknown key: %s", key); @@ -1067,6 +1076,11 @@ glusterd_store_update_volume (glusterd_volinfo_t *volinfo) if (ret) goto out; + snprintf (buf, sizeof (buf), "%d", volinfo->transport_type); + ret = glusterd_store_save_value (volinfo->shandle, + GLUSTERD_STORE_KEY_VOL_TRANSPORT, buf); + if (ret) + goto out; list_for_each_entry (brickinfo, &volinfo->bricks, brick_list) { ret = glusterd_store_create_brick (volinfo, brickinfo); |