diff options
| author | Kaushik BV <kaushikbv@gluster.com> | 2011-08-16 13:10:41 +0530 | 
|---|---|---|
| committer | Anand Avati <avati@gluster.com> | 2011-08-18 22:42:48 -0700 | 
| commit | ce0aaba383b97dca52d11c18846a8154d529bf8a (patch) | |
| tree | 494673947140ddded481e4532ce6c340eac09446 /xlators/protocol/client/src | |
| parent | b7596882b3ceba77bd812d2e5757d9fa3aa0fa17 (diff) | |
mgmt/Glusterd: Implementation volume set help/help-xml
Change-Id: I0c54fd1c15550e5e5551e95ed32adb14d8029fab
Reviewed-on: http://review.gluster.com/238
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@gluster.com>
Diffstat (limited to 'xlators/protocol/client/src')
| -rw-r--r-- | xlators/protocol/client/src/client.c | 48 | 
1 files changed, 39 insertions, 9 deletions
diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c index 96f3ac1fa98..7f8301be886 100644 --- a/xlators/protocol/client/src/client.c +++ b/xlators/protocol/client/src/client.c @@ -1953,21 +1953,33 @@ notify (xlator_t *this, int32_t event, void *data, ...)  int  build_client_config (xlator_t *this, clnt_conf_t *conf)  { -        int ret = -1; +        int                     ret = -1; +        char                    *def_val = NULL;          if (!conf)                  goto out; +        if (xlator_get_volopt_info (&this->volume_options, "frame-timeout", +                                    &def_val, NULL)) { +                gf_log (this->name, GF_LOG_ERROR, "Default value of " +                         "frame-timeout not found"); +                ret = -1; +                goto out; +        } else { +                if (gf_string2int32 (def_val, &conf->rpc_conf.rpc_timeout)) { +                        gf_log (this->name, GF_LOG_ERROR, "Default value of " +                                 "frame-timeout corrupt"); +                        ret = -1; +                        goto out; +                } +        } +          ret = dict_get_int32 (this->options, "frame-timeout",                                &conf->rpc_conf.rpc_timeout);          if (ret >= 0) {                  gf_log (this->name, GF_LOG_INFO,                          "setting frame-timeout to %d",                          conf->rpc_conf.rpc_timeout); -        } else { -                gf_log (this->name, GF_LOG_DEBUG, -                        "defaulting frame-timeout to 30mins"); -                conf->rpc_conf.rpc_timeout = 1800;          }          ret = dict_get_int32 (this->options, "remote-port", @@ -1980,15 +1992,26 @@ build_client_config (xlator_t *this, clnt_conf_t *conf)                          "defaulting remote-port to 'auto'");          } +        if (xlator_get_volopt_info (&this->volume_options, "ping-timeout", +                                    &def_val, NULL)) { +                gf_log (this->name, GF_LOG_ERROR, "Default value of " +                         "ping-timeout not found"); +                ret = -1; +                goto out; +        } else { +                if (gf_string2int32 (def_val, &conf->opt.ping_timeout)) { +                        gf_log (this->name, GF_LOG_ERROR, "Default value of " +                                 "ping-timeout corrupt"); +                        ret = -1; +                        goto out; +                } +        } +          ret = dict_get_int32 (this->options, "ping-timeout",                                &conf->opt.ping_timeout);          if (ret >= 0) {                  gf_log (this->name, GF_LOG_INFO,                          "setting ping-timeout to %d", conf->opt.ping_timeout); -        } else { -                gf_log (this->name, GF_LOG_DEBUG, -                        "defaulting ping-timeout to 42"); -                conf->opt.ping_timeout = GF_UNIVERSAL_ANSWER;          }          ret = dict_get_str (this->options, "remote-subvolume", @@ -2482,11 +2505,18 @@ struct volume_options options[] = {            .type  = GF_OPTION_TYPE_TIME,            .min   = 0,            .max   = 86400, +          .default_value = "1800", +          .description = "Time frame after which the (file) operation would be " +                         "declared as dead, if the server does not respond for " +                         "a particular (file) operation."          },          { .key   = {"ping-timeout"},            .type  = GF_OPTION_TYPE_TIME,            .min   = 1,            .max   = 1013, +          .default_value = "42", +          .description = "Time duration for which the client waits to " +                         "check if the server is responsive."          },          { .key   = {"client-bind-insecure"},            .type  = GF_OPTION_TYPE_BOOL  | 
