diff options
-rw-r--r-- | core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/virtualization/LibvirtHypervisor.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/virtualization/LibvirtHypervisor.java b/core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/virtualization/LibvirtHypervisor.java index 757fc706..18cf38e8 100644 --- a/core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/virtualization/LibvirtHypervisor.java +++ b/core/modules/qemu/runvirt-plugin-qemu/src/main/java/org/openslx/runvirt/virtualization/LibvirtHypervisor.java @@ -191,8 +191,9 @@ public abstract class LibvirtHypervisor implements Closeable public void close() { // deregister all VMs defined on the hypervisor - for ( LibvirtVirtualMachine vm : this.machines ) { + for ( LibvirtVirtualMachine vm : new ArrayList<>( this.machines ) ) { try { + // This modifies this.machines, so make a copy above this.deregisterVm( vm ); } catch ( LibvirtHypervisorException | LibvirtVirtualMachineException e ) { e.printStackTrace(); |