Re: New configuration / command line handling

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Dec 3, 2012 at 10:51 PM, Josh Durgin <josh.durgin@xxxxxxxxxxx> wrote:
> It looks like you've got a good start on integrating it into the main
> ceph infrastructure. Skimming over it, the general structure makes sense
> to me. One part that might be a bit tricky is making the new parsing
> backwards compatible with the old parsing.
>
> 1) For config options in general, '-', '_', and ' ' are all equivalent.
> 2) In ceph's config file format, we treat ';' as a comment in addition to
> '#'.
>
> I'm not sure how difficult those are to handle with the built-in
> boost::program_options parsers.

Well, there is another (maybe larger) problem; metavalues. Boost::po
can't handle them. That's why I am implementing the raw config file
parsing separately (partly using boost::property_tree actually), load
all options in a tree hierarchy (for example [osd.1] -> [osd] ->
[global]) and then do metavalue lookups top-down with static regexps.
Then, I have a parsed and complete set in the top of the tree (osd.1
in this case) which I can feed to boost::po to be parsed. Still have
to work out some of the details though, but I think this is generally
a nice way of config parsing. I'll see if I can find the time this
week to implement it if you're interested.

> Converting some of the individual command line tools that use
> subcommands might be a little cumbersome too, but I think they'll
> be better off once it's done.

My biggest concern is that most code directly accesses members of
md_config_t by means of g_conf->foo. It's very difficult to port that
to the new class without actually loading all of the available config
options as class members - something I'm personally not a big fan of.
I haven't had the time to think of a nice solution, yet (something
like getter/setter methods maybe, or macros?). If you have any
thoughts about this I'd very much like to hear them.

- Roald
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux