summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorKaushal M <kaushal@redhat.com>2014-07-23 18:08:08 +0530
committerKaushal M <kaushal@redhat.com>2014-07-24 03:04:38 -0700
commit6328019bd197efa25294194acaf946557d84f9fb (patch)
tree24d6b2d892ef9f6f8fbe7cb72fdf344529a2cb63 /cli
parent00bcf8e80bd65de7a8a102b137d35af3ba2cc3c1 (diff)
cli: Fix no libxml compilation for snapshot status
BUG: 1122186 Change-Id: Ib887f2194258e85d40f65a758b6a963a17911395 Signed-off-by: Kaushal M <kaushal@redhat.com> Reviewed-on: http://review.gluster.org/8363 Reviewed-by: Rajesh Joseph <rjoseph@redhat.com> Reviewed-by: Santosh Pradhan <spradhan@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com>
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-rpc-ops.c4
-rw-r--r--cli/src/cli-xml-output.c23
-rw-r--r--cli/src/cli.h6
3 files changed, 26 insertions, 7 deletions
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index d195db5f6e0..4044f0e741c 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -8568,9 +8568,7 @@ cli_snapshot_status (dict_t *dict, gf_cli_rsp *rsp,
}
if (global_state->mode & GLUSTER_MODE_XML) {
- ret = cli_xml_snapshot_status_per_snap (local->writer,
- local->doc,
- dict, key);
+ ret = cli_xml_snapshot_status_single_snap (local, dict, key);
if (ret) {
gf_log ("cli", GF_LOG_ERROR, "Failed to create "
"xml output for snapshot status");
diff --git a/cli/src/cli-xml-output.c b/cli/src/cli-xml-output.c
index 6ce8041f657..65189a8088f 100644
--- a/cli/src/cli-xml-output.c
+++ b/cli/src/cli-xml-output.c
@@ -4820,7 +4820,7 @@ out:
*
* @return 0 on success and -1 on failure
*/
-int
+static int
cli_xml_snapshot_status_per_snap (xmlTextWriterPtr writer, xmlDocPtr doc,
dict_t *dict, const char *keyprefix)
{
@@ -5527,3 +5527,24 @@ out:
return 0;
#endif /* HAVE_LIB_XML */
}
+
+int
+cli_xml_snapshot_status_single_snap (cli_local_t *local, dict_t *dict,
+ char *key)
+{
+#if (HAVE_LIB_XML)
+ int ret = -1;
+
+ GF_VALIDATE_OR_GOTO ("cli", (local != NULL), out);
+ GF_VALIDATE_OR_GOTO ("cli", (dict != NULL), out);
+ GF_VALIDATE_OR_GOTO ("cli", (key != NULL), out);
+
+ ret = cli_xml_snapshot_status_per_snap (local->writer, local->doc, dict,
+ key);
+out:
+ return ret;
+#else
+ return 0;
+#endif /* HAVE_LIB_XML */
+}
+
diff --git a/cli/src/cli.h b/cli/src/cli.h
index 74d35992680..590c8b14f60 100644
--- a/cli/src/cli.h
+++ b/cli/src/cli.h
@@ -394,11 +394,11 @@ cli_xml_output_snap_status_begin (cli_local_t *local, int op_ret, int op_errno,
int
cli_xml_output_snap_status_end (cli_local_t *local);
int
-cli_xml_snapshot_status_per_snap (xmlTextWriterPtr writer, xmlDocPtr doc,
- dict_t *dict, const char *keyprefix);
-int
cli_xml_output_snapshot (int cmd_type, dict_t *dict, int op_ret,
int op_errno, char *op_errstr);
+int
+cli_xml_snapshot_status_single_snap (cli_local_t *local, dict_t *dict,
+ char *key);
char *
is_server_debug_xlator (void *myframe);