Re: [PATCH 12/16] LXC from native: map lxc.cgroup.cpuset.*

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 14, 2014 at 02:50:01PM +0100, Cédric Bosdonnat wrote:
> ---
>  src/lxc/lxc_native.c                               | 27 ++++++++++++++++
>  .../lxcconf2xmldata/lxcconf2xml-cpusettune.config  |  8 +++++
>  tests/lxcconf2xmldata/lxcconf2xml-cpusettune.xml   | 36 ++++++++++++++++++++++
>  tests/lxcconf2xmltest.c                            |  1 +
>  4 files changed, 72 insertions(+)
>  create mode 100644 tests/lxcconf2xmldata/lxcconf2xml-cpusettune.config
>  create mode 100644 tests/lxcconf2xmldata/lxcconf2xml-cpusettune.xml
> 
> diff --git a/src/lxc/lxc_native.c b/src/lxc/lxc_native.c
> index 80b7e74..635eb89 100644
> --- a/src/lxc/lxc_native.c
> +++ b/src/lxc/lxc_native.c
> @@ -812,6 +812,29 @@ lxcSetCpuTune(virDomainDefPtr def, virPropertiesPtr properties)
>      return 0;
>  }
>  
> +static int
> +lxcSetCpusetTune(virDomainDefPtr def, virPropertiesPtr properties)
> +{
> +    char *value;

BTW this should be 'const' throughout this series

> +
> +    if ((value = virPropertiesLookup(properties, "lxc.cgroup.cpuset.cpus"))) {
> +        if (virBitmapParse(value, 0, &def->cpumask, VIR_DOMAIN_CPUMASK_LEN) < 0)
> +            return -1;
> +
> +        def->placement_mode = VIR_DOMAIN_CPU_PLACEMENT_MODE_STATIC;
> +    }
> +
> +    if ((value = virPropertiesLookup(properties, "lxc.cgroup.cpuset.mems"))) {
> +        def->numatune.memory.placement_mode = VIR_NUMA_TUNE_MEM_PLACEMENT_MODE_STATIC;
> +        def->numatune.memory.mode = VIR_DOMAIN_NUMATUNE_MEM_STRICT;
> +        if (virBitmapParse(value, 0, &def->numatune.memory.nodemask,
> +                           VIR_DOMAIN_CPUMASK_LEN) < 0)
> +            return -1;
> +    }
> +
> +    return 0;
> +}


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]