]> xenbits.xensource.com Git - libvirt.git/commit
Create + setup cgroups atomically for QEMU process
authorDaniel P. Berrange <berrange@redhat.com>
Mon, 22 Jul 2013 14:21:15 +0000 (15:21 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 23 Jul 2013 21:46:31 +0000 (22:46 +0100)
commit2049ef99425db33f1e66fa8e184d153231096d83
treee809bafb861e42a2abc112855128478d7d25bec2
parentd64e852b5aa84eb070c6380e5d423b781f13e9b5
Create + setup cgroups atomically for QEMU process

Currently the QEMU driver creates the VM's cgroup prior to
forking, and then uses a virCommand hook to move the child
into the cgroup. This won't work with systemd whose APIs
do the creation of cgroups + attachment of processes atomically.

Fortunately we have a handshake taking place between the
QEMU driver and the child process prior to QEMU being exec()d,
which was introduced to allow setup of disk locking. By good
fortune this synchronization point can be used to enable the
QEMU driver to do atomic setup of cgroups removing the use
of the hook script.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/qemu/qemu_cgroup.c
src/qemu/qemu_process.c