diff options
Diffstat (limited to 'cli/src/cli-xml-output.c')
-rw-r--r-- | cli/src/cli-xml-output.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/cli/src/cli-xml-output.c b/cli/src/cli-xml-output.c index 66bec7ee96f..aacce140946 100644 --- a/cli/src/cli-xml-output.c +++ b/cli/src/cli-xml-output.c @@ -5156,7 +5156,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; } @@ -5164,6 +5164,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); @@ -5267,6 +5278,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); @@ -5277,12 +5289,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; } @@ -5325,6 +5338,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); |