]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: selftests: Make vcpu_ioctl() a wrapper to pretty print ioctl name
authorSean Christopherson <seanjc@google.com>
Tue, 15 Feb 2022 18:15:00 +0000 (10:15 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 11 Jun 2022 14:15:04 +0000 (10:15 -0400)
commitc217d1b28187fd2eb67b4011c88192bb3eccef6b
tree4291b1300469d75f1ac749afa7a0818e938fed9d
parent746b33d2b9aea85f9ffe5becbcc713a917633e3f
KVM: selftests: Make vcpu_ioctl() a wrapper to pretty print ioctl name

Make vcpu_ioctl() a macro wrapper and pretty the _name_ of the ioctl on
failure instead of the number.  Add inner macros to allow handling cases
where the name of the ioctl needs to be resolved higher up the stack, and
to allow using the formatting for non-ioctl syscalls without being
technically wrong.

Deliberately do not use __stringify(), as that will expand the ioctl all
the way down to its numerical sequence, again the intent is to print the
name of the macro.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/include/kvm_util_base.h
tools/testing/selftests/kvm/lib/kvm_util.c