diff options
| author | vmallika <vmallika@redhat.com> | 2014-10-28 12:25:43 +0530 |
|---|---|---|
| committer | Raghavendra Bhat <raghavendra@redhat.com> | 2014-12-18 22:52:22 -0800 |
| commit | df0ff94a64bd597e61f26a2a56297de7abf80a0f (patch) | |
| tree | 163dfd82065add6b19ab32a1599dfb389d49911a /cli/src/cli-rpc-ops.c | |
| parent | f0a90bf48135c480c41a71ef25f46619001a3116 (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: 1170921
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>
Signed-off-by: Sachin Pandit <spandit@redhat.com>
Reviewed-on: http://review.gluster.org/9241
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Diffstat (limited to 'cli/src/cli-rpc-ops.c')
| -rw-r--r-- | cli/src/cli-rpc-ops.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c index bb5e3b56378..f194a76efb4 100644 --- a/cli/src/cli-rpc-ops.c +++ b/cli/src/cli-rpc-ops.c @@ -7792,6 +7792,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); @@ -7823,9 +7824,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"); @@ -7849,6 +7852,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; @@ -7875,7 +7881,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:"); |
