]> xenbits.xensource.com Git - libvirt.git/commit
Create + setup cgroups atomically for LXC process
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 22 Jul 2013 15:36:06 +0000 (16:36 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 23 Jul 2013 21:46:31 +0000 (22:46 +0100)
commitda704c8782721cc543f9d230e9933fe12ad25e42
tree0d76fe2c59b12f7800adeabe4928cd852366fc30
parent2049ef99425db33f1e66fa8e184d153231096d83
Create + setup cgroups atomically for LXC process

Currently the LXC driver creates the VM's cgroup prior to
forking, and then libvirt_lxc moves the child process
into the cgroup. This won't work with systemd whose APIs
do the creation of cgroups + attachment of processes atomically.

Fortunately we simply move the entire cgroups setup into
the libvirt_lxc child process. We make it take place before
fork'ing into the background, so by the time virCommandRun
returns in the LXC driver, the cgroup is guaranteed to be
present.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/lxc/lxc_controller.c
src/lxc/lxc_process.c