summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSachin Pandit <spandit@redhat.com>2014-03-10 12:02:08 +0530
committerRajesh Joseph <rjoseph@redhat.com>2014-03-10 06:36:25 -0700
commit077afd496b2ce24b1d5aebfeb79795b68e357cdd (patch)
treeef010eb15d06b89b73832463fc5c21989b1c4de9
parent9fe1f24e42fa54b58616cd846fce76ab60d7e4e8 (diff)
glusterd/snapshot : Show volume status in snap info.
Change-Id: Ifa090b158ca23402fb6afa4f3b65fad1446f350d Signed-off-by: Sachin Pandit <spandit@redhat.com> Reviewed-on: http://review.gluster.org/7212 Reviewed-by: Vijaikumar Mallikarjuna <vmallika@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Tested-by: Rajesh Joseph <rjoseph@redhat.com>
-rw-r--r--cli/src/cli-rpc-ops.c12
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-snapshot.c6
2 files changed, 18 insertions, 0 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index 60abfc1..42e41ce 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -7786,6 +7786,18 @@ cli_get_each_volinfo_in_snap (dict_t *dict, char *keyprefix,
goto out;
}
cli_out ("%s%-12s %s", indent, "UUID:", get_buffer);
+
+ ret = snprintf (key, sizeof (key), "%s.vol-status", keyprefix);
+ if (ret < 0) {
+ goto out;
+ }
+
+ ret = dict_get_str (dict, key, &get_buffer);
+ if (ret) {
+ gf_log ("cli", GF_LOG_ERROR, "Failed to get %s", key);
+ goto out;
+ }
+ cli_out ("%s%-12s %s", indent, "Status:", get_buffer);
out :
return ret;
}
diff --git a/xlators/mgmt/glusterd/src/glusterd-snapshot.c b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
index e9b8877..8543d95 100644
--- a/xlators/mgmt/glusterd/src/glusterd-snapshot.c
+++ b/xlators/mgmt/glusterd/src/glusterd-snapshot.c
@@ -3035,6 +3035,12 @@ glusterd_do_snap_vol (glusterd_volinfo_t *origin_vol, glusterd_snap_t *snap,
}
snap_vol->status = GLUSTERD_STATUS_STARTED;
+ ret = glusterd_store_volinfo (snap_vol, GLUSTERD_VOLINFO_VER_AC_INCREMENT);
+ if (ret) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "Failed to store snap volinfo");
+ goto out;
+ }
out:
if (ret) {