From 8c7549f9094d99d679de447230edaa5040db3e92 Mon Sep 17 00:00:00 2001 From: Kaushal M Date: Mon, 5 Mar 2012 19:04:49 +0530 Subject: cli: More xml output changes * Added xml output for "volume quota" which was missing. * Fixed xml output for "volume info all" so that it contains only one xml document * Fixed no xml output for normal "volume status" * Fixed normal output for "volume set" Change-Id: I3d85b6800e428226f2970d669e38e4331c99a218 BUG: 799957 Signed-off-by: Kaushal M Reviewed-on: http://review.gluster.com/2868 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Vijay Bellur --- cli/src/cli.h | 43 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 36 insertions(+), 7 deletions(-) (limited to 'cli/src/cli.h') diff --git a/cli/src/cli.h b/cli/src/cli.h index 8080e42d6..2a24378ff 100644 --- a/cli/src/cli.h +++ b/cli/src/cli.h @@ -29,12 +29,18 @@ #include "glusterfs.h" #include "protocol-common.h" +#if (HAVE_LIB_XML) +#include +#include +#endif + #define DEFAULT_EVENT_POOL_SIZE 16384 #define CLI_GLUSTERD_PORT 24007 #define CLI_DEFAULT_CONN_TIMEOUT 120 #define CLI_DEFAULT_CMD_TIMEOUT 120 #define CLI_TOP_CMD_TIMEOUT 600 //Longer timeout for volume top #define DEFAULT_CLI_LOG_FILE_DIRECTORY DATADIR "/log/glusterfs" +#define DEFAULT_LOG_FILE_DIRECTORY DATADIR "/log/glusterfs" #define CLI_VOL_STATUS_BRICK_LEN 55 #define CLI_TAB_LENGTH 8 #define CLI_BRICK_STATUS_LINE_LEN 78 @@ -122,6 +128,11 @@ struct cli_local { } get_vol; dict_t *dict; +#if (HAVE_LIB_XML) + xmlTextWriterPtr writer; + xmlBufferPtr buf; + int vol_count; +#endif }; struct cli_volume_status { @@ -276,25 +287,43 @@ cli_print_line (int len); #if (HAVE_LIB_XML) int -cli_xml_output_str (char *op, char *str, int op_ret, int op_errno, char *op_errstr); +cli_xml_output_str (char *op, char *str, int op_ret, int op_errno, + char *op_errstr); + +int +cli_xml_output_dict (char *op, dict_t *dict, int op_ret, int op_errno, + char *op_errstr); + +int +cli_xml_output_vol_top (dict_t *dict, int op_ret, int op_errno, + char *op_errstr); + +int +cli_xml_output_vol_profile (dict_t *dict, int op_ret, int op_errno, + char *op_errstr); int -cli_xml_output_dict (char *op, dict_t *dict, int op_ret, int op_errno, char *op_errstr); +cli_xml_output_vol_status (dict_t *dict, int op_ret, int op_errno, + char *op_errstr); int -cli_xml_output_vol_top (dict_t *dict, int op_ret, int op_errno, char *op_errstr); +cli_xml_output_vol_list (dict_t *dict, int op_ret, int op_errno, + char *op_errstr); int -cli_xml_output_vol_profile (dict_t *dict, int op_ret, int op_errno, char *op_errstr); +cli_xml_output_vol_info_begin (cli_local_t *local, int op_ret, int op_errno, + char *op_errstr); int -cli_xml_output_vol_status (dict_t *dict, int op_ret, int op_errno, char *op_errstr); +cli_xml_output_vol_info_end (cli_local_t *local); int -cli_xml_output_vol_list (dict_t *dict, int op_ret, int op_errno, char *op_errstr); +cli_xml_output_vol_info (cli_local_t *local, dict_t *dict); int -cli_xml_output_vol_info (dict_t *dict, int op_ret, int op_errno, char *op_errstr); +cli_xml_output_vol_quota_limit_list (char *volname, char *limit_list, + int op_ret, int op_errno, + char *op_errstr); #endif #endif /* __CLI_H__ */ -- cgit