mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-10-31 10:23:09 +00:00
1051c23b51
This is the bug I'm facing. I deliberately configured a container so that the source of a <filesystem/> to passthrough doesn't exist. The start fails with: lxcContainerPivotRoot:669 : Failed to create /non-existent/path/.oldroot: Permission denied which is expected. But what is NOT expected is that CGroup hierarchy is left behind. This is because the controller sets up the CGroup hierarchy, user namespace, moves interfaces, etc. and finally checks whether container setup (done in a separate process) succeeded. Only after all this the error is propagated to the LXC driver. The driver aborts the startup and tries to perform the cleanup, but this is missing CGroups because those weren't detected yet. Ideally, whenever a function fails, it tries to unroll back so that is has no artifacts left behind (look at all those frees/FD closes/etc. at end of functions). But with CGroups it is different - the controller process can't clean up after itself, because it is still running inside that CGroup. Therefore, what we have to do is to let the driver detect CGroups as soon as they are created, and proceed with controller execution only after that. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Martin Kletzander <mkletzan@redhat.com> |
||
---|---|---|
.. | ||
libvirtd_lxc.aug | ||
lxc_cgroup.c | ||
lxc_cgroup.h | ||
lxc_conf.c | ||
lxc_conf.h | ||
lxc_container.c | ||
lxc_container.h | ||
lxc_controller.c | ||
lxc_domain.c | ||
lxc_domain.h | ||
lxc_driver.c | ||
lxc_driver.h | ||
lxc_fuse.c | ||
lxc_fuse.h | ||
lxc_hostdev.c | ||
lxc_hostdev.h | ||
lxc_monitor_protocol.x | ||
lxc_monitor.c | ||
lxc_monitor.h | ||
lxc_native.c | ||
lxc_native.h | ||
lxc_process.c | ||
lxc_process.h | ||
lxc.conf | ||
meson.build | ||
test_libvirtd_lxc.aug.in | ||
virtlxcd.init.in | ||
virtlxcd.service.in | ||
virtlxcd.sysconf |