diff options
Diffstat (limited to 'cli/src')
| -rw-r--r-- | cli/src/cli-rpc-ops.c | 7 | ||||
| -rw-r--r-- | cli/src/cli-xml-output.c | 12 | 
2 files changed, 19 insertions, 0 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index 00919d2c7a7..b8a19243159 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; diff --git a/cli/src/cli-xml-output.c b/cli/src/cli-xml-output.c index 443449287ba..dbc8aa7b848 100644 --- a/cli/src/cli-xml-output.c +++ b/cli/src/cli-xml-output.c @@ -2551,6 +2551,7 @@ cli_xml_output_vol_info (cli_local_t *local, dict_t *dict)          int                     stripe_count = 0;          int                     replica_count = 0;          int                     arbiter_count = 0; +        int                     snap_count    = 0;          int                     isArbiter = 0;          int                     disperse_count = 0;          int                     redundancy_count = 0; @@ -2631,6 +2632,17 @@ cli_xml_output_vol_info (cli_local_t *local, dict_t *dict)                  XML_RET_CHECK_AND_GOTO (ret, out);                  memset (key, 0, sizeof (key)); +                snprintf (key, sizeof (key), "volume%d.snap_count", i); +                ret = dict_get_int32 (dict, key, &snap_count); +                if (ret) +                        goto out; +                ret = xmlTextWriterWriteFormatElement (local->writer, +                                                     (xmlChar *)"snapshotCount", +                                                     "%d", snap_count); +                XML_RET_CHECK_AND_GOTO (ret, out); + + +                memset (key, 0, sizeof (key));                  snprintf (key, sizeof (key), "volume%d.brick_count", i);                  ret = dict_get_int32 (dict, key, &brick_count);                  if (ret)  | 
