Quoting Dwight Engen (dwight.en...@oracle.com):
> > +struct lxc_config_items items[] =
> > +{
> > +   { .name = "default_path", .fn =
> 
> Should this be "lxcpath" instead of "default_path" so it matches the
> field in the file? (or change default_lxc_path() to "default_path" but
> that would break users' files).

The name in lxc.conf was original default_path, but I'll change it to
lxcpath and, if I happen to see default_path in lxc.conf, honor that as
well.  'default' makes sense in the code, but in a configuration file
it's a bit redundant :)

> > &lxc_get_default_config_path, },
> > +   { .name = "lvm_vg", .fn = &lxc_get_default_lvm_vg, },
> > +   { .name = "zfsroot", .fn = &lxc_get_default_zfs_root, },
> > +   { .name = NULL, },
> > +};
> > +
> > +void usage(char *me)
> > +{
> > +   printf("Usage: %s -l: list all available configuration
> > items\n", me);
> > +   printf("       %s item: print configuration item\n", me);
> > +   exit(1);
> > +}
> > +
> > +void list_config_items(void)
> > +{
> > +   struct lxc_config_items *i;
> > +
> > +   for (i = &items[0]; i->name; i++)
> > +           printf("%s\n", i->name);
> > +   exit(0);
> > +}
> > +
> > +int main(int argc, char *argv[])
> > +{
> > +   struct lxc_config_items *i;
> > +
> > +   if (argc < 2)
> > +           usage(argv[0]);
> > +   if (strcmp(argv[1], "-l") == 0)
> > +           list_config_items();
> > +   for (i = &items[0]; i->name; i++) {
> > +           if (strcmp(argv[1], i->name) == 0) {
> > +                   printf("%s\n", i->fn());
> > +                   exit(0);
> > +           }
> > +   }
> > +   printf("Unknown configuration item: %s\n", argv[1]);
> > +   return 0;
> 
> Should we return 1 or EXIT_FAILURE here?

Oops, yeah.

Thanks, Dwight.

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel

Reply via email to