KVM: Check instances for actual liveness
authorGuido Trotter <ultrotter@google.com>
Mon, 22 Mar 2010 11:08:50 +0000 (11:08 +0000)
committerGuido Trotter <ultrotter@google.com>
Mon, 22 Mar 2010 18:06:25 +0000 (18:06 +0000)
commit263b8de67f923b3484f42b937410a13c9cc85e86
treec5fe3c41a77b53d89050dbe96953ae751c64afe7
parent4fbb3c60ca51c478323a06f5fa3bffbf0e73ad1f
KVM: Check instances for actual liveness

Currently if we find a live process with the pid we saved we assume kvm
is alive. What could happen, though, is that the pidfile has been
reused.

In order to avoid that we change the check to make sure, everywhere,
that the process we see is our actual kvm process. In order to do so we
open its cmdline, and check that it contains the correct instance name
in the -name argument passed to kvm.

Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
lib/hypervisor/hv_kvm.py