1. 16 11月, 2014 2 次提交
  2. 16 9月, 2014 2 次提交
  3. 04 9月, 2014 1 次提交
  4. 23 7月, 2014 1 次提交
    • C
      lxc: allow to keep or drop capabilities · 47e5b5ae
      Cédric Bosdonnat 提交于
      Added <capabilities> in the <features> section of LXC domains
      configuration. This section can contain elements named after the
      capabilities like:
      
        <mknod state="on"/>, keep CAP_MKNOD capability
        <sys_chroot state="off"/> drop CAP_SYS_CHROOT capability
      
      Users can restrict or give more capabilities than the default using
      this mechanism.
      47e5b5ae
  5. 09 7月, 2014 1 次提交
    • P
      util: cgroup: Fix build on non-cgroup platforms · 464f7678
      Peter Krempa 提交于
      Commit a48f4451 introduced a helper
      function to convert cgroup device mode to string. The function was only
      conditionally compiled on platforms that support cgroup. This broke the
      build when attempting to export the symbol:
      
        CCLD     libvirt.la
        Cannot export virCgroupGetDevicePermsString: symbol not defined
      
      Move the function out of the ifdef, as it doesn't really depend on the
      cgroup code being present.
      464f7678
  6. 08 7月, 2014 1 次提交
  7. 16 5月, 2014 1 次提交
  8. 29 4月, 2014 1 次提交
    • E
      util: use virDirRead API · ac1d42ac
      Eric Blake 提交于
      In making the conversion to the new API, I fixed a couple bugs:
      virSCSIDeviceGetSgName would leak memory if a directory
      unexpectedly contained multiple entries;
      virNetDevTapGetRealDeviceName could report a spurious error
      from a stale errno inherited before starting the readdir search.
      
      The decision on whether to store the result of virDirRead into
      a variable is based on whether the end of the loop falls through
      to cleanup code automatically.  In some cases, we have loops that
      are documented to return NULL on failure, and which raise an
      error on most failure paths but not in the case where the directory
      was unexpectedly empty; it may be worth a followup patch to
      explicitly report an error if readdir was successful but the
      directory was empty, so that a NULL return always has an error set.
      
      * src/util/vircgroup.c (virCgroupRemoveRecursively): Use new
      interface.
      (virCgroupKillRecursiveInternal, virCgroupSetOwner): Report
      readdir failures.
      * src/util/virfile.c (virFileLoopDeviceOpenSearch)
      (virFileNBDDeviceFindUnused, virFileDeleteTree): Use new
      interface.
      * src/util/virnetdevtap.c (virNetDevTapGetRealDeviceName):
      Properly check readdir errors.
      * src/util/virpci.c (virPCIDeviceIterDevices)
      (virPCIDeviceFileIterate, virPCIGetNetName): Report readdir
      failures.
      (virPCIDeviceAddressIOMMUGroupIterate): Use new interface.
      * src/util/virscsi.c (virSCSIDeviceGetSgName): Report readdir
      failures, and avoid memory leak.
      (virSCSIDeviceGetDevName): Report readdir failures.
      * src/util/virusb.c (virUSBDeviceSearch): Report readdir
      failures.
      * src/util/virutil.c (virGetFCHostNameByWWN)
      (virFindFCHostCapableVport): Report readdir failures.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      ac1d42ac
  9. 09 4月, 2014 6 次提交
    • J
      Fix build on mingw32 · 5dfcd6fb
      Ján Tomko 提交于
      My commit 897808e7 added a parameter to virCgroupGetPercpuStats,
      but didn't change the stub for systems where cgroups are not supported.
      5dfcd6fb
    • J
      Clean up virCgroupGetPercpuStats · 2adf59eb
      Ján Tomko 提交于
      The iterator is checked for being less than or equal to need_cpus.
      The 'n' variable is incremented need_cpus + 1 times.
      
      Simplify the computation of need_cpus and make its value one larger,
      to let it be used instead of 'n' and compared without the equal sign
      in loop conditions.
      
      Just index the sum_cpu_time array instead of using a helper variable.
      
      Start the loop at start_cpu instead of continuing for all lower values.
      2adf59eb
    • J
      Check maximum startcpu value correctly · 9fe5267a
      Ján Tomko 提交于
      The cpus are indexed from 0, so a startcpu value equal
      to the number of CPUs is invalid.
      
      https://bugzilla.redhat.com/show_bug.cgi?id=1070680
      9fe5267a
    • J
      Rename id, max_id to need_cpus, total_cpus · dd74ab4e
      Ján Tomko 提交于
      total_cpus is the total number of CPUs on the host
      need_cpus is the number of CPUs we need to look at
      
      (need_cpus can be larger than ncpus, because we need to look
       at CPUs before the startcpu too, even if we aren't reporting
       their stats)
      dd74ab4e
    • 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
    • J
      Fix return value of virCgroupGetPercpuStats · 23d2d863
      Ján Tomko 提交于
      We need to return the number of successfully populated stats,
      not the nparams supplied by the user.
      23d2d863
  10. 31 3月, 2014 1 次提交
  11. 25 3月, 2014 1 次提交
  12. 21 3月, 2014 1 次提交
    • W
      cgroup: Fix start VMs coincidently failed · bfb29654
      Wang Yufei 提交于
      When I start multi VMs coincidently and any of the cgroup directories
      named machine doesn't exist. There's a chance that VM start failed because
      of creating directory failed:
      Unable to initialize /machine cgroup: File exists
      When the errno returned by mkdir in virCgroupMakeGroup is EEXIST,
      we should pass it through and continue to start the VM.
      Signed-off-by: NWang Yufei <james.wangyufei@huawei.com>
      bfb29654
  13. 18 3月, 2014 2 次提交
  14. 26 2月, 2014 1 次提交
    • E
      build: fix cgroups on non-Linux · fa2e4dbf
      Eric Blake 提交于
      Running ./autobuild.sh detected a mingw failure:
      
        CCLD     libvirt.la
      Cannot export virCgroupGetPercpuStats: symbol not defined
      Cannot export virCgroupSetOwner: symbol not defined
      
      * src/util/vircgroup.c (virCgroupGetPercpuStats)
      (virCgroupSetOwner): Implement stubs.
      Signed-off-by: NEric Blake <eblake@redhat.com>
      fa2e4dbf
  15. 24 2月, 2014 1 次提交
  16. 21 2月, 2014 1 次提交
  17. 20 2月, 2014 3 次提交
  18. 20 1月, 2014 1 次提交
  19. 10 12月, 2013 1 次提交
    • M
      cgroups: Redefine what "unlimited" means wrt memory limits · 231656bb
      Martin Kletzander 提交于
      Since kernel 3.12 (commit 34ff8dc08956098563989d8599840b130be81252 in
      linux-stable.git in particular) the value for 'unlimited' in cgroup
      memory limits changed from LLONG_MAX to ULLONG_MAX.  Due to rather
      unfortunate choice of our VIR_DOMAIN_MEMORY_PARAM_UNLIMITED constant
      (which we transfer as an unsigned long long in Kibibytes), we ended up
      with the situation described below (applies to x86_64):
      
       - 2^64-1 (ULLONG_MAX) -- "unlimited" in kernel = 3.12
      
       - 2^63-1 (LLONG_MAX) -- "unlimited" in kernel < 3.12
       - 2^63-1024 -- our PARAM_UNLIMITED scaled to Bytes
      
       - 2^53-1 -- our PARAM_UNLIMITED unscaled (in Kibibytes)
      
      This means that when any number within (2^63-1, 2^64-1] is read from
      memory cgroup, we are transferring that number instead of "unlimited".
      Unfortunately, changing VIR_DOMAIN_MEMORY_PARAM_UNLIMITED would break
      ABI compatibility and thus we have to resort to a different solution.
      
      With this patch every value greater than PARAM_UNLIMITED means
      "unlimited".  Even though this may seem misleading, we are already in
      such unclear situation when running 3.12 kernel with memory limits set
      to 2^63.
      
      One example showing most of the problems at once (with kernel 3.12.2):
       # virsh memtune asdf --hard-limit 9007199254740991 --swap-hard-limit -1
       # echo 12345678901234567890 >\
      /sys/fs/cgroup/memory/machine/asdf.libvirt-qemu/memory.soft_limit_in_bytes
       # virsh memtune asdf
       hard_limit     : 18014398509481983
       soft_limit     : 12056327051986884
       swap_hard_limit: 18014398509481983
      Signed-off-by: NMartin Kletzander <mkletzan@redhat.com>
      231656bb
  20. 06 12月, 2013 1 次提交
  21. 15 10月, 2013 2 次提交
  22. 09 10月, 2013 1 次提交
  23. 16 9月, 2013 2 次提交
  24. 12 9月, 2013 1 次提交
  25. 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
  26. 13 8月, 2013 3 次提交