summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-rpc-ops.c
diff options
context:
space:
mode:
authorAvra Sengupta <asengupt@redhat.com>2016-07-27 16:28:44 +0530
committerRajesh Joseph <rjoseph@redhat.com>2016-08-23 00:06:28 -0700
commit1df4a89de17e44c8c1f9b4794a7b8c2741f2bc2e (patch)
treeb3b14bf438c454a11b58e4f5951b684b610b46fd /cli/src/cli-rpc-ops.c
parent413594ed647400f1b39e05d4f1b12ad846e48800 (diff)
snapshot: Display number of snapshots in volume info
Display number of snapshots in a volume in volume info output. This number gets modified, with create, delete, and restore operations. Change-Id: Ic9b7c2b6950980f8ce75ca362998c097ea7c863d BUG: 1360693 Signed-off-by: Avra Sengupta <asengupt@redhat.com> Reviewed-on: http://review.gluster.org/15029 Smoke: Gluster Build System <jenkins@build.gluster.org> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Diffstat (limited to 'cli/src/cli-rpc-ops.c')
-rw-r--r--cli/src/cli-rpc-ops.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index 3ea918a8cba..0bf03bceaa2 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -780,6 +780,7 @@ gf_cli_get_volume_cbk (struct rpc_req *req, struct iovec *iov,
int32_t disperse_count = 0;
int32_t redundancy_count = 0;
int32_t arbiter_count = 0;
+ int32_t snap_count = 0;
int32_t vol_type = 0;
int32_t transport = 0;
char *volume_id_str = NULL;
@@ -967,6 +968,11 @@ xml_output:
if (ret)
goto out;
+ snprintf (key, 256, "volume%d.snap_count", i);
+ ret = dict_get_int32 (dict, key, &snap_count);
+ if (ret)
+ goto out;
+
vol_type = type;
// Distributed (stripe/replicate/stripe-replica) setups
@@ -978,6 +984,7 @@ 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]);
+ cli_out ("Snapshot Count: %d", snap_count);
#ifdef HAVE_BD_XLATOR
k = 0;