]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Add rados_conf_apply, comments
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Wed, 23 Feb 2011 00:38:41 +0000 (16:38 -0800)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Wed, 23 Feb 2011 18:17:30 +0000 (10:17 -0800)
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
src/include/rados/librados.h
src/librados.cc

index edd911787a0d0d689ac3ee8f30735b0369c7d531..a240881ea40a439ea02e1a989c52e6d2654c5246 100644 (file)
@@ -54,14 +54,21 @@ void rados_version(int *major, int *minor, int *extra);
 int rados_init(rados_t *cluster);
 void rados_release(rados_t cluster);
 
-/* config */
-int rados_conf_parse_argv(rados_t cluster, int argc, const char **argv);
+/* Config
+ *
+ * Functions for manipulating the Ceph configuration at runtime.
+ * After changing the Ceph configuration, you should call rados_conf_apply to
+ * ensure that the changes have been applied.
+ */
 int rados_conf_read_file(rados_t cluster, const char *path);
 
 /* Sets a configuration value from a string.
  * Returns 0 on success, error code otherwise. */
 int rados_conf_set(rados_t cluster, const char *option, const char *value);
 
+/* Applies any configuration changes */
+int rados_conf_apply(void);
+
 /* Returns a configuration value as a string.
  * If len is positive, that is the maximum number of bytes we'll write into the
  * buffer. If len == -1, we'll call malloc() and set *buf.
index 2adf64c71d177a870a77b26c37a0d8b008de8254..569e09b81c049e45df9c973ade46cf9308a85425 100644 (file)
@@ -2418,12 +2418,14 @@ extern "C" int rados_conf_read_file(rados_t cluster, const char *path)
 
 extern "C" int rados_conf_set(rados_t cluster, const char *option, const char *value)
 {
-  int ret = g_conf.set_val(option, value);
-  if (ret == 0) {
-    // Simulate SIGHUP after a configuration change.
-    sighup_handler(SIGHUP);
-  }
-  return ret;
+  return g_conf.set_val(option, value);
+}
+
+extern "C" int rados_conf_apply(void)
+{
+  // Simulate SIGHUP after a configuration change.
+  sighup_handler(SIGHUP);
+  return 0;
 }
 
 extern "C" int rados_conf_get(rados_t cluster, const char *option, char **buf, int len)