[augeas-devel] cgconfig.conf augeas lenses and its test file

David Lutterkort lutter at redhat.com
Mon Feb 8 19:37:15 UTC 2010


On Mon, 2010-02-08 at 08:24 +0100, Ivana Hutarova Varekova wrote:
> With Raphael Pinson large help I write a lense for cgconfig.conf configuration
> file and test file for it.
> (cgconfig.conf file is a part of libcgroup tool -http://libcg.sourceforge.net/)
> I'm sending them in attachment.
> If there are any problems please ping me.

Nice. Thanks for doing these. One question: a mount entry like

   mount { cpu = /mnt/cgroups/cpu; }

is mapped to a tree like

   { "mount" { "1" { "controller" = "cpu" } { "mount_point" = "/mnt/cgroups/cpu" } } }

and the lens allows arbitrary names for the name if the mount. As far as
I understand the cgconfig.conf manpage, the controller name can only be
one of the cont_name names, even though the lens allows anything there.
Shouldn't that be changed to the fixed controller names the kernel
understands ?

Also, wouldn't it be simpler to map the above mount line to a tree like

   { "mount" { "cpu" = "/mnt/cgroups/cpu" } }

That would lead to a much more compact (and hopefully understandable) tree.

Similarly, the controller entries in a group could be simplified to
yield a flatter tree, so that the get test for group1 in
test_cgconfig.aug would look something like

        test Cgconfig.lns get group1 =
          {  }
          { "group"
            { "name" = "user" }
            {  }
            { "controller" = "cpuacct"
              {  }
              { "lll" = "jjj" } }
            {  } }
            {  }
            { "controller" = "cpu"
              {  } }
            {  } }

Basically, I am trying to remove unnecessary uses of seq.

David







More information about the augeas-devel mailing list