mirror of
https://github.com/opnsense/src.git
synced 2026-06-06 23:32:52 -04:00
vmm: Unify implementations of vcpu_cleanup()
Different vmm implementations were freeing the per-vCPU structure in different places. Make the implementations consistent. No functional change intended. Reviewed by: corvink MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D53010 (cherry picked from commit 756fa1c09673ba555f603574af5943f455daff90)
This commit is contained in:
parent
6e1f47765d
commit
a0b365dad4
2 changed files with 2 additions and 4 deletions
|
|
@ -274,6 +274,7 @@ vcpu_cleanup(struct vcpu *vcpu, bool destroy)
|
|||
vmm_stat_free(vcpu->stats);
|
||||
fpu_save_area_free(vcpu->guestfpu);
|
||||
vcpu_lock_destroy(vcpu);
|
||||
free(vcpu, M_VMM);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -585,8 +586,6 @@ vm_cleanup(struct vm *vm, bool destroy)
|
|||
vmmops_vmspace_free(vm->vmspace);
|
||||
vm->vmspace = NULL;
|
||||
|
||||
for (i = 0; i < vm->maxcpus; i++)
|
||||
free(vm->vcpu[i], M_VMM);
|
||||
free(vm->vcpu, M_VMM);
|
||||
sx_destroy(&vm->vcpus_init_lock);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -174,6 +174,7 @@ vcpu_cleanup(struct vcpu *vcpu, bool destroy)
|
|||
vmm_stat_free(vcpu->stats);
|
||||
fpu_save_area_free(vcpu->guestfpu);
|
||||
vcpu_lock_destroy(vcpu);
|
||||
free(vcpu, M_VMM);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -453,8 +454,6 @@ vm_cleanup(struct vm *vm, bool destroy)
|
|||
vmmops_vmspace_free(vm->vmspace);
|
||||
vm->vmspace = NULL;
|
||||
|
||||
for (i = 0; i < vm->maxcpus; i++)
|
||||
free(vm->vcpu[i], M_VMM);
|
||||
free(vm->vcpu, M_VMM);
|
||||
sx_destroy(&vm->vcpus_init_lock);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue