Add rados_conf_apply, comments

Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
This commit is contained in:
Colin Patrick McCabe 2011-02-22 16:38:41 -08:00
parent 0d54e31169
commit 871fa1b322
2 changed files with 17 additions and 8 deletions

View 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.

View 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)