Skip to content

Commit

Permalink
selftests: kvm: do not try running the VM in vmx_set_nested_state_test
Browse files Browse the repository at this point in the history
This test is only covering various edge cases of the
KVM_SET_NESTED_STATE ioctl.  Running the VM does not really
add anything.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
Paolo Bonzini committed Aug 15, 2019
1 parent c8e174b commit 92cd0f0
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions tools/testing/selftests/kvm/x86_64/vmx_set_nested_state_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,35 +27,20 @@

void test_nested_state(struct kvm_vm *vm, struct kvm_nested_state *state)
{
volatile struct kvm_run *run;

vcpu_nested_state_set(vm, VCPU_ID, state, false);
run = vcpu_state(vm, VCPU_ID);
vcpu_run(vm, VCPU_ID);
TEST_ASSERT(run->exit_reason == KVM_EXIT_SHUTDOWN,
"Got exit_reason other than KVM_EXIT_SHUTDOWN: %u (%s),\n",
run->exit_reason,
exit_reason_str(run->exit_reason));
}

void test_nested_state_expect_errno(struct kvm_vm *vm,
struct kvm_nested_state *state,
int expected_errno)
{
volatile struct kvm_run *run;
int rv;

rv = vcpu_nested_state_set(vm, VCPU_ID, state, true);
TEST_ASSERT(rv == -1 && errno == expected_errno,
"Expected %s (%d) from vcpu_nested_state_set but got rv: %i errno: %s (%d)",
strerror(expected_errno), expected_errno, rv, strerror(errno),
errno);
run = vcpu_state(vm, VCPU_ID);
vcpu_run(vm, VCPU_ID);
TEST_ASSERT(run->exit_reason == KVM_EXIT_SHUTDOWN,
"Got exit_reason other than KVM_EXIT_SHUTDOWN: %u (%s),\n",
run->exit_reason,
exit_reason_str(run->exit_reason));
}

void test_nested_state_expect_einval(struct kvm_vm *vm,
Expand Down

0 comments on commit 92cd0f0

Please sign in to comment.