]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: selftests: Dedup vgic_init's asserts and improve error messages
authorSean Christopherson <seanjc@google.com>
Thu, 9 Jun 2022 20:20:53 +0000 (13:20 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 11 Jun 2022 15:46:24 +0000 (11:46 -0400)
commitc9dbc262441ab44ab8c58a4109eda97623a2cb27
tree7ea84c99833961fa190490f93bcf403dbb49b098
parent48943325eb03b59c7b9bc5f0bcfea6d8a47cac0b
KVM: selftests: Dedup vgic_init's asserts and improve error messages

Move the asserts for the many REDIST_REGS accesses into common helpers
instead of copy+pasting the same, unhelpful asserts over and over.  Not
providing the actual (or expected) value makes it unnecessarily painful
to debug failures, especially since test_assert() prints the errno
unconditionally, e.g. on success, it may print a stale, misleading errno.

Use kvm_device_attr_get() to handle the "success" check so that the
"success" and "expected == actual" asserts are separated, which will make
it far less likely that a user incorrectly assumes the ioctl() failed.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/aarch64/vgic_init.c