summaryrefslogtreecommitdiffstats
path: root/mcp/scripts/lib.sh
diff options
context:
space:
mode:
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>2017-07-26 19:06:31 +0200
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>2017-07-26 19:06:31 +0200
commit346b0c0856ed53525e4d97cd06f3b8a9423d05f2 (patch)
treef0366e756c63f0c56f7203f0d1fa2c971ba8bf7e /mcp/scripts/lib.sh
parent4651bb2a7257be49c9ca6ce5c959de66e6800005 (diff)
lib.sh: cleanup_vms: Also remove VMs that use UEFI
Pass `--nvram` to `virsh undefine`, so guest VMs booted using UEFI (OVMF on x86 or AAVMF on AArch64) can be destroyed. This does not affect VMs without UEFI. While at it, fix logical error in previous commit adding support for cleaning up stopped VMs. Change-Id: I44c20566469f29a8683d81e3641c69da572ccd4e Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
Diffstat (limited to 'mcp/scripts/lib.sh')
-rw-r--r--mcp/scripts/lib.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/mcp/scripts/lib.sh b/mcp/scripts/lib.sh
index 6fa330ab7..3ec596a48 100644
--- a/mcp/scripts/lib.sh
+++ b/mcp/scripts/lib.sh
@@ -16,9 +16,11 @@ get_base_image() {
cleanup_vms() {
# clean up existing nodes
- for node in $(virsh list --name --all | grep -P '\w{3}\d{2}'); do
+ for node in $(virsh list --name | grep -P '\w{3}\d{2}'); do
virsh destroy $node
- virsh undefine $node
+ done
+ for node in $(virsh list --name --all | grep -P '\w{3}\d{2}'); do
+ virsh undefine --nvram $node
done
}