1. 09 12月, 2015 1 次提交
  2. 21 10月, 2015 1 次提交
  3. 14 7月, 2015 1 次提交
  4. 24 4月, 2015 1 次提交
  5. 16 4月, 2015 1 次提交
    • E
      tests: fix build on old 32-bit platforms · 9289c858
      Eric Blake 提交于
      gcc 4.1.2 (hello RHEL 5) on 32-bit platforms complains:
      
      vircgrouptest.c: In function 'testCgroupGetPercpuStats':
      vircgrouptest.c:627: warning: integer constant is too large for 'long' type
      vircgrouptest.c:628: warning: this decimal constant is unsigned only in ISO C90
      vircgrouptest.c:634: warning: integer constant is too large for 'long' type
      vircgrouptest.c:635: warning: this decimal constant is unsigned only in ISO C90
      vircgrouptest.c:636: warning: this decimal constant is unsigned only in ISO C90
      vircgrouptest.c:644: warning: integer constant is too large for 'long' type
      
      * tests/vircgrouptest.c (testCgroupGetPercpuStats): Use ULL suffix.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      9289c858
  6. 08 4月, 2015 1 次提交
  7. 18 3月, 2015 1 次提交
  8. 26 1月, 2015 1 次提交
  9. 23 1月, 2015 2 次提交
    • J
      Fix build with older gcc · d66e136b
      Ján Tomko 提交于
      My commit af1c98e4 broke the build on RHEL-6:
      vircgrouptest.c: In function 'testCgroupGetPercpuStats':
      vircgrouptest.c:566: error: nested extern declaration of
      '_gl_verify_function2' [-Wnested-externs]
      
      The only thing that needs checking is that the array size
      is at least EXPECTED_NCPUS, to prevent access beyond the array.
      
      We can ensure the minimum size also by specifying the array
      size upfront.
      d66e136b
    • J
      Fix virCgroupGetPercpuStats with non-continuous present CPUs · af1c98e4
      Ján Tomko 提交于
      Per-cpu stats are only shown for present CPUs in the cgroups,
      but we were only parsing the largest CPU number from
      /sys/devices/system/cpu/present and looking for stats even for
      non-present CPUs.
      This resulted in:
      internal error: cpuacct parse error
      af1c98e4
  10. 09 4月, 2014 1 次提交
    • J
      Extend virCgroupGetPercpuStats to fill in vcputime too · 897808e7
      Ján Tomko 提交于
      Currently, virCgroupGetPercpuStats is only used by the LXC driver,
      filling out the CPUTIME stats. qemuDomainGetPercpuStats does this
      and also filles out VCPUTIME stats.
      
      Extend virCgroupGetPercpuStats to also report VCPUTIME stats if
      nvcpupids is non-zero. In the LXC driver, we don't have cpupids.
      In the QEMU driver, there is at least one cpupid for a running domain,
      so the behavior shouldn't change for QEMU either.
      
      Also rename getSumVcpuPercpuStats to virCgroupGetPercpuVcpuSum.
      897808e7
  11. 25 3月, 2014 1 次提交
  12. 18 3月, 2014 2 次提交
  13. 22 2月, 2014 1 次提交
  14. 20 2月, 2014 3 次提交
  15. 08 10月, 2013 1 次提交
  16. 12 9月, 2013 1 次提交
  17. 11 9月, 2013 1 次提交
    • D
      Fix cgroups when all are mounted on /sys/fs/cgroup · f0b6d8d4
      Daniel P. Berrange 提交于
      Some users in Ubuntu/Debian seem to have a setup where all the
      cgroup controllers are mounted on /sys/fs/cgroup rather than
      any /sys/fs/cgroup/<controller> name. In the loop which detects
      which controllers are present for a mount point we were modifying
      'mnt_dir' field in the 'struct mntent' var, but not always restoring
      the original value. This caused detection to break in the all-in-one
      mount setup.
      
      Fix that logic bug and add test case coverage for this mount
      setup.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      f0b6d8d4
  18. 01 8月, 2013 1 次提交
    • D
      Add support for systemd cgroup mount · aedd46e7
      Daniel P. Berrange 提交于
      Systemd uses a named cgroup mount for tracking processes. Add
      it as another type of controller, albeit one which we have to
      special case in a number of places. In particular we must
      never create/delete directories there, nor add tasks. Essentially
      the systemd mount is to be considered read-only for libvirt.
      
      With this change both the virCgroupDetectPlacement and
      virCgroupCopyPlacement methods must be invoked. The copy
      placement method will copy setup for resource controllers
      only. The detect placement method will probe for any
      named controllers, or resource controllers not already
      setup.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      aedd46e7
  19. 24 7月, 2013 1 次提交
  20. 22 7月, 2013 1 次提交
  21. 11 7月, 2013 1 次提交
  22. 24 5月, 2013 1 次提交
    • V
      cgroups: Do not enforce nonexistent controllers · eb21408f
      Viktor Mihajlovski 提交于
      Currently, the controllers argument to virCgroupDetect acts both as
      a result filter and a required controller specification, which is
      a bit overloaded. If both functionalities are needed, it would be
      better to have them seperated into a filter and a requirement mask.
      The only situation where it is used today is to ensure that only
      CPU related controllers are used for the VCPU directories. But here
      we clearly do not want to enforce the existence of cpu, cpuacct and
      specifically not cpuset at the same time.
      This commit changes the semantics of controllers to "filter only".
      Should a required mask ever be needed, more work will have to be done.
      Signed-off-by: NViktor Mihajlovski <mihajlov@linux.vnet.ibm.com>
      eb21408f
  23. 21 5月, 2013 1 次提交
  24. 10 5月, 2013 1 次提交
  25. 02 5月, 2013 1 次提交
    • M
      virutil: Move string related functions to virstring.c · 7c9a2d88
      Michal Privoznik 提交于
      The source code base needs to be adapted as well. Some files
      include virutil.h just for the string related functions (here,
      the include is substituted to match the new file), some include
      virutil.h without any need (here, the include is removed), and
      some require both.
      7c9a2d88
  26. 26 4月, 2013 3 次提交
  27. 16 4月, 2013 5 次提交
    • 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
      Remove non-functional code for setting up non-root cgroups · 767596bd
      Daniel P. Berrange 提交于
      The virCgroupNewDriver method had a 'bool privileged' param.
      If a false value was ever passed in, it would simply not
      work, since non-root users don't have any privileges to create
      new cgroups. Just delete this broken code entirely and make
      the QEMU driver skip cgroup setup in non-privileged mode
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      767596bd
    • D
      Add a new virCgroupNewPartition for setting up resource partitions · aa8604dd
      Daniel P. Berrange 提交于
      A resource partition is an absolute cgroup path, ignoring the
      current process placement. Expose a virCgroupNewPartition API
      for constructing such cgroups
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      aa8604dd
    • D
      Refactor cgroups internal data structures · 8d1c141a
      Daniel P. Berrange 提交于
      Currently the virCgroupPtr struct contains 3 pieces of
      information
      
       - path - path of the cgroup, relative to current process'
         cgroup placement
       - placement - current process' placement in each controller
       - mounts - mount point of each controller
      
      When reading/writing cgroup settings, the path & placement
      strings are combined to form the file path. This approach
      only works if we assume all cgroups will be relative to
      the current process' cgroup placement.
      
      To allow support for managing cgroups at any place in the
      heirarchy a change is needed. The 'placement' data should
      reflect the absolute path to the cgroup, and the 'path'
      value should no longer be used to form the paths to the
      cgroup attribute files.
      Signed-off-by: NDaniel P. Berrange <berrange@redhat.com>
      8d1c141a
    • 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