KVM: selftests: Rename vm_open() to __vm_create()
PATCH 1/1 KVM: selftests: Rename vm_open() to __vm_create()
vm_open() actually creates the VM by opening the KVM device and calling KVM_CREATE_VM ioctl, so it is semantically more correct to call it __vm_create().
--- tools/testing/selftests/kvm/lib/kvm_util.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
tools/testing/selftests/kvm/lib/kvm_util.c +3 -3
@@ -151,7 +151,7 @@ void vm_enable_dirty_ring(struct kvm_vm *vm, uint32_t ring_size) vm->dirty_ring_size = ring_size; } -static void vm_open (struct kvm_vm *vm,int perm) +static void __vm_create (struct kvm_vm *vm,int perm) { vm->kvm_fd =_open_kvm_dev_path_or_exit (perm);
@@ -296,7 +296,7 @@ struct kvm_vm *vm_create(enum vm_guest_mode mode, uint64_t phy_pages, int perm) vm->type =KVM_VM_TYPE_ARM_IPA_SIZE (vm->pa_bits);#endif -vm_open (vm, perm); +__vm_create (vm, perm);/* Limit to VA-bit canonical virtual addresses. */ vm->vpages_valid =sparsebit_alloc ();
@@ -418,7 +418,7 @@ void kvm_vm_restart(struct kvm_vm *vmp, int perm)int ctr;struct userspace_mem_region *region; -vm_open (vmp, perm); +__vm_create (vmp, perm);if (vmp->has_irqchip)vm_create_irqchip (vmp);
Signature · 1 line
2.25.4
Quoted 4 lines · Krish Sadhukhan
vm_open()actually creates the VM by opening the KVM device and callingKVM_CREATE_VMioctl, so it is semantically more correct to call it__vm_create().
I see no problem with the current semantics, since the KVM_CREATE_VM ioctl *opens* a new VM file descriptor.
Quoted 7 lines · Jim Mattson
Quoted 3 lines · Krish Sadhukhan
vm_open()actually creates the VM by opening the KVM device and callingKVM_CREATE_VMioctl, so it is semantically more correct to call it__vm_create().I see no problem with the current semantics, since the
KVM_CREATE_VMioctl *opens* a new VM file descriptor.
Agreed. But the KVM device is also opened for many purposes. For example, in kvm_get_supported_cpuid() it is opened for getting CPUID stuff. The purpose of opening the KVM device in this context is to create a VM and hence I thought it would be semantically correct to rename the function.
Quoted 8 lines · Krish Sadhukhan
Quoted 5 lines · Jim Mattson
Quoted 3 lines · Krish Sadhukhan
vm_open()actually creates the VM by opening the KVM device and callingKVM_CREATE_VMioctl, so it is semantically more correct to call it__vm_create().
Quoted 8 lines
Quoted 2 lines
I see no problem with the current semantics, since the
KVM_CREATE_VMioctl *opens* a new VM file descriptor.Agreed. But the KVM device is also opened for many purposes. For example, in
kvm_get_supported_cpuid()it is opened for getting CPUID stuff. The purpose of opening the KVM device in this context is to create a VM and hence I thought it would be semantically correct to rename the function.
You are misinterpreting my response. I said nothing about the KVM device.
The KVM_CREATE_VM ioctl *opens* a brand-new VM file descriptor. In that sense, vm_open makes perfect sense.