Lines Matching refs:vmp
255 void kvm_vm_restart(struct kvm_vm *vmp, int perm) in kvm_vm_restart() argument
259 vm_open(vmp, perm); in kvm_vm_restart()
260 if (vmp->has_irqchip) in kvm_vm_restart()
261 vm_create_irqchip(vmp); in kvm_vm_restart()
263 for (region = vmp->userspace_mem_region_head; region; in kvm_vm_restart()
265 int ret = ioctl(vmp->fd, KVM_SET_USER_MEMORY_REGION, ®ion->region); in kvm_vm_restart()
427 void kvm_vm_release(struct kvm_vm *vmp) in kvm_vm_release() argument
431 while (vmp->vcpu_head) in kvm_vm_release()
432 vm_vcpu_rm(vmp, vmp->vcpu_head->id); in kvm_vm_release()
434 ret = close(vmp->fd); in kvm_vm_release()
436 " vmp->fd: %i rc: %i errno: %i", vmp->fd, ret, errno); in kvm_vm_release()
438 close(vmp->kvm_fd); in kvm_vm_release()
440 " vmp->kvm_fd: %i rc: %i errno: %i", vmp->kvm_fd, ret, errno); in kvm_vm_release()
446 void kvm_vm_free(struct kvm_vm *vmp) in kvm_vm_free() argument
450 if (vmp == NULL) in kvm_vm_free()
454 while (vmp->userspace_mem_region_head) { in kvm_vm_free()
456 = vmp->userspace_mem_region_head; in kvm_vm_free()
459 ret = ioctl(vmp->fd, KVM_SET_USER_MEMORY_REGION, in kvm_vm_free()
464 vmp->userspace_mem_region_head = region->next; in kvm_vm_free()
474 sparsebit_free(&vmp->vpages_valid); in kvm_vm_free()
475 sparsebit_free(&vmp->vpages_mapped); in kvm_vm_free()
477 kvm_vm_release(vmp); in kvm_vm_free()
480 free(vmp); in kvm_vm_free()