vzctl destroy: handle the semi-mounted ploop

For some reason, sometimes ploop is left semi-mounted (i.e. ploop device
is present, but not mounted), and in such cases vzctl fails to destroy
CT private:

>  # vzctl destroy 4956949
> Destroying container private area: /vz/private/4956949
> Warning: failed to remove /vz/root/4956949: Device or resource busy
> Container private area was destroyed

Alternatively, such a semi-mounted container destroy might finish
without an error, but with the following "left-over":

> # ploop list -a
> ploop58446   /vz/vztmp/vzctl-rm-me.Po4uT1/root.hdd/root.hdd

In any case, let's check that ploop device is stopped before
proceeding.

Should fix #OVZ-6553

https://bugs.openvz.org/browse/OVZ-6553

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
1 file changed