diff options
Diffstat (limited to 'xlators/cluster/dht/src/dht.c')
-rw-r--r-- | xlators/cluster/dht/src/dht.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/xlators/cluster/dht/src/dht.c b/xlators/cluster/dht/src/dht.c index 4502a751b49..96382bf16e0 100644 --- a/xlators/cluster/dht/src/dht.c +++ b/xlators/cluster/dht/src/dht.c @@ -359,6 +359,7 @@ init (xlator_t *this) int i = 0; gf_defrag_info_t *defrag = NULL; int cmd = 0; + char *node_uuid = NULL; GF_VALIDATE_OR_GOTO ("dht", this, err); @@ -391,6 +392,19 @@ init (xlator_t *this) defrag->is_exiting = 0; + ret = dict_get_str (this->options, "node-uuid", &node_uuid); + if (ret) { + gf_log (this->name, GF_LOG_ERROR, "node-uuid not " + "specified"); + goto err; + } + + if (uuid_parse (node_uuid, defrag->node_uuid)) { + gf_log (this->name, GF_LOG_ERROR, "Cannot parse " + "glusterd node uuid"); + goto err; + } + defrag->cmd = cmd; conf->defrag = defrag; @@ -591,6 +605,9 @@ struct volume_options options[] = { { .key = {"rebalance-cmd"}, .type = GF_OPTION_TYPE_INT, }, + { .key = {"node-uuid"}, + .type = GF_OPTION_TYPE_STR, + }, { .key = {NULL} }, }; |