From bcd1e26a95ab75f3431be8e71d93eae9b7b6cbf8 Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Fri, 20 Feb 2009 18:09:02 -0800 Subject: default volume file option enhanced in server-protocolg Noticed that with current codebase, there is no proper method to have a default volume filename to choose in getspec() without printing a *lot* of warning messages. This patch tries to have a proper 'default' behavior. Signed-off-by: Anand V. Avati --- xlators/protocol/server/src/server-protocol.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'xlators/protocol/server/src/server-protocol.c') diff --git a/xlators/protocol/server/src/server-protocol.c b/xlators/protocol/server/src/server-protocol.c index a5198c1ed..3fa39176f 100644 --- a/xlators/protocol/server/src/server-protocol.c +++ b/xlators/protocol/server/src/server-protocol.c @@ -6826,7 +6826,7 @@ mop_getspec (call_frame_t *frame, &filename); if (ret == 0) { gf_log (trans->xl->name, GF_LOG_WARNING, - "option 'client-volume-specfile' is changed to " + "option 'client-volume-filename' is changed to " "'volume-filename.' which now takes 'key' as an " "option to choose/fetch different files from server. " "Refer documentation or contact developers for more " @@ -6844,12 +6844,17 @@ mop_getspec (call_frame_t *frame, key, GLUSTERFSD_SPEC_PATH); } } + if (!filename) { - filename = GLUSTERFSD_SPEC_PATH; - if (!key) - gf_log (trans->xl->name, GF_LOG_WARNING, - "using default volume file %s", - GLUSTERFSD_SPEC_PATH); + ret = dict_get_str (frame->this->options, + "volume-filename.default", &filename); + if (ret < 0) { + gf_log (trans->xl->name, GF_LOG_DEBUG, + "no default volume filename given, " + "defaulting to %s", GLUSTERFSD_SPEC_PATH); + + filename = GLUSTERFSD_SPEC_PATH; + } } { -- cgit