From bf0c25e0780b249a68553ecaed974949d5162ff4 Mon Sep 17 00:00:00 2001 From: "jose.lausuch" Date: Thu, 24 Sep 2015 12:09:44 +0200 Subject: [PATCH] Add removing existing VMs in clean.sh There might be VMs leftovers sometimes, then, the command 'rmmod kvm_intel' fails. Change-Id: Iaacfa2182a8f867f5f28a79930f5520d9689156f Signed-off-by: jose.lausuch (cherry picked from commit 954b399b68e10fe668c6ff5e07fe1ac0654e97d3) --- common/ci/clean.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/common/ci/clean.sh b/common/ci/clean.sh index 4a21e1b..6bc39f5 100755 --- a/common/ci/clean.sh +++ b/common/ci/clean.sh @@ -244,6 +244,12 @@ else echo "${blue}libvirt/KVM is not installed${reset}" fi +###remove possible VMs (needed for 'rmmod kvm_intel') +if [ -n "$(ps -ef | grep qemu-kvm | grep -v grep)" ]; then + echo "${blue}Removing existing VMs ${reset}" + killall -9 qemu-kvm +fi + ###remove kernel modules echo "${blue}Removing kernel modules ${reset}" for kernel_mod in vboxnetadp vboxnetflt vboxpci vboxdrv kvm_intel kvm; do -- 2.16.6