diff options
author | Kaushik BV <kaushikbv@gluster.com> | 2010-10-07 06:37:12 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-10-07 05:43:35 -0700 |
commit | c7b518ab85f6fbcbdbae64c8fa092e998a14d1e9 (patch) | |
tree | 4f55db97bf6e843c96637264c8d97219a5b0aa38 /rpc/rpc-transport | |
parent | f62484f42230db9d240c9b0eaadac48d845053b1 (diff) |
mgmt/Glusterd: Volume set enhancements
- performance.flush-behind, transport.keepalive added
- volume info to display the options reconfigured
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 'rpc/rpc-transport')
-rw-r--r-- | rpc/rpc-transport/socket/src/socket.c | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/rpc/rpc-transport/socket/src/socket.c b/rpc/rpc-transport/socket/src/socket.c index 40531ad4c2a..c5246822a7c 100644 --- a/rpc/rpc-transport/socket/src/socket.c +++ b/rpc/rpc-transport/socket/src/socket.c @@ -2422,6 +2422,67 @@ struct rpc_transport_ops tops = { .get_myaddr = socket_getmyaddr, }; +int +validate_options (rpc_transport_t *this, dict_t *options, char **op_errstr) +{ + char *optstr = NULL; + int ret = -1; + gf_boolean_t tmp_bool = _gf_false; + + if (dict_get_str (options, "transport.socket.keepalive", + &optstr) == 0) { + if (gf_string2boolean (optstr, &tmp_bool) == -1) { + gf_log (this->name, GF_LOG_ERROR, + "'transport.socket.keepalive' takes only " + "boolean options, not taking any action"); + *op_errstr = "Value should be only boolean!!"; + ret =-1; + goto out; + } + } + + ret =0; +out: + return ret; + +} + +int +reconfigure (rpc_transport_t *this, dict_t *options) +{ + socket_private_t *priv = NULL; + gf_boolean_t tmp_bool = _gf_false; + char *optstr = NULL; + int ret = -1; + + if (!this || !this->private) { + ret =-1; + goto out; + } + + + priv = this->private; + + if (dict_get_str (this->options, "transport.socket.keepalive", + &optstr) == 0) { + if (gf_string2boolean (optstr, &tmp_bool) == -1) { + gf_log (this->name, GF_LOG_ERROR, + "'transport.socket.keepalive' takes only " + "boolean options, not taking any action"); + priv->keepalive = 1; + goto out; + } + gf_log (this->name, GF_LOG_DEBUG, "Reconfigured transport.socket.keepalive"); + + priv->keepalive = tmp_bool; + } + else + priv->keepalive = 1; + ret = 0; +out: + return ret; + +} int socket_init (rpc_transport_t *this) |