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

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



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 :|


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