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)
commit02e04c15caeeb64a45d350a8fdeb32620b64a02d
tree4291b1300469d75f1ac749afa7a0818e938fed9d
parent2b38a7398f20dbbfa88689819b21967489d284f5
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