aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/kvm/dirty_log_test.c
diff options
context:
space:
mode:
authorSean Christopherson <seanjc@google.com>2022-06-02 13:19:09 -0700
committerPaolo Bonzini <pbonzini@redhat.com>2022-06-11 11:46:26 -0400
commita12c86c447f4bce6d2725c3fab426aba6630b376 (patch)
treef11dfdf5a35e9c014cb13420cbdf66780b6761cf /tools/testing/selftests/kvm/dirty_log_test.c
parentKVM: selftests: Consolidate KVM_ENABLE_CAP usage (diff)
downloadlinux-dev-a12c86c447f4bce6d2725c3fab426aba6630b376.tar.xz
linux-dev-a12c86c447f4bce6d2725c3fab426aba6630b376.zip
KVM: selftests: Simplify KVM_ENABLE_CAP helper APIs
Rework the KVM_ENABLE_CAP helpers to take the cap and arg0; literally every current user, and likely every future user, wants to set 0 or 1 arguments and nothing else. Signed-off-by: Sean Christopherson <seanjc@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/testing/selftests/kvm/dirty_log_test.c')
-rw-r--r--tools/testing/selftests/kvm/dirty_log_test.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/tools/testing/selftests/kvm/dirty_log_test.c b/tools/testing/selftests/kvm/dirty_log_test.c
index 5752486764c9..9dfc861a3cf3 100644
--- a/tools/testing/selftests/kvm/dirty_log_test.c
+++ b/tools/testing/selftests/kvm/dirty_log_test.c
@@ -217,16 +217,13 @@ static bool clear_log_supported(void)
static void clear_log_create_vm_done(struct kvm_vm *vm)
{
- struct kvm_enable_cap cap = {};
u64 manual_caps;
manual_caps = kvm_check_cap(KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2);
TEST_ASSERT(manual_caps, "MANUAL_CAPS is zero!");
manual_caps &= (KVM_DIRTY_LOG_MANUAL_PROTECT_ENABLE |
KVM_DIRTY_LOG_INITIALLY_SET);
- cap.cap = KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2;
- cap.args[0] = manual_caps;
- vm_enable_cap(vm, &cap);
+ vm_enable_cap(vm, KVM_CAP_MANUAL_DIRTY_LOG_PROTECT2, manual_caps);
}
static void dirty_log_collect_dirty_pages(struct kvm_vm *vm, int slot,