diff options
author | Kaushik BV <kaushikbv@gluster.com> | 2010-10-05 07:02:07 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-10-05 05:47:38 -0700 |
commit | 6b74f3ec7b6e0fed2e253df456b067fc27049117 (patch) | |
tree | a4f51f043b8d169bf1be46e7b482fca9f3d29d77 /xlators/cluster/dht/src | |
parent | 7aec50bdad06665243a16f1ce83a03037bcd5d56 (diff) |
Reply back to CLI on error, by validating each xlator's opts
Signed-off-by: Kaushik BV <kaushikbv@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 1159 ()
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1159
Diffstat (limited to 'xlators/cluster/dht/src')
-rw-r--r-- | xlators/cluster/dht/src/dht.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht.c b/xlators/cluster/dht/src/dht.c index 2c2f1750755..2c8f2e9a224 100644 --- a/xlators/cluster/dht/src/dht.c +++ b/xlators/cluster/dht/src/dht.c @@ -250,6 +250,45 @@ mem_acct_init (xlator_t *this) return ret; } +int +validate_options (xlator_t *this, dict_t *options, char **op_errstr) +{ + char *temp_str = NULL; + gf_boolean_t search_unhashed; + int ret = 0; + + + + + + if (dict_get_str (options, "lookup-unhashed", &temp_str) == 0) { + if (strcasecmp (temp_str, "auto")) { + if (!gf_string2boolean (temp_str, &search_unhashed)) { + gf_log(this->name, GF_LOG_DEBUG, "Validated" + " lookup-unahashed (%s)", + temp_str); + } + else { + gf_log(this->name, GF_LOG_ERROR, "Validation:" + " lookup-unahashed should be boolean," + " not (%s)", + temp_str); + *op_errstr = gf_strdup ("Error, lookup-" + "unhashed be boolean"); + ret = -1; + goto out; + } + + } + } + + + + + +out: + return ret; +} int reconfigure (xlator_t *this, dict_t *options) |