diff options
author | Sean Christopherson <seanjc@google.com> | 2022-02-16 11:19:18 -0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2022-06-11 11:47:06 -0400 |
commit | 0ffc70eab775b52432a76f26aada24c5b78ef0eb (patch) | |
tree | 743f12bc266f5c458bbc0f453e590dc9683b7842 /tools/testing/selftests/kvm/lib/perf_test_util.c | |
parent | 0750388ca7110d332547f3669715442eac6a1254 (diff) |
KVM: selftests: Add VM creation helper that "returns" vCPUs
Add a VM creator that "returns" the created vCPUs by filling the provided
array. This will allow converting multi-vCPU tests away from hardcoded
vCPU IDs.
Signed-off-by: Sean Christopherson <seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'tools/testing/selftests/kvm/lib/perf_test_util.c')
-rw-r--r-- | tools/testing/selftests/kvm/lib/perf_test_util.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/testing/selftests/kvm/lib/perf_test_util.c b/tools/testing/selftests/kvm/lib/perf_test_util.c index f989ff91f022..d3ff05f00653 100644 --- a/tools/testing/selftests/kvm/lib/perf_test_util.c +++ b/tools/testing/selftests/kvm/lib/perf_test_util.c @@ -147,8 +147,9 @@ struct kvm_vm *perf_test_create_vm(enum vm_guest_mode mode, int vcpus, * The memory is also added to memslot 0, but that's a benign side * effect as KVM allows aliasing HVAs in meslots. */ - vm = vm_create_with_vcpus(mode, vcpus, slot0_pages, guest_num_pages, 0, - perf_test_guest_code, NULL); + vm = __vm_create_with_vcpus(mode, vcpus, DEFAULT_GUEST_PHY_PAGES, + slot0_pages + guest_num_pages, 0, + perf_test_guest_code, NULL, NULL); pta->vm = vm; |