summaryrefslogtreecommitdiffstats
path: root/cli
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendra@redhat.com>2014-06-19 15:51:39 +0530
committerKaushal M <kaushal@redhat.com>2014-06-30 22:30:58 -0700
commitc6f040524d75011c44dcc9afdfef80c60c78f7f7 (patch)
tree8c1dd960693a98e07088d7026c7e98b7d8b8c8c2 /cli
parent2417de9c37d83e36567551dc682bb23f851fd2d7 (diff)
mgmt/glusterd: display snapd status as part of volume status
* Made changes to save the port used by snapd in the info file for the volume i.e. <glusterd-working-directory>/vols/<volname>/info This is how the gluster volume status of a volume would look like for which the uss feature is enabled. [root@tatooine ~]# gluster volume status vol Status of volume: vol Gluster process Port Online Pid ------------------------------------------------------------------------------ Brick tatooine:/export1/vol 49155 Y 5041 Snapshot Daemon on localhost 49156 Y 5080 NFS Server on localhost 2049 Y 5087 Task Status of Volume vol ------------------------------------------------------------------------------ There are no active volume tasks Change-Id: I8f3e5d7d764a728497c2a5279a07486317bd7c6d BUG: 1111041 Signed-off-by: Raghavendra Bhat <raghavendra@redhat.com> Reviewed-on: http://review.gluster.org/8114 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushal M <kaushal@redhat.com>
Diffstat (limited to 'cli')
-rw-r--r--cli/src/cli-cmd-parser.c13
-rw-r--r--cli/src/cli-rpc-ops.c5
2 files changed, 16 insertions, 2 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index d855dbf8a0a..1a39be8d121 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -2412,6 +2412,8 @@ cli_cmd_volume_status_parse (const char **words, int wordcount,
cmd |= GF_CLI_STATUS_SHD;
} else if (!strcmp (words[3], "quotad")) {
cmd |= GF_CLI_STATUS_QUOTAD;
+ } else if (!strcmp (words[3], "snapd")) {
+ cmd |= GF_CLI_STATUS_SNAPD;
} else {
cmd = GF_CLI_STATUS_BRICK;
ret = dict_set_str (dict, "brick",
@@ -2478,6 +2480,17 @@ cli_cmd_volume_status_parse (const char **words, int wordcount,
goto out;
}
cmd |= GF_CLI_STATUS_QUOTAD;
+ } else if (!strcmp (words[3], "snapd")) {
+ if (cmd == GF_CLI_STATUS_FD ||
+ cmd == GF_CLI_STATUS_CLIENTS ||
+ cmd == GF_CLI_STATUS_DETAIL ||
+ cmd == GF_CLI_STATUS_INODE) {
+ cli_err ("Detail/FD/Clients/Inode status not "
+ "available for snap daemon");
+ ret = -1;
+ goto out;
+ }
+ cmd |= GF_CLI_STATUS_SNAPD;
} else {
if (cmd == GF_CLI_STATUS_TASKS) {
cli_err ("Tasks status not available for "
diff --git a/cli/src/cli-rpc-ops.c b/cli/src/cli-rpc-ops.c
index c4846be2379..9d64917e3b7 100644
--- a/cli/src/cli-rpc-ops.c
+++ b/cli/src/cli-rpc-ops.c
@@ -6531,7 +6531,7 @@ gf_cli_status_cbk (struct rpc_req *req, struct iovec *iov,
}
if ((cmd & GF_CLI_STATUS_NFS) || (cmd & GF_CLI_STATUS_SHD) ||
- (cmd & GF_CLI_STATUS_QUOTAD))
+ (cmd & GF_CLI_STATUS_QUOTAD) || (cmd & GF_CLI_STATUS_SNAPD))
notbrick = _gf_true;
if (global_state->mode & GLUSTER_MODE_XML) {
@@ -6647,7 +6647,8 @@ gf_cli_status_cbk (struct rpc_req *req, struct iovec *iov,
memset (status.brick, 0, PATH_MAX + 255);
if (!strcmp (hostname, "NFS Server") ||
!strcmp (hostname, "Self-heal Daemon") ||
- !strcmp (hostname, "Quota Daemon"))
+ !strcmp (hostname, "Quota Daemon") ||
+ !strcmp (hostname, "Snapshot Daemon"))
snprintf (status.brick, PATH_MAX + 255, "%s on %s",
hostname, path);
else