From 346b0c0856ed53525e4d97cd06f3b8a9423d05f2 Mon Sep 17 00:00:00 2001 From: Alexandru Avadanii Date: Wed, 26 Jul 2017 19:06:31 +0200 Subject: [PATCH] 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 --- mcp/scripts/lib.sh | 6 ++++-- 1 file 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 } -- 2.16.6