KVM: selftests: Use enum for test numbers in xen_shinfo_test
authorDavid Woodhouse <dwmw@amazon.co.uk>
Sat, 4 Feb 2023 02:41:50 +0000 (02:41 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Tue, 14 Mar 2023 14:20:08 +0000 (10:20 -0400)
commite7062a98d0b3e0b42089f4c5da633a1ce41b807f
tree704e961a04421a4713bf23f73e74e479a9947a61
parentc0c76d99939cb4ac28cbc5ce542cff2b9e1e1b02
KVM: selftests: Use enum for test numbers in xen_shinfo_test

The xen_shinfo_test started off with very few iterations, and the numbers
we used in GUEST_SYNC() were precisely mapped to the RUNSTATE_xxx values
anyway to start with.

It has since grown quite a few more tests, and it's kind of awful to be
handling them all as bare numbers. Especially when I want to add a new
test in the middle. Define an enum for the test stages, and use it both
in the guest code and the host switch statement.

No functional change, if I can count to 24.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20230204024151.1373296-4-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/x86_64/xen_shinfo_test.c