Stop upstream containers by killing all processes.

We can't stop a container cleanly from the outside, because we can't
join the container's PID namespace and issue a reboot from there.
Calling reboot from the inside works, but we can't trust the container
to have a working networking at all times.

The approach we take, is to warn about this fact if a stop is tried, and
have something that albeit hackish, works for the --fast option.

We'll do this by hooking at h->destroy(). This pointer should have
already been included in env_stop(), but it wasn't (probably a merge
problem). In any case, it will figure here in a slightly different place
there it should be. When this is properly fixed in the kernel, h->stop()
should be called for both --fast and the normal operation mode.

[kir@: error message improved, add function prototype]

Signed-off-by: Glauber Costa <glommer@parallels.com>
Signed-off-by: Kir Kolyshkin <kir@openvz.org>
4 files changed