]> 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)
commit7071d835dad28fb238bf5136ecccec6b23b8f349
tree4291b1300469d75f1ac749afa7a0818e938fed9d
parente937e534937389681721e17bf27b147df7ba83fe
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