]> git.ipfire.org Git - thirdparty/libvirt.git/commit
Make LXC container startup/shutdown/I/O more robust
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 22 Feb 2011 17:35:06 +0000 (17:35 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Tue, 15 Mar 2011 12:12:53 +0000 (12:12 +0000)
commit4e3117ae50efc0fcbd5ce485cd610dfab7f5c625
treef2d7e362925ce90c18d696ce0a4725f2883d725c
parentb16f47ab614ffd5dc37efb4c8581f57b8a2ce3c7
Make LXC container startup/shutdown/I/O more robust

The current LXC I/O controller looks for HUP to detect
when a guest has quit. This isn't reliable as during
initial bootup it is possible that 'init' will close
the console and let mingetty re-open it. The shutdown
of containers was also flakey because it only killed
the libvirt I/O controller and expected container
processes to gracefully follow.

Change the I/O controller such that when it see HUP
or an I/O error, it uses kill($PID, 0) to see if the
process has really quit.

Change the container shutdown sequence to use the
virCgroupKillPainfully function to ensure every
really goes away

This change makes the use of the 'cpu', 'devices'
and 'memory' cgroups controllers compulsory with
LXC

* docs/drvlxc.html.in: Document that certain cgroups
  controllers are now mandatory
* src/lxc/lxc_controller.c: Check if PID is still
  alive before quitting on I/O error/HUP
* src/lxc/lxc_driver.c: Use virCgroupKillPainfully
docs/drvlxc.html.in
src/lxc/lxc_controller.c
src/lxc/lxc_driver.c