diff options
author | Sean Christopherson <seanjc@google.com> | 2022-02-15 04:12:38 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-06-11 17:14:52 +0300 |
commit | ccc82ba6bea45189a516c97480b2b70406832f35 (patch) | |
tree | 5c1c6f2393fa171f86fd91a3b0b41c5081baa235 /tools/testing/selftests/kvm/x86_64/sev_migrate_tests.c | |
parent | d379749fdab68d0eee05e149a25f8ef45d2f19bc (diff) | |
download | linux-ccc82ba6bea45189a516c97480b2b70406832f35.tar.xz |
KVM: selftests: Always open VM file descriptors with O_RDWR
Drop the @perm param from vm_create() and always open VM file descriptors
with O_RDWR. There's no legitimate use case for other permissions, and
if a selftest wants to do oddball negative testing it can open code the
necessary bits instead of forcing a bunch of tests to provide useless
information.
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/testing/selftests/kvm/x86_64/sev_migrate_tests.c')
-rw-r--r-- | tools/testing/selftests/kvm/x86_64/sev_migrate_tests.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tools/testing/selftests/kvm/x86_64/sev_migrate_tests.c b/tools/testing/selftests/kvm/x86_64/sev_migrate_tests.c index d1dc1acf997c..b0c052443c44 100644 --- a/tools/testing/selftests/kvm/x86_64/sev_migrate_tests.c +++ b/tools/testing/selftests/kvm/x86_64/sev_migrate_tests.c @@ -54,7 +54,7 @@ static struct kvm_vm *sev_vm_create(bool es) struct kvm_sev_launch_start start = { 0 }; int i; - vm = vm_create(VM_MODE_DEFAULT, 0, O_RDWR); + vm = vm_create(VM_MODE_DEFAULT, 0); sev_ioctl(vm->fd, es ? KVM_SEV_ES_INIT : KVM_SEV_INIT, NULL); for (i = 0; i < NR_MIGRATE_TEST_VCPUS; ++i) vm_vcpu_add(vm, i); @@ -71,7 +71,7 @@ static struct kvm_vm *aux_vm_create(bool with_vcpus) struct kvm_vm *vm; int i; - vm = vm_create(VM_MODE_DEFAULT, 0, O_RDWR); + vm = vm_create(VM_MODE_DEFAULT, 0); if (!with_vcpus) return vm; @@ -174,7 +174,7 @@ static void test_sev_migrate_parameters(void) *sev_es_vm_no_vmsa; int ret; - vm_no_vcpu = vm_create(VM_MODE_DEFAULT, 0, O_RDWR); + vm_no_vcpu = vm_create(VM_MODE_DEFAULT, 0); vm_no_sev = aux_vm_create(true); ret = __sev_migrate_from(vm_no_vcpu->fd, vm_no_sev->fd); TEST_ASSERT(ret == -1 && errno == EINVAL, @@ -186,7 +186,7 @@ static void test_sev_migrate_parameters(void) sev_vm = sev_vm_create(/* es= */ false); sev_es_vm = sev_vm_create(/* es= */ true); - sev_es_vm_no_vmsa = vm_create(VM_MODE_DEFAULT, 0, O_RDWR); + sev_es_vm_no_vmsa = vm_create(VM_MODE_DEFAULT, 0); sev_ioctl(sev_es_vm_no_vmsa->fd, KVM_SEV_ES_INIT, NULL); vm_vcpu_add(sev_es_vm_no_vmsa, 1); |