Patchwork [BUG:1584] glusterd: fix init time warnings

login
register
Submitter Amar Tumballi
Date 2010-09-09 10:36:55
Message ID <20100909103655.GA14550@gluster.com>
Download mbox | patch
Permalink /patch/4705/
State Accepted
Headers show

Comments

Amar Tumballi - 2010-09-09 10:36:55
Signed-off-by: Amar Tumballi <amar@gluster.com>
---
 xlators/mgmt/glusterd/src/glusterd.c |   32 ++++++++++++++++++++++----------
 1 files changed, 22 insertions(+), 10 deletions(-)

Patch

diff --git a/xlators/mgmt/glusterd/src/glusterd.c b/xlators/mgmt/glusterd/src/glusterd.c
index 69ea9ed..46efb87 100644
--- a/xlators/mgmt/glusterd/src/glusterd.c
+++ b/xlators/mgmt/glusterd/src/glusterd.c
@@ -70,24 +70,25 @@  glusterd_opinfo_init ()
 }
 
 static int
-glusterd_uuid_init ()
+glusterd_uuid_init (int flag)
 {
         int             ret = -1;
         char            str[50] = {0,};
         glusterd_conf_t *priv = NULL;
 
         priv = THIS->private;
-        ret = glusterd_retrieve_uuid ();
 
-        if (!ret) {
-                uuid_unparse (priv->uuid, str);
-                uuid_copy (glusterd_uuid, priv->uuid);
-                gf_log ("glusterd", GF_LOG_NORMAL,
+        if (!flag) {
+                ret = glusterd_retrieve_uuid ();
+                if (!ret) {
+                        uuid_unparse (priv->uuid, str);
+                        uuid_copy (glusterd_uuid, priv->uuid);
+                        gf_log ("glusterd", GF_LOG_NORMAL,
                                 "retrieved UUID: %s", str);
-                return 0;
+                        return 0;
+                }
         }
 
-
         uuid_generate (glusterd_uuid);
         uuid_unparse (glusterd_uuid, str);
 
@@ -233,6 +234,7 @@  init (xlator_t *this)
         char               voldir [PATH_MAX] = {0,};
         char               dirname [PATH_MAX];
         char               cmd_log_filename [PATH_MAX] = {0,};
+        int                first_time        = 0;
 
         dir_data = dict_get (this->options, "working-directory");
 
@@ -268,6 +270,7 @@  init (xlator_t *this)
                                 " ,errno = %d", dirname, errno);
                         exit (1);
                 }
+                first_time = 1;
         }
 
         gf_log (this->name, GF_LOG_NORMAL, "Using %s as working directory",
@@ -390,7 +393,7 @@  init (xlator_t *this)
         this->private = conf;
         //this->ctx->top = this;
 
-        ret = glusterd_uuid_init ();
+        ret = glusterd_uuid_init (first_time);
         if (ret < 0)
                 goto out;
 
@@ -481,9 +484,18 @@  struct xlator_dumpops dumpops = {
 
 
 struct volume_options options[] = {
-        { .key   = {"working-dir"},
+        { .key   = {"working-directory"},
           .type  = GF_OPTION_TYPE_PATH,
         },
+        { .key   = {"transport-type"},
+          .type  = GF_OPTION_TYPE_ANY,
+        },
+        { .key   = {"transport.*"},
+          .type  = GF_OPTION_TYPE_ANY,
+        },
+        { .key   = {"rpc-auth.*"},
+          .type  = GF_OPTION_TYPE_ANY,
+        },
 
         { .key   = {NULL} },
 };