• Michael S. Tsirkin's avatar
    cgroups: fix API thinko · 73457f0f
    Michael S. Tsirkin authored
    cgroup_attach_task_current_cg API that have upstream is backwards: we
    really need an API to attach to the cgroups from another process A to
    the current one.
    
    In our case (vhost), a priveledged user wants to attach it's task to cgroups
    from a less priveledged one, the API makes us run it in the other
    task's context, and this fails.
    
    So let's make the API generic and just pass in 'from' and 'to' tasks.
    Add an inline wrapper for cgroup_attach_task_current_cg to avoid
    breaking bisect.
    Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
    Acked-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
    Acked-by: default avatarPaul Menage <menage@google.com>
    73457f0f
cgroup.c 127 KB