summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-rpc-ops.c
diff options
context:
space:
mode:
authorvmallika <vmallika@redhat.com>2014-10-28 12:25:43 +0530
committerKaushal M <kaushal@redhat.com>2014-11-12 04:36:11 -0800
commit4fa4b7f2c2b57d1055adb76e8258b0db176bc356 (patch)
treee4beb4567c57370b8622f19746721e2a0b0f96f1 /cli/src/cli-rpc-ops.c
parent55aa4b185561edd7b3d1ab77a4f29a4facfdd7ff (diff)
glusterd/snapshot: Snapshot should be deactivated when it is created
By default snapshot should be deactivated and this should be a configurable option. This behaviour can be configured by the command below: gluster snapshot config activate-on-create <enable|disable> Change-Id: I1911595c32beed43bb2fca4bf99f0d264b422513 BUG: 1157991 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/8985 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Avra Sengupta <asengupt@redhat.com> Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
Diffstat (limited to 'cli/src/cli-rpc-ops.c')
-rw-r--r--cli/src/cli-rpc-ops.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index e9db57259b2..08f51558506 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -7808,6 +7808,7 @@ cli_snapshot_config_display (dict_t *dict, gf_cli_rsp *rsp)
uint64_t i = 0;
uint64_t voldisplaycount = 0;
char *auto_delete = NULL;
+ char *snap_activate = NULL;
GF_ASSERT (dict);
GF_ASSERT (rsp);
@@ -7839,9 +7840,11 @@ cli_snapshot_config_display (dict_t *dict, gf_cli_rsp *rsp)
ret = dict_get_str (dict, "auto-delete", &auto_delete);
+ ret = dict_get_str (dict, "snap-activate-on-create", &snap_activate);
+
if (!hard_limit && !soft_limit
&& config_command != GF_SNAP_CONFIG_DISPLAY
- && !auto_delete) {
+ && !auto_delete && !snap_activate) {
ret = -1;
gf_log(THIS->name, GF_LOG_ERROR,
"Could not fetch config-key");
@@ -7865,6 +7868,9 @@ cli_snapshot_config_display (dict_t *dict, gf_cli_rsp *rsp)
} else if (auto_delete) {
cli_out ("snapshot config: auto-delete "
"successfully set");
+ } else if (snap_activate) {
+ cli_out ("snapshot config: activate-on-create "
+ "successfully set");
}
break;
@@ -7891,7 +7897,9 @@ cli_snapshot_config_display (dict_t *dict, gf_cli_rsp *rsp)
cli_out ("snap-max-soft-limit : %"PRIu64"%%",
soft_limit);
- cli_out ("auto-delete : %s\n", auto_delete);
+ cli_out ("auto-delete : %s", auto_delete);
+
+ cli_out ("activate-on-create : %s\n", snap_activate);
cli_out ("Snapshot Volume Configuration:");