On Mon, 14 Feb 2011, Colin McCabe wrote: > On Mon, Feb 14, 2011 at 3:00 PM, Sage Weil <sage@xxxxxxxxxxxx> wrote: > > There are a few problems with the current librados api (at least the C > > bindings). The main one is that there is an implicit assumption that you > > can only interact with a single cluster from the same process. > > rados_initalize() takes argc/argv, allowing you to pass in configuration > > options and/or a config file location, and it is assume that is the > > cluster that is referenced when you open up a pool. > > One idea would be to have a C API like this: > > rados_cluster_t ctx; > rados_initialize(&ctx); > rados_read_configuration(ctx, "my_ceph_config.conf"); > rados_set_conf("log dir", "/my/log/dir"); How about: --- /* initialization */ int rados_open(rados_t *cluster); void rados_close(rados_t cluster); /* config */ int rados_conf_parse_argv(rados_t cluster, int argc, char **argv); int rados_conf_readfile(rados_t cluster, const char *path); int rados_conf_set(rados_t cluster, const char *option, const char *value); const char *rados_conf_get(rados_t cluster, const char *option); --- I think the (short term) trick will be supporting this immediately before the config refactoring is in place. Should be possible with a hidden argv vector and the existing internal framework, I think. sage