| 
     
      
      
      From: Jan S. <jsa...@us...> - 2014-09-15 13:34:03
      
     
   | 
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "This is the main upstream repository of the libcgroup project. All releases".
The branch, master has been updated
       via  691430206f1104b752b0e52386f317e639137788 (commit)
      from  204bc8c27e50fb7a43d7a9b9ccb3b91a8eda563e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 691430206f1104b752b0e52386f317e639137788
Author: Jan Chaloupka <jch...@re...>
Date:   Mon Sep 15 13:29:39 2014 +0200
    api.c: support for setting multiline values in control files
    
    As of now, libcgroup does not support multiline values setting from configuration files. i.e. values in a form:
    
    net_prio.ifpriomap="lo 7
    eth0 66
    eth1 5
    eth2 4
    eth3 3";
    
    Thus, setting of more network interfaces can not be done from configuration file. Or
    
    devices.allow="a *:* w
    c 8:* r";
    
    thus setting list of allow devices can not be set as well. The only way is to set it from userspace, e.g.:
    # echo "lo 7" > /sys/fs/cgroup/net_prio/testGroup/net_prio.ifpriomap
    # echo "eth 0" > /sys/fs/cgroup/net_prio/testGroup/net_prio.ifpriomap
    # echo "eth 1" > /sys/fs/cgroup/net_prio/testGroup/net_prio.ifpriomap
    # echo "eth 2" > /sys/fs/cgroup/net_prio/testGroup/net_prio.ifpriomap
    # echo "eth 3" > /sys/fs/cgroup/net_prio/testGroup/net_prio.ifpriomap
    
    This patch allows setting of multiline variables.
    
    How this support works:
    Multiline value is broken in lines and each line is set by write (man 2 write) syscall (without bufferring).
    This implies change of fopen with open, fclose with close.
    There is no control on multiline value, thus "eth0\n  \t\n" can be set. However, setting
    of "  \t" will fail as write command returns -1. Thus administrator has to set correct
    multiline values.
    
    Tested on virtual machine with fedora and rhel with network interface lo, eth0-eth3. Configuration file:
    
    # cat /etc/cgconfig.conf
    group testGroup {
            net_prio {
                    net_prio.ifpriomap="lo 7
    eth0    66
    eth1 5
    eth2 4
    eth3 3";
            }
    }
    
    net_prio has to be created before:
    # modprobe netprio_cgroup
    # mkdir /sys/fs/cgroup/net_prio
    # mount -t cgroup -onet_prio none /sys/fs/cgroup/net_prio
    
    Changelog:
    	test of success of strdup call
    	free str_val before return (str_val is changing in while cycle,
    		thus str_start_val points to the start of str_val before while)
    
    Signed-off-by: Jan Chaloupka <jch...@re...>
-----------------------------------------------------------------------
Summary of changes:
 src/api.c |   50 ++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 44 insertions(+), 6 deletions(-)
hooks/post-receive
-- 
This is the main upstream repository of the libcgroup project. All releases
 |