1. 30 6月, 2010 1 次提交
    • R
      cgroup: Add missing errno == ENOENT check in virCgroupRemoveRecursively · adc796c8
      Ryota Ozaki 提交于
      ENOENT happens normally when a subsystem is enabled with any other
      subsystems and the directory of the target group has already removed
      in a prior loop. In that case, the function should just return without
      leaving an error message.
      
      NB this is the same behavior as before introducing virCgroupRemoveRecursively.
      adc796c8
  2. 25 6月, 2010 1 次提交
    • D
      Set labelling for character devices in security drivers · 2bad82f7
      Daniel P. Berrange 提交于
      When configuring serial, parallel, console or channel devices
      with a file, dev or pipe backend type, it is necessary to label
      the file path in the security drivers. For char devices of type
      file, it is neccessary to pre-create (touch) the file if it does
      not already exist since QEMU won't be allowed todo so itself.
      dev/pipe configs already require the admin to pre-create before
      starting the guest.
      
      * src/qemu/qemu_security_dac.c: set file ownership for character
        devices
      * src/security/security_selinux.c: Set file labeling for character
        devices
      * src/qemu/qemu_driver.c: Add character devices to cgroup ACL
      2bad82f7
  3. 24 6月, 2010 2 次提交
    • R
      cgroup: Enable memory.use_hierarchy of cgroup for domain · 4a4eb13e
      Ryota Ozaki 提交于
      Through conversation with Kumar L Srikanth-B22348, I found
      that the function of getting memory usage (e.g., virsh dominfo)
      doesn't work for lxc with ns subsystem of cgroup enabled.
      
      This is because of features of ns and memory subsystems.
      Ns creates child cgroup on every process fork and as a result
      processes in a container are not assigned in a cgroup for
      domain (e.g., libvirt/lxc/test1/). For example, libvirt_lxc
      and init (or somewhat specified in XML) are assigned into
      libvirt/lxc/test1/8839/ and libvirt/lxc/test1/8839/8849/,
      respectively. On the other hand, memory subsystem accounts
      memory usage within a group of processes by default, i.e.,
      it does not take any child (and descendant) groups into
      account. With the two features, virsh dominfo which just
      checks memory usage of a cgroup for domain always returns
      zero because the cgroup has no process.
      
      Setting memory.use_hierarchy of a group allows to account
      (and limit) memory usage of every descendant groups of the group.
      By setting it of a cgroup for domain, we can get proper memory
      usage of lxc with ns subsystem enabled. (To be exact, the
      setting is required only when memory and ns subsystems are
      enabled at the same time, e.g., mount -t cgroup none /cgroup.)
      4a4eb13e
    • R
      cgroup: Change virCgroupRemove to remove all descendant groups at first · 842b51ff
      Ryota Ozaki 提交于
      As same as normal directories, a cgroup cannot be removed if it
      contains sub groups. This patch changes virCgroupRemove to remove
      all descendant groups (subdirectories) of a target group before
      removing the target group.
      
      The handling is required when we run lxc with ns subsystem of cgroup.
      Ns subsystem automatically creates child cgroups on every process
      forks, but unfortunately the groups are not removed on process exits,
      so we have to remove them by ourselves.
      
      With this patch, such child (and descendant) groups are surely removed
      at lxc shutdown, i.e., lxcVmCleanup which calls virCgroupRemove.
      842b51ff
  4. 21 5月, 2010 2 次提交
  5. 04 5月, 2010 1 次提交
  6. 24 4月, 2010 1 次提交
  7. 01 4月, 2010 1 次提交
    • M
      cgroup: Replace sscanf with virStrToLong_ll · 73b45bfb
      Matthias Bolte 提交于
      The switch from %lli to %lld in virCgroupGetValueI64 is intended,
      as virCgroupGetValueU64 uses base 10 too, and virCgroupSetValueI64
      uses %lld to format the number to string.
      
      Parsing is stricter now and doesn't accept trailing characters
      after the actual value anymore.
      73b45bfb
  8. 22 3月, 2010 1 次提交
    • J
      Avoid libvirtd crash when cgroups is not configured on host · 09fafa1e
      Jim Fehlig 提交于
      Invoking virDomainSetMemory() on lxc driver results in libvirtd
      segfault when cgroups has not been configured on the host.
      
      Ensure driver->cgroup is non-null before invoking
      virCgroupForDomain().  To prevent similar segfaults in the future,
      ensure driver parameter to virCgroupForDomain() is non-null before
      dereferencing.
      09fafa1e
  9. 10 3月, 2010 1 次提交
  10. 05 3月, 2010 1 次提交
  11. 09 2月, 2010 1 次提交
  12. 05 2月, 2010 2 次提交
  13. 13 11月, 2009 1 次提交
    • D
      Fix check for existance of cgroups at creation · d11d93f4
      Daniel P. Berrange 提交于
      In the scenario where the cgroups were mounted but the
      particular group did not exist, and the caller had not
      requested auto-creation, the code would fail to return
      an error condition. This caused the lxc_controller to
      think the cgroup existed, and it then later failed when
      attempting to use it
      
      * src/util/cgroup.c: Raise an error if the cgroup path does not
        exist
      d11d93f4
  14. 19 10月, 2009 1 次提交
    • R
      LXC fix virCgroupGetValueStr problem with \n · 41fa653f
      Ryota Ozaki 提交于
      A cgroup file returns integer value terminated with '\n' and remaining
      it has sometimes harmful effects, for example it leads virStrToLong_ull
      to fail.
      * src/util/cgroup.c: strip out terminating \n when reading a value
      41fa653f
  15. 08 10月, 2009 2 次提交
  16. 07 10月, 2009 1 次提交
    • R
      LXC implement memory control APIs · 3a05dc09
      Ryota Ozaki 提交于
      The patch implements the missing memory control APIs for lxc, i.e.,
      domainGetMaxMemory, domainSetMaxMemory, domainSetMemory, and improves
      domainGetInfo to return proper amount of used memory via cgroup.
      
      * src/libvirt_private.syms: Export virCgroupGetMemoryUsage
        and add missing virCgroupSetMemory
      * src/lxc/lxc_driver.c: Implement missing memory functions
      * src/util/cgroup.c, src/util/cgroup.h: Add the function
        to get used memory
      3a05dc09
  17. 22 9月, 2009 1 次提交
    • R
      lxc: suspend/resume support · c8c9ef27
      Ryota Ozaki 提交于
      * src/conf/domain_conf.c: Don't assume all virDomainObjPtr have
        a non-NULL monitor_chr field in virDomainObjFormat.
      * src/lxc/lxc_driver.c: Implement suspend/resume driver APis
      * src/util/cgroup.c, src/util/cgroup.h: Support the 'freezer'
        cgroup controller
      * src/libvirt_private.syms: Export virCgroupSetFreezerState
        and virCgroupGetFreezerState
      c8c9ef27
  18. 21 9月, 2009 1 次提交
    • D
      Move all shared utility files to src/util/ · 1355e055
      Daniel P. Berrange 提交于
      * src/bridge.c, src/bridge.h, src/buf.c, src/buf.h, src/cgroup.c,
        src/cgroup.h, src/conf.c, src/conf.h, src/event.c, src/event.h,
        src/hash.c, src/hash.h, src/hostusb.c, src/hostusb.h,
        src/iptables.c, src/iptables.h, src/logging.c, src/logging.h,
        src/memory.c, src/memory.h, src/pci.c, src/pci.h, src/qparams.c,
        src/qparams.h, src/stats_linux.c, src/stats_linux.h,
        src/threads-pthread.c, src/threads-pthread.h, src/threads-win32.c,
        src/threads-win32.h, src/threads.c, src/threads.h, src/util.c,
        src/util.h, src/uuid.c, src/uuid.h, src/virterror.c,
        src/virterror_internal.h, src/xml.c, src/xml.h: Move all files
        into src/util/
      * daemon/Makefile.am: Add -Isrc/util/ to build flags
      * src/Makefile.am: Add -Isrc/util/ to build flags and update for
        moved files
      * src/libvirt_private.syms: Export cgroup APIs since they're now
        in util rather than linking directly to drivers
      * src/xen/xs_internal.c: Disable bogus virEventRemoveHandle call
        when built under PROXY
      * proxy/Makefile.am: Update for changed file locations. Remove
        bogus build of event.c
      * tools/Makefile.am, tests/Makefile.am: Add -Isrc/util/ to build flags
      1355e055
  19. 24 7月, 2009 6 次提交
    • D
      Fix cgroup compile warnings · 1112330e
      Daniel P. Berrange 提交于
      * src/cgroup.c: Fix cast to uint64 from unsigned long long
      1112330e
    • D
      Make QEMU cgroups use configurable · f4c3acdf
      Daniel P. Berrange 提交于
       * qemud/libvirtd_qemu.aug, qemud/test_libvirtd_qemu.aug,
         src/qemu.conf: Add 'cgroups_controllers' and 'cgroups_device_acl'
         parameters
       * src/qemu_conf.h, src/qemu_conf.c: Load & parse configuration params
         for cgroups
       * src/qemu_driver.c: Only use cgroups controllers that are activated,
         and use configured device whitelist instead of default, if set.
      f4c3acdf
    • D
      Use cgroups for block device whitelisting in QEMU guests · e88d638a
      Daniel P. Berrange 提交于
      * src/qemu_driver.c: Set a restrictive block device whitelist for
        all QEMU guests. Update whitelist when hotplugging disks.
      * src/cgroup.h, src/cgroup.c: Add some more convenience methods
        for dealing with block device whitelists.
      e88d638a
    • D
      Implement schedular tunables API using cgroups · 55bc5090
      Daniel P. Berrange 提交于
      * src/qemu_driver.c:  Add driver methods qemuGetSchedulerType,
        qemuGetSchedulerParameters, qemuSetSchedulerParameters
      * src/lxc_driver.c: Fix to use unsigned long long consistently
        for schedular parameters
      * src/cgroup.h, src/cgroup.c: Fix cpu_shares to take unsigned
        long long
      * src/util.c, src/util.h, src/libvirt_private.syms: Add a
        virStrToDouble helper
      * src/virsh.c: Fix handling of --set arg to schedinfo command
        to honour the designated data type of each schedular tunable
        as declared by the driver
      55bc5090
    • D
      Refactor cgroups to allow a group per driver to be managed directly · 946c489c
      Daniel P. Berrange 提交于
      Allow the driver level cgroup to be managed explicitly by the
      hypervisor drivers, in order to detect whether to enable or
      disable cgroup support for domains. Provides better error
      reporting of failures. Also allow for creation of cgroups for
      unprivileged drivers if controller is accessible by the user.
      
      * src/cgroup.c, src/cgroup.h: Add an API to obtain a driver cgroup
      * src/lxc_conf.h, src/lxc_controller.c, src/lxc_driver.c:
        Obtain a driver cgroup at startup and use that instead of
        re-creating everytime.
      * src/util.c, src/util.h, src/libvirt_private.syms: Add a
        virGetUserName() helper
      946c489c
    • D
      Make cgroups a little more efficient · de1ecd53
      Daniel P. Berrange 提交于
      * src/cgroup.c: Detect the mount location of every controller at
        time a virCgroupPtr is created. Detect current process' placement
        within group to avoid assuming it is in the root. Pass controller
        ID into SetValueStr/GetValueStr to enable much duplicated code to
        be eliminated
      de1ecd53
  20. 23 7月, 2009 2 次提交
  21. 08 5月, 2009 1 次提交
  22. 16 3月, 2009 1 次提交
  23. 06 3月, 2009 1 次提交
  24. 06 2月, 2009 1 次提交
    • J
      remove useless code · a9aa76ba
      Jim Meyering 提交于
      * src/bridge.c (brAddTap): Remove redundant errno=ENOMEM assignment
      after failed strdup.
      * src/cgroup.c (virCgroupFree): Remove redundant *group=NULL assignment
      after VIR_FREE(*group).
      * src/lxc_driver.c (lxcShutdown): Likewise.
      * src/xen_unified.c (xenUnifiedClose): Likewise.
      * src/xm_internal.c (xenXMDomainConfigFormat): Rewrite disk-
      and net-config-setting code to be clearer.
      a9aa76ba
  25. 23 12月, 2008 1 次提交
  26. 07 11月, 2008 1 次提交
    • D
      add new logging module, and move existing definitions there · df93e1ee
      Daniel Veillard 提交于
      * src/logging.c src/logging.h proxy/Makefile.am proxy/libvirt_proxy.c
        src/Makefile.am src/cgroup.c src/datatypes.c src/domain_event.c
        src/internal.h src/libvirt.c src/lxc_container.c src/lxc_controller.c
        src/lxc_driver.c src/proxy_internal.c src/qemu_driver.c
        src/remote_internal.c src/storage_backend_disk.c src/util.c
        src/veth.c src/xen_internal.c src/xen_unified.c src/xend_internal.c:
        add new logging module, and move existing definitions there
      Daniel
      df93e1ee
  27. 22 10月, 2008 1 次提交
  28. 09 10月, 2008 1 次提交
  29. 08 10月, 2008 2 次提交