summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/kvm/lib/s390x
diff options
context:
space:
mode:
authorSean Christopherson <sean.j.christopherson@intel.com>2020-04-10 16:16:59 -0700
committerPaolo Bonzini <pbonzini@redhat.com>2020-04-15 12:08:42 -0400
commit4d9bba9007167074504187d27fd80352eb3a04e7 (patch)
tree6b37637b38db8c630f7bd5bfd3bb79781cba2db2 /tools/testing/selftests/kvm/lib/s390x
parent238022ff5d05f6cdceac67c03a66cc28a6cb30c9 (diff)
downloadlwn-4d9bba9007167074504187d27fd80352eb3a04e7.tar.gz
lwn-4d9bba9007167074504187d27fd80352eb3a04e7.zip
KVM: selftests: Use kernel's list instead of homebrewed replacement
Replace the KVM selftests' homebrewed linked lists for vCPUs and memory regions with the kernel's 'struct list_head'. Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> Reviewed-by: Andrew Jones <drjones@redhat.com> Message-Id: <20200410231707.7128-3-sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/testing/selftests/kvm/lib/s390x')
-rw-r--r--tools/testing/selftests/kvm/lib/s390x/processor.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/testing/selftests/kvm/lib/s390x/processor.c b/tools/testing/selftests/kvm/lib/s390x/processor.c
index 8d94961bd046..a88c5d665725 100644
--- a/tools/testing/selftests/kvm/lib/s390x/processor.c
+++ b/tools/testing/selftests/kvm/lib/s390x/processor.c
@@ -233,7 +233,10 @@ void vcpu_args_set(struct kvm_vm *vm, uint32_t vcpuid, unsigned int num, ...)
void vcpu_dump(FILE *stream, struct kvm_vm *vm, uint32_t vcpuid, uint8_t indent)
{
- struct vcpu *vcpu = vm->vcpu_head;
+ struct vcpu *vcpu = vcpu_find(vm, vcpuid);
+
+ if (!vcpu)
+ return;
fprintf(stream, "%*spstate: psw: 0x%.16llx:0x%.16llx\n",
indent, "", vcpu->state->psw_mask, vcpu->state->psw_addr);