1. 14 5月, 2013 1 次提交
  2. 26 4月, 2013 1 次提交
    • D
      Do proper escaping of cgroup resource partitions · f3662737
      Daniel P. Berrange 提交于
      If a user cgroup name begins with "cgroup.", "_" or with any of
      the controllers from /proc/cgroups followed by a dot, then they
      need to be prefixed with a single underscore. eg if there is
      an object "cpu.service", then this would end up as "_cpu.service"
      in the cgroup filesystem tree, however, "waldo.service" would
      stay "waldo.service", at least as long as nobody comes up with
      a cgroup controller called "waldo".
      
      Since we require a '.XXXX' suffix on all partitions, there is
      no scope for clashing with the kernel 'tasks' and 'release_agent'
      files.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      f3662737
  3. 16 4月, 2013 2 次提交
    • D
      Track symlinks for co-mounted cgroup controllers · 83336118
      Daniel P. Berrange 提交于
      If a cgroup controller is co-mounted with another, eg
      
         /sys/fs/cgroup/cpu,cpuacct
      
      Then it is a requirement that there exist symlinks at
      
         /sys/fs/cgroup/cpu
         /sys/fs/cgroup/cpuacct
      
      pointing to the real mount point. Add support to virCgroupPtr
      to detect and track these symlinks
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      83336118
    • D
      Add a test suite for cgroups functionality · d1452470
      Daniel P. Berrange 提交于
      Some aspects of the cgroups setup / detection code are quite subtle
      and easy to break. It would greatly benefit from unit testing, but
      this is difficult because the test suite won't have privileges to
      play around with cgroups. The solution is to use monkey patching
      via LD_PRELOAD to override the fopen, open, mkdir, access functions
      to redirect access of cgroups files to some magic stubs in the
      test suite.
      
      Using this we provide custom content for the /proc/cgroup and
      /proc/self/mounts files which report a fixed cgroup setup. We
      then override open/mkdir/access so that access to the cgroups
      filesystem gets redirected into files in a temporary directory
      tree in the test suite build dir.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      d1452470