• Tycho Andersen's avatar
    cg: add --cgroup-root option · 94f6c87c
    Tycho Andersen authored
    The motivation for this is to be able to restore containers into cgroups other
    than what they were dumped in (if, e.g. they might conflict with an existing
    container). Suppose you have a container in:
    
    memory:/mycontainer
    cpuacct,cpu:/mycontainer
    blkio:/mycontainer
    name=systemd:/mycontainer
    
    You could then restore them to /mycontainer2 via --cgroup-root /mycontainer2.
    If you want to restore different controllers to different paths, you can
    provide multiple arguments, for example, passing:
    
    --cgroup-root /mycontainer2 --cgroup-root cpuacct,cpu:/specialcpu \
    --cgroup-root name=systemd:/specialsystemd
    
    Would result in things being restored to:
    
    memory:/mycontainer2
    cpuacct,cpu:/specialcpu
    blkio:/mycontainer2
    name=systemd:/specialsystemd
    
    i.e. a --cgroup-root without a controller prefix specifies the new default root
    for all cgroups.
    Signed-off-by: 's avatarTycho Andersen <tycho.andersen@canonical.com>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
    94f6c87c
cgroup.h 1.42 KB