Skip to content

Commit

Permalink
doc: Add section about changing config values
Browse files Browse the repository at this point in the history
Signed-off-by: Colin McCabe <[email protected]>
  • Loading branch information
cmccabe authored and Tommi Virtanen committed Sep 16, 2011
1 parent 7d3aa0e commit 89c06e7
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion doc/dev/config.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ There are a few different metavariables:
- $name: expands to $type.$id


Interfacing with the Configuration Management System
Readin configuration values
====================================================

There are two ways for Ceph code to get configuration values. One way is to
Expand All @@ -75,3 +75,16 @@ The observer method should be preferred in new code because

For these reasons, reading directly from g_conf should be considered deprecated
and not done in new code. Do not ever alter g_conf.

Changing configuration values
====================================================

Configuration values can be changed by calling g_conf->set_val. After changing
the configuration, you should call g_conf->apply_changes to re-run all the
affected configuration observers. For convenience, you can call
g_conf->set_val_or_die to make a configuration change which you think should
never fail.

Injectargs, parse_argv, and parse_env are three other functions which modify
the configuration. Just like with set_val, you should call apply_changes after
calling these functions to make sure your changes get applied.

0 comments on commit 89c06e7

Please sign in to comment.