]> git.ipfire.org Git - thirdparty/libvirt.git/commit
lxc: ensure libvirt_lxc and qemu-nbd move into systemd machine slice
authorDaniel P. Berrange <berrange@redhat.com>
Thu, 5 Jan 2017 15:26:00 +0000 (15:26 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Mon, 9 Jan 2017 12:46:52 +0000 (12:46 +0000)
commit44f79a0bd075b036091244aade14b73dd2859634
tree571aafa7365e23f433737a2a33c3c680ed0bd4ea
parent65fb0b79f7fc445d517f0071695255d38ddb0528
lxc: ensure libvirt_lxc and qemu-nbd move into systemd machine slice

Currently when spawning containers with systemd, the container PID 1
will get moved into the systemd machine slice. Libvirt then manually
moves the libvirt_lxc and qemu-nbd processes into the cgroups associated
with the slice, but skips the systemd controller cgroup. This means that
from systemd's POV, libvirt_lxc and qemu-nbd are still part of the
libvirtd.service unit.

On systemctl daemon-reload, it will notice that libvirt_lxc & qemu-nbd
are in the libvirtd.service unit for the systemd controller, but in the
machine cgroups for resources. Systemd will thus move them back into
the libvirtd.service resource cgroups next time libvirtd is restarted.
This causes libvirtd to kill off the container due to incorrect cgroup
placement.

The solution is to ensure that when moving libvirt_lxc & qemu-nbd, we
also move the systemd cgroup controller placement. Normally this is
not something we ever want todo, but this is a special case as we are
intentionally wanting to move them to a different systemd unit.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/libvirt_private.syms
src/lxc/lxc_controller.c
src/util/vircgroup.c
src/util/vircgroup.h