summaryrefslogtreecommitdiffstats
path: root/gluster-blockd.c
diff options
context:
space:
mode:
authorPrasanna Kumar Kalever <prasanna.kalever@redhat.com>2017-01-22 22:03:39 +0530
committerPrasanna Kumar Kalever <prasanna.kalever@redhat.com>2017-01-30 19:31:50 +0530
commit05ab127cf7cbc09b58958f1c1923e674c697944f (patch)
tree55b0e1976b29ef31a16839b1a5c3464fe55258b3 /gluster-blockd.c
parent7857ef74633919b8213009b411b0840eee144c97 (diff)
gluster-block: add list and info rpc
Signed-off-by: Prasanna Kumar Kalever <prasanna.kalever@redhat.com>
Diffstat (limited to 'gluster-blockd.c')
-rw-r--r--gluster-blockd.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/gluster-blockd.c b/gluster-blockd.c
index 8807b19..48786ca 100644
--- a/gluster-blockd.c
+++ b/gluster-blockd.c
@@ -469,15 +469,34 @@ block_exec_1_svc(char **cmd, struct svc_req *rqstp)
blockResponse *
block_list_cli_1_svc(blockListCli *blk, struct svc_req *rqstp)
{
+ char *cmd;
+ blockResponse *reply;
+ asprintf(&cmd, "%s %s", TARGETCLI_GLFS, LUNS_LIST);
- return NULL;
+ gluster_block_1(blk->block_hosts, cmd, EXEC_SRV, &reply);
+ if (!reply || reply->exit) {
+ ERROR("%s on host: %s",
+ FAILED_GATHERING_CFGSTR, blk->block_hosts);
+ }
+
+ return reply;
}
blockResponse *
block_info_cli_1_svc(blockInfoCli *blk, struct svc_req *rqstp)
{
+ char *cmd;
+ blockResponse *reply;
+ asprintf(&cmd, "%s/%s %s", TARGETCLI_GLFS, blk->block_name, INFO);
- return NULL;
+ //for
+ gluster_block_1(blk->block_hosts, cmd, EXEC_SRV, &reply);
+ if (!reply || reply->exit) {
+ ERROR("%s on host: %s",
+ FAILED_GATHERING_CFGSTR, blk->block_hosts);
+ }
+
+ return reply;
}