summaryrefslogtreecommitdiffstats
path: root/utils/utils.h
diff options
context:
space:
mode:
authorPrasanna Kumar Kalever <prasanna.kalever@redhat.com>2017-02-23 20:43:07 +0530
committerPrasanna Kumar Kalever <prasanna.kalever@redhat.com>2017-02-27 18:22:40 +0530
commit2445dd3403b3b6e2e903f6d476ed4076e9a51e29 (patch)
tree4b4ad6aed88f2e9c35019d7ae1ab01c9d1057a62 /utils/utils.h
parent15cdf7708b321fe883ada00b9624503c2aa00572 (diff)
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 <prasanna.kalever@redhat.com>
Diffstat (limited to 'utils/utils.h')
-rw-r--r--utils/utils.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/utils/utils.h b/utils/utils.h
index f904540..f551e46 100644
--- a/utils/utils.h
+++ b/utils/utils.h
@@ -44,6 +44,8 @@
# define FAILED_DELETING_FILE "failed while deleting block file from gluster volume"
# define FAILED_DELETING_META "failed while deleting block meta file from volume"
+# define FAILED_DEPENDENCY "failed dependency, check if you have targetcli and tcmu-runner installed"
+
# define LOCK(x) \
do { \
@@ -296,6 +298,32 @@ static const char *const MetaStatusLookup[] = {
[GB_METASTATUS_MAX] = NULL,
};
+typedef enum RemoteCreateResp {
+ GB_BACKEND_RESP = 0,
+ GB_IQN_RESP = 1,
+ GB_TPG_NO_RESP = 2,
+ GB_LUN_NO_RESP = 3,
+ GB_IP_PORT_RESP = 4,
+ GB_PORTAL_RESP = 5,
+ GB_FAILED_RESP = 6,
+ GB_FAILED_DEPEND = 7,
+
+ GB_REMOTE_CREATE_RESP_MAX
+} RemoteCreateResp;
+
+static const char *const RemoteCreateRespLookup[] = {
+ [GB_BACKEND_RESP] = "Created user-backed storage object ",
+ [GB_IQN_RESP] = "Created target ",
+ [GB_TPG_NO_RESP] = "Created TPG ",
+ [GB_LUN_NO_RESP] = "Created LUN ",
+ [GB_IP_PORT_RESP] = "Using default IP port ",
+ [GB_PORTAL_RESP] = "Created network portal ",
+ [GB_FAILED_RESP] = "failed to configure on ",
+ [GB_FAILED_DEPEND] = "check if targetcli and tcmu-runner are installed.",
+
+ [GB_REMOTE_CREATE_RESP_MAX] = NULL,
+};
+
int glusterBlockCLIOptEnumParse(const char *opt);
@@ -303,6 +331,8 @@ int blockMetaKeyEnumParse(const char *opt);
int blockMetaStatusEnumParse(const char *opt);
+int blockRemoteCreateRespEnumParse(const char *opt);
+
int gbAlloc(void *ptrptr, size_t size,
const char *filename, const char *funcname, size_t linenr);