my friends advised me to add this if

This commit is contained in:
ghe0 2025-03-10 02:15:43 +02:00
parent 4689ab82c7
commit 4e6277aed7
Signed by: ghe0
GPG Key ID: 451028EE56A0FBB4

@ -289,7 +289,7 @@ impl Resources {
} }
fn free_vm_resources(&mut self, vm: &VM) { fn free_vm_resources(&mut self, vm: &VM) {
if self.existing_vms.remove(&vm.uuid) { if !self.existing_vms.remove(&vm.uuid) {
return; return;
} }
self.reserved_vcpus = self.reserved_vcpus.saturating_sub(vm.vcpus); self.reserved_vcpus = self.reserved_vcpus.saturating_sub(vm.vcpus);