linux/virt/kvm/arm/arm.c
/**
 * kvm_arch_destroy_vm - destroy the VM data structure
 * @kvm:	pointer to the KVM struct
 */
destroy the VM data structure
@kvm:        pointer to the KVM struct
destroy the VM data structure @kvm : pointer to the KVM struct
void kvm_arch_destroy_vm(struct kvm *kvm)
{
	int i;
	kvm_vgic_destroy(kvm);
	free_percpu(kvm->arch.last_vcpu_ran);
	kvm->arch.last_vcpu_ran = NULL;
	for (i = 0; i < KVM_MAX_VCPUS; ++i) {
		if (kvm->vcpus[i]) {
			kvm_arch_vcpu_free(kvm->vcpus[i]);
			kvm->vcpus[i] = NULL;
		}
	}
	atomic_set(&kvm->online_vcpus, 0);
}
void kvm_arch_destroy_vm ( struct kvm * kvm ) { int i ; kvm_vgic_destroy ( kvm ) ; free_percpu ( kvm -> arch . last_vcpu_ran ) ; kvm -> arch . last_vcpu_ran = NULL ; for ( i = 0 ; i < KVM_MAX_VCPUS ; ++ i ) { if ( kvm -> vcpus [ i ] ) { kvm_arch_vcpu_free ( kvm -> vcpus [ i ] ) ; kvm -> vcpus [ i ] = NULL ; } } atomic_set ( & kvm -> online_vcpus , 0 ) ; }
kvm_arch_destroy_vm - destroy the VM data structure
 @kvm:        pointer to the KVM struct
kvm_arch_destroy_vm - destroy the VM data structure @kvm : pointer to the KVM struct