summaryrefslogtreecommitdiffstats
path: root/xlators/protocol/client
diff options
context:
space:
mode:
authorVarun Shastry <vshastry@redhat.com>2014-05-06 12:39:20 +0000
committerKrishnan Parthasarathi <kparthas@redhat.com>2014-06-03 00:08:29 -0700
commit0fe5ab5b9215b8f0ecfb8bc4ba15a5370850654a (patch)
tree713e00bd047e1703848a0e8529b5592e35638101 /xlators/protocol/client
parent15f7b4de1124a37a53c7ddb5635b005322b23025 (diff)
glusterd: Changes to provide interface for USS
The changes which consists of the translators for the USS (User Servicable Snapshots) is submitted as a separate patch. Current patch provides the CLI access to the feature. Change-Id: I6b98a42fcfa82f0870d8048fe0bb53141565e9c6 BUG: 1094815 Signed-off-by: Varun Shastry <vshastry@redhat.com> Reviewed-on: http://review.gluster.org/7705 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Reviewed-by: Krishnan Parthasarathi <kparthas@redhat.com> Tested-by: Krishnan Parthasarathi <kparthas@redhat.com>
Diffstat (limited to 'xlators/protocol/client')
-rw-r--r--xlators/protocol/client/src/client.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c
index e181292f433..7ab10b085b4 100644
--- a/xlators/protocol/client/src/client.c
+++ b/xlators/protocol/client/src/client.c
@@ -2310,6 +2310,37 @@ notify (xlator_t *this, int32_t event, void *data, ...)
}
int
+client_check_remote_host (xlator_t *this, dict_t *options)
+{
+ char *remote_host = NULL;
+ int ret = -1;
+
+ ret = dict_get_str (options, "remote-host", &remote_host);
+ if (ret < 0) {
+ gf_log (this->name, GF_LOG_INFO, "Remote host is not set. "
+ "Assuming the volfile server as remote host.");
+
+ if (!this->ctx->cmd_args.volfile_server) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "No remote host to connect.");
+ goto out;
+ }
+
+ ret = dict_set_str (options, "remote-host",
+ this->ctx->cmd_args.volfile_server);
+ if (ret == -1) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "Failed to set the remote host");
+ goto out;
+ }
+ }
+
+ ret = 0;
+out:
+ return ret;
+}
+
+int
build_client_config (xlator_t *this, clnt_conf_t *conf)
{
int ret = -1;
@@ -2337,6 +2368,10 @@ build_client_config (xlator_t *this, clnt_conf_t *conf)
GF_OPTION_INIT ("send-gids", conf->send_gids, bool, out);
+ ret = client_check_remote_host (this, this->options);
+ if (ret)
+ goto out;
+
ret = 0;
out:
return ret;
@@ -2493,6 +2528,10 @@ reconfigure (xlator_t *this, dict_t *options)
GF_OPTION_RECONF ("ping-timeout", conf->opt.ping_timeout,
options, int32, out);
+ ret = client_check_remote_host (this, options);
+ if (ret)
+ goto out;
+
subvol_ret = dict_get_str (this->options, "remote-host",
&old_remote_host);