diff options
author | Alexandru Avadanii <Alexandru.Avadanii@enea.com> | 2017-07-26 19:06:31 +0200 |
---|---|---|
committer | Alexandru Avadanii <Alexandru.Avadanii@enea.com> | 2017-07-26 19:06:31 +0200 |
commit | 346b0c0856ed53525e4d97cd06f3b8a9423d05f2 (patch) | |
tree | f0366e756c63f0c56f7203f0d1fa2c971ba8bf7e /mcp | |
parent | 4651bb2a7257be49c9ca6ce5c959de66e6800005 (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')
-rw-r--r-- | mcp/scripts/lib.sh | 6 |
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 } |