diff options
author | Simon Rettberg | 2024-07-16 11:50:28 +0200 |
---|---|---|
committer | Simon Rettberg | 2024-07-16 11:50:28 +0200 |
commit | 026cb101c1d87bdc47297d34dc09eb420698a747 (patch) | |
tree | 0e8ad5662b66df32b715962cf063fc6a26398789 | |
parent | [pvs2] Update debug report URL (diff) | |
download | mltk-026cb101c1d87bdc47297d34dc09eb420698a747.tar.gz mltk-026cb101c1d87bdc47297d34dc09eb420698a747.tar.xz mltk-026cb101c1d87bdc47297d34dc09eb420698a747.zip |
[qemu] Fix concurrent modification error
-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(); |