From 2445dd3403b3b6e2e903f6d476ed4076e9a51e29 Mon Sep 17 00:00:00 2001 From: Prasanna Kumar Kalever Date: Thu, 23 Feb 2017 20:43:07 +0530 Subject: gluster-blockd: parse create and delete outputs The new parsed output of create and delete command will look like: $ gluster-block create sample/sample-block ha 2 ${HOST1} ${HOST2} 1GiB IQN: iqn.2016-12.org.gluster-block:aafea465-9167-4880-b37c-2c36db8562ea PORTAL(S): ${HOST1}:3260 ${HOST2}:3260 RESULT: SUCCESS $ gluster-block delete sample/sample-block SUCCESSFUL ON: ${HOST1} ${HOST2} RESULT: SUCCESS Change-Id: Id98e643c62a898a1f7298b6cfeb6ddfa10397b7f Signed-off-by: Prasanna Kumar Kalever --- utils/utils.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'utils/utils.c') diff --git a/utils/utils.c b/utils/utils.c index cb0e96e..7f43bc4 100644 --- a/utils/utils.c +++ b/utils/utils.c @@ -72,6 +72,24 @@ blockMetaStatusEnumParse(const char *opt) return i; } +int blockRemoteCreateRespEnumParse(const char *opt) +{ + int i; + + + if (!opt) { + return GB_REMOTE_CREATE_RESP_MAX; + } + + for (i = 0; i < GB_REMOTE_CREATE_RESP_MAX; i++) { + if (strstr(opt, RemoteCreateRespLookup[i])) { + return i; + } + } + + return i; +} + int gbAlloc(void *ptrptr, size_t size, -- cgit