summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendra@redhat.com>2013-10-24 18:55:27 +0530
committershishir gowda <sgowda@redhat.com>2013-11-15 14:41:32 +0530
commit4978e0a150eea2bb98e6accd28a41d857957fca0 (patch)
tree69bfa2c587657130a868dd481369d4117e563fba
parent02157e7d4f31459f76cfb412099f49e851d76ebc (diff)
mgmt/glusterd: changes to create consistency group out of volumes
* Also send the proper error back to cli incase of any failure * Before taking the snap check whether a snap with the requested name already exists. Change-Id: I0830b31b1f095dd1d3d968c4f8b3cf46dc32d259 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com>
-rw-r--r--cli/src/cli-rpc-ops.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index e881e18..fdac003 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -498,6 +498,9 @@ gf_cli_get_volume_cbk (struct rpc_req *req, struct iovec *iov,
gf_cli_rsp rsp = {0};
char *caps = NULL;
int k __attribute__((unused)) = 0;
+ // snap_volume variable helps in showing whether a volume is a normal
+ //volume or a volume for the snapshot
+ int32_t snap_volume = 0;
if (-1 == req->rpc_status)
goto out;
@@ -619,6 +622,11 @@ xml_output:
if (ret)
goto out;
+ snprintf (key, sizeof (key), "volume%d.snap_volume", i);
+ ret = dict_get_int32 (dict, key, &snap_volume);
+ if (ret)
+ goto out;
+
snprintf (key, 256, "volume%d.brick_count", i);
ret = dict_get_int32 (dict, key, &brick_count);
if (ret)
@@ -659,6 +667,10 @@ xml_output:
cli_out ("Type: %s", cli_vol_type_str[vol_type]);
cli_out ("Volume ID: %s", volume_id_str);
cli_out ("Status: %s", cli_vol_status_str[status]);
+ if (snap_volume)
+ cli_out ("Snap Volume: %s", "yes");
+ else
+ cli_out ("Snap Volume: %s", "no");
#ifdef HAVE_BD_XLATOR
k = 0;