KVM: selftests: Introduce vm_create_[default_]_with_vcpus
authorAndrew Jones <drjones@redhat.com>
Wed, 11 Nov 2020 12:26:30 +0000 (13:26 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Sun, 15 Nov 2020 14:49:20 +0000 (09:49 -0500)
commit0aa9ec45d42779af711c7a209b5780ff7391b5bd
treefd7b03c1f6fc3e59f09bc560cd50fd0a21915aa9
parentec2f18bb4783648041498b06d4bff222821efed1
KVM: selftests: Introduce vm_create_[default_]_with_vcpus

Introduce new vm_create variants that also takes a number of vcpus,
an amount of per-vcpu pages, and optionally a list of vcpuids. These
variants will create default VMs with enough additional pages to
cover the vcpu stacks, per-vcpu pages, and pagetable pages for all.
The new 'default' variant uses VM_MODE_DEFAULT, whereas the other
new variant accepts the mode as a parameter.

Reviewed-by: Peter Xu <peterx@redhat.com>
Reviewed-by: Ben Gardon <bgardon@google.com>
Signed-off-by: Andrew Jones <drjones@redhat.com>
Message-Id: <20201111122636.73346-6-drjones@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
tools/testing/selftests/kvm/include/kvm_util.h
tools/testing/selftests/kvm/lib/kvm_util.c