summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-xml-output.c
diff options
context:
space:
mode:
authorGaurav Kumar Garg <ggarg@redhat.com>2015-03-27 15:20:03 +0530
committerKaushal M <kaushal@redhat.com>2015-05-07 00:06:23 -0700
commit07e3f407b311c80e3437b1f650cae62f814d995b (patch)
tree41094414501c4140098eb20cf1d31abc261e550d /cli/src/cli-xml-output.c
parent84a0baabfb9aa29348d8b17b7517870d46023ab3 (diff)
glusterd: remove replace brick with data migration support form cli/glusterd
Replace-brick operation with data migration support have been deprecated from gluster. With this fix replace brick command will support only one commad gluster volume replace-brick <VOLNAME> <SOURCE-BRICK> <NEW-BRICK> {commit force} Change-Id: Ib81d49e5d8e7eaa4ccb5830cfec2bc081191b43b BUG: 1094119 Signed-off-by: Gaurav Kumar Garg <ggarg@redhat.com> Reviewed-on: http://review.gluster.org/10101 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
Diffstat (limited to 'cli/src/cli-xml-output.c')
-rw-r--r--cli/src/cli-xml-output.c106
1 files changed, 2 insertions, 104 deletions
diff --git a/cli/src/cli-xml-output.c b/cli/src/cli-xml-output.c
index d7322d5bb0d..f9013ed2726 100644
--- a/cli/src/cli-xml-output.c
+++ b/cli/src/cli-xml-output.c
@@ -1480,46 +1480,6 @@ out:
}
int
-cli_xml_output_replace_brick_task_params (xmlTextWriterPtr writer, dict_t *dict,
- char *prefix)
-{
-
- int ret = -1;
- char key[1024] = {0,};
- char *brick = NULL;
-
- /* <params> */
- ret = xmlTextWriterStartElement (writer, (xmlChar *)"params");
- XML_RET_CHECK_AND_GOTO (ret, out);
-
- snprintf (key, sizeof (key), "%s.src-brick", prefix);
- ret = dict_get_str (dict, key, &brick);
- if (ret)
- goto out;
- ret = xmlTextWriterWriteFormatElement (writer, (xmlChar *)"srcBrick",
- "%s", brick);
- XML_RET_CHECK_AND_GOTO (ret, out);
-
-
- memset (key, 0, sizeof (key));
- snprintf (key, sizeof (key), "%s.dst-brick", prefix);
- ret = dict_get_str (dict, key, &brick);
- if (ret)
- goto out;
- ret = xmlTextWriterWriteFormatElement (writer, (xmlChar *)"dstBrick",
- "%s", brick);
- XML_RET_CHECK_AND_GOTO (ret, out);
-
-
- /* </param> */
- ret = xmlTextWriterEndElement (writer);
-
-out:
- gf_log ("cli", GF_LOG_DEBUG, "Returning %d", ret);
- return ret;
-}
-
-int
cli_xml_output_vol_status_tasks (cli_local_t *local, dict_t *dict) {
int ret = -1;
char *task_type = NULL;
@@ -1573,14 +1533,6 @@ cli_xml_output_vol_status_tasks (cli_local_t *local, dict_t *dict) {
"%d", status);
XML_RET_CHECK_AND_GOTO (ret, out);
- if (!strcmp (task_type, "Replace brick")) {
- if (status) {
- status = GF_DEFRAG_STATUS_COMPLETE;
- } else {
- status = GF_DEFRAG_STATUS_STARTED;
- }
- }
-
ret = xmlTextWriterWriteFormatElement (local->writer,
(xmlChar *)"statusStr",
"%s",
@@ -1590,12 +1542,7 @@ cli_xml_output_vol_status_tasks (cli_local_t *local, dict_t *dict) {
memset (key, 0, sizeof (key));
snprintf (key, sizeof (key), "task%d", i);
- if (!strcmp (task_type, "Replace brick")) {
- ret = cli_xml_output_replace_brick_task_params
- (local->writer, dict, key);
- if (ret)
- goto out;
- } else if (!strcmp (task_type, "Remove brick")) {
+ if (!strcmp (task_type, "Remove brick")) {
ret = cli_xml_output_remove_brick_task_params
(local->writer, dict, key);
if (ret)
@@ -3476,7 +3423,7 @@ out:
}
int
-cli_xml_output_vol_replace_brick (gf1_cli_replace_op op, dict_t *dict,
+cli_xml_output_vol_replace_brick (char *op, dict_t *dict,
int op_ret, int op_errno, char *op_errstr)
{
#if (HAVE_LIB_XML)
@@ -3496,55 +3443,6 @@ cli_xml_output_vol_replace_brick (gf1_cli_replace_op op, dict_t *dict,
if (ret)
goto out;
- /* <volReplaceBrick> */
- ret = xmlTextWriterStartElement (writer, (xmlChar *)"volReplaceBrick");
- XML_RET_CHECK_AND_GOTO (ret, out);
-
- ret = dict_get_str (dict, GF_REPLACE_BRICK_TID_KEY, &task_id_str);
- if (ret == 0) {
- ret = xmlTextWriterWriteFormatElement (writer,
- (xmlChar *)"task-id",
- "%s", task_id_str);
- XML_RET_CHECK_AND_GOTO (ret, out);
- }
-
- ret = xmlTextWriterWriteFormatElement (writer, (xmlChar *)"op",
- "%d", op);
- XML_RET_CHECK_AND_GOTO (ret, out);
-
- if (GF_REPLACE_OP_STATUS == op) {
- ret = dict_get_int32 (dict, "status", &status);
- if (ret)
- goto out;
- ret = xmlTextWriterWriteFormatElement (writer,
- (xmlChar *)"status",
- "%d", status);
- XML_RET_CHECK_AND_GOTO (ret, out);
-
- ret = dict_get_uint64 (dict, "files", &files);
- if (ret)
- goto out;
- ret = xmlTextWriterWriteFormatElement (writer,
- (xmlChar *)"files",
- "%"PRIu64, files);
- XML_RET_CHECK_AND_GOTO (ret, out);
-
- if (status)
- goto cont;
-
- ret = dict_get_str (dict, "current_file", &current_file);
- if (ret)
- goto out;
- ret = xmlTextWriterWriteFormatElement (writer,
- (xmlChar *)"currentFile",
- "%s", current_file);
- XML_RET_CHECK_AND_GOTO (ret, out);
- }
-cont:
- /* </volReplaceBrick> */
- ret = xmlTextWriterEndElement (writer);
- XML_RET_CHECK_AND_GOTO (ret, out);
-
ret = cli_end_xml_output (writer, doc);
out: