testing: Ensure no guest is running when modifying images
Sometimes guests are not stopped properly. If images are then modified they will be corrupted.
This commit is contained in:
@@ -156,6 +156,18 @@ check_commands()
|
||||
done
|
||||
}
|
||||
|
||||
# check if any of the given virtual guests are running
|
||||
# $* - names of guests to check
|
||||
running_any()
|
||||
{
|
||||
command -v virsh >/dev/null || return 1
|
||||
for host in $*
|
||||
do
|
||||
virsh list --name | grep "^$host$" >/dev/null && return 0
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
#############################################
|
||||
# search and replace strings throughout a
|
||||
# whole directory
|
||||
|
||||
Reference in New Issue
Block a user