summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-xml-output.c
diff options
context:
space:
mode:
Diffstat (limited to 'cli/src/cli-xml-output.c')
-rw-r--r--cli/src/cli-xml-output.c27
1 files changed, 23 insertions, 4 deletions
diff --git a/cli/src/cli-xml-output.c b/cli/src/cli-xml-output.c
index d0a72772085..90b184d9f3f 100644
--- a/cli/src/cli-xml-output.c
+++ b/cli/src/cli-xml-output.c
@@ -5164,7 +5164,7 @@ cli_xml_snapshot_config_show (xmlTextWriterPtr writer,
ret = dict_get_str (dict, "auto-delete", &str_value);
if (ret) {
- gf_log ("cli", GF_LOG_ERROR, "Could not fetch auto-delet");
+ gf_log ("cli", GF_LOG_ERROR, "Could not fetch auto-delete");
goto out;
}
@@ -5172,6 +5172,17 @@ cli_xml_snapshot_config_show (xmlTextWriterPtr writer,
(xmlChar *) "autoDelete", "%s", str_value);
XML_RET_CHECK_AND_GOTO (ret, out);
+ ret = dict_get_str (dict, "snap-activate-on-create", &str_value);
+ if (ret) {
+ gf_log ("cli", GF_LOG_ERROR,
+ "Could not fetch snap-activate-on-create-delete");
+ goto out;
+ }
+
+ ret = xmlTextWriterWriteFormatElement (writer,
+ (xmlChar *) "activateOnCreate", "%s", str_value);
+ XML_RET_CHECK_AND_GOTO (ret, out);
+
/* </systemConfig> */
ret = xmlTextWriterEndElement (writer);
XML_RET_CHECK_AND_GOTO (ret, out);
@@ -5275,6 +5286,7 @@ cli_xml_snapshot_config_set (xmlTextWriterPtr writer, xmlDocPtr doc,
uint64_t soft_limit = 0;
char *volname = NULL;
char *auto_delete = NULL;
+ char *snap_activate = NULL;
GF_ASSERT (writer);
GF_ASSERT (doc);
@@ -5285,12 +5297,13 @@ cli_xml_snapshot_config_set (xmlTextWriterPtr writer, xmlDocPtr doc,
/* This is optional parameter therefore ignore the error */
ret = dict_get_uint64 (dict, "snap-max-soft-limit", &soft_limit);
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 && !auto_delete) {
+ if (!hard_limit && !soft_limit && !auto_delete && !snap_activate) {
ret = -1;
gf_log ("cli", GF_LOG_ERROR, "At least one option from "
- "snap-max-hard-limit, snap-max-soft-limit and "
- "auto-delete should be set");
+ "snap-max-hard-limit, snap-max-soft-limit, auto-delete"
+ " and snap-activate-on-create should be set");
goto out;
}
@@ -5333,6 +5346,12 @@ cli_xml_snapshot_config_set (xmlTextWriterPtr writer, xmlDocPtr doc,
XML_RET_CHECK_AND_GOTO (ret, out);
}
+ if (snap_activate) {
+ ret = xmlTextWriterWriteFormatElement (writer,
+ (xmlChar *) "activateOnCreate", "%s", snap_activate);
+ XML_RET_CHECK_AND_GOTO (ret, out);
+ }
+
/* </volumeConfig> or </systemConfig> */
ret = xmlTextWriterEndElement (writer);
XML_RET_CHECK_AND_GOTO (ret, out);